| | |
| | | |
| | | return ownerCars; |
| | | } |
| | | public String defaultValue(Object o) { |
| | | return o == null ? "" : o.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 获取业主车辆信息 |
| | |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | Assert.hasValue(os[8], (osIndex + 1) + "车牌号不能为空"); |
| | | Assert.hasValue(os[1], (osIndex + 1) + "项目编码不能为空"); |
| | | Assert.hasValue(os[10], (osIndex + 1) + "业主不能为空"); |
| | | Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空"); |
| | | if (defaultValue(os[1]).isEmpty() && defaultValue(os[2]).isEmpty()) { |
| | | throw new IllegalArgumentException((osIndex + 1) + "行小区编码和小区名称必填其一"); |
| | | } |
| | | // Assert.hasValue(os[10], (osIndex + 1) + "行业主不能为空"); |
| | | // Assert.hasValue(os[2], (osIndex + 1) + "手机号不能为空"); |
| | | // Assert.hasValue(os[3], (osIndex + 1) + "车辆品牌不能为空"); |
| | | // Assert.hasValue(os[4], (osIndex + 1) + "车辆类型不能为空"); |
| | |
| | | // Assert.hasValue(os[6], (osIndex + 1) + "颜色不能为空"); |
| | | // Assert.hasValue(os[7], (osIndex + 1) + "停车场不能为空"); |
| | | // Assert.hasValue(os[8], (osIndex + 1) + "车位不能为空"); |
| | | Assert.hasValue(os[14], (osIndex + 1) + "起租时间不能为空"); |
| | | Assert.hasValue(os[15], (osIndex + 1) + "截止时间不能为空"); |
| | | Assert.hasValue(os[12], (osIndex + 1) + "停车类型不能为空"); |
| | | Assert.hasValue(os[14], (osIndex + 1) + "行起租时间不能为空"); |
| | | // Assert.hasValue(os[15], (osIndex + 1) + "截止时间不能为空"); |
| | | Assert.hasValue(os[12], (osIndex + 1) + "行停车类型不能为空"); |
| | | // Assert.hasValue(os[11], (osIndex + 1) + "停车场类型不能为空"); |
| | | String startTime = os.length >= 14 && os[14] != null ? excelDoubleToDate(os[14].toString()):""; |
| | | String endTime = os.length >= 15 && os[15] != null ? excelDoubleToDate(os[15].toString()):""; |
| | | // Assert.isDate(startTime, DateUtil.DATE_FORMATE_STRING_B, (osIndex + 1) + "行开始时间格式错误 请填写YYYY-MM-DD文本格式"); |
| | | // Assert.isDate(endTime, DateUtil.DATE_FORMATE_STRING_B, (osIndex + 1) + "行结束时间格式错误 请填写YYYY-MM-DD文本格式"); |
| | | importOwnerCar = new OwnerCarDto(); |
| | | importOwnerCar.setCarNum(os[8].toString().trim()); |
| | | importOwnerCar.setOwnerName(os[10].toString().trim()); |
| | | importOwnerCar.setCarNum(defaultValue(os[8]).trim()); |
| | | importOwnerCar.setOwnerName(defaultValue(os[10]).trim()); |
| | | importOwnerCar.setLink(os.length <= 11 || os[11] == null ? "" : os[11].toString().trim()); |
| | | // importOwnerCar.setCarBrand(os.length <= 3 || os[3] == null ? "" : os[3].toString().trim()); |
| | | importOwnerCar.setCarType("9901"); |
| | |
| | | importOwnerCar.setCommunityId(result.getCommunityId()); |
| | | importOwnerCar.setUserId(result.getUserId()); |
| | | importOwnerCar.setOtherItem(os); |
| | | importOwnerCar.setRoadName(defaultValue(os[3])); |
| | | importOwnerCar.setFloorNum(defaultValue(os[4])); |
| | | importOwnerCar.setUnitNum(defaultValue(os[5])); |
| | | importOwnerCar.setRoomNum(defaultValue(os[6])); |
| | | ownerCars.add(importOwnerCar); |
| | | } |
| | | |
| | |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | Assert.hasValue(os[8], (osIndex + 1) + "车牌号不能为空"); |
| | | Assert.hasValue(os[1], (osIndex + 1) + "项目编码不能为空"); |
| | | Assert.hasValue(os[10], (osIndex + 1) + "业主不能为空"); |
| | | Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空"); |
| | | if (defaultValue(os[1]).isEmpty() && defaultValue(os[2]).isEmpty()) { |
| | | throw new IllegalArgumentException((osIndex + 1) + "行小区编码和小区名称必填其一"); |
| | | } |
| | | // Assert.hasValue(os[10], (osIndex + 1) + "行业主不能为空"); |
| | | // Assert.hasValue(os[2], (osIndex + 1) + "手机号不能为空"); |
| | | // Assert.hasValue(os[3], (osIndex + 1) + "车辆品牌不能为空"); |
| | | // Assert.hasValue(os[4], (osIndex + 1) + "车辆类型不能为空"); |
| | |
| | | // Assert.hasValue(os[6], (osIndex + 1) + "颜色不能为空"); |
| | | // Assert.hasValue(os[7], (osIndex + 1) + "停车场不能为空"); |
| | | // Assert.hasValue(os[8], (osIndex + 1) + "车位不能为空"); |
| | | Assert.hasValue(os[14], (osIndex + 1) + "起租时间不能为空"); |
| | | Assert.hasValue(os[15], (osIndex + 1) + "截止时间不能为空"); |
| | | Assert.hasValue(os[12], (osIndex + 1) + "停车类型不能为空"); |
| | | Assert.hasValue(os[14], (osIndex + 1) + "行起租时间不能为空"); |
| | | // Assert.hasValue(os[15], (osIndex + 1) + "截止时间不能为空"); |
| | | Assert.hasValue(os[12], (osIndex + 1) + "行停车类型不能为空"); |
| | | // Assert.hasValue(os[11], (osIndex + 1) + "停车场类型不能为空"); |
| | | String startTime = os.length >= 14 && os[14] != null ? excelDoubleToDate(os[14].toString()):""; |
| | | String endTime = os.length >= 15 && os[15] != null ? excelDoubleToDate(os[15].toString()):""; |
| | | // Assert.isDate(startTime, DateUtil.DATE_FORMATE_STRING_B, (osIndex + 1) + "行开始时间格式错误 请填写YYYY-MM-DD文本格式"); |
| | | // Assert.isDate(endTime, DateUtil.DATE_FORMATE_STRING_B, (osIndex + 1) + "行结束时间格式错误 请填写YYYY-MM-DD文本格式"); |
| | | importOwnerCar = new OwnerCarDto(); |
| | | importOwnerCar.setCarNum(os[8].toString().trim()); |
| | | importOwnerCar.setOwnerName(os[10].toString().trim()); |
| | | importOwnerCar.setCarNum(defaultValue(os[8]).trim()); |
| | | importOwnerCar.setOwnerName(defaultValue(os[10]).trim()); |
| | | importOwnerCar.setLink(os.length <= 11 || os[11] == null ? "" : os[11].toString().trim()); |
| | | // importOwnerCar.setCarBrand(os.length <= 3 || os[3] == null ? "" : os[3].toString().trim()); |
| | | importOwnerCar.setCarType("9901"); |