| | |
| | | if (osIndex == 0 || osIndex == 1) { // 第一行是 头部信息 直接跳过 |
| | | continue; |
| | | } |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | if (StringUtil.isNullOrNone(os[8])) { |
| | | continue; |
| | | } |
| | | Assert.hasValue(os[0], (osIndex + 1) + "车牌号不能为空"); |
| | | Assert.hasValue(os[1], (osIndex + 1) + "业主不能为空"); |
| | | // Assert.hasValue(os[2], (osIndex + 1) + "手机号不能为空"); |
| | | Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空"); |
| | | Assert.hasValue(os[10], (osIndex + 1) + "行业主不能为空"); |
| | | // Assert.hasValue(os[11], (osIndex + 1) + "行手机号不能为空"); |
| | | // Assert.hasValue(os[3], (osIndex + 1) + "车辆品牌不能为空"); |
| | | // Assert.hasValue(os[4], (osIndex + 1) + "车辆类型不能为空"); |
| | | // Assert.hasValue(os[5], (osIndex + 1) + "颜色不能为空"); |
| | | // Assert.hasValue(os[6], (osIndex + 1) + "停车场不能为空"); |
| | | // Assert.hasValue(os[7], (osIndex + 1) + "车位不能为空"); |
| | | Assert.hasValue(os[8], (osIndex + 1) + "起租时间不能为空"); |
| | | Assert.hasValue(os[9], (osIndex + 1) + "截止时间不能为空"); |
| | | // Assert.hasValue(os[10], (osIndex + 1) + "停车场类型不能为空"); |
| | | Assert.hasValue(os[11], (osIndex + 1) + "车位类型不能为空"); |
| | | String startTime = excelDoubleToDate(os[8].toString()); |
| | | String endTime = excelDoubleToDate(os[9].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文本格式"); |
| | | // Assert.hasValue(os[5], (osIndex + 1) + "车牌类型不能为空"); |
| | | // Assert.hasValue(os[6], (osIndex + 1) + "颜色不能为空"); |
| | | // Assert.hasValue(os[7], (osIndex + 1) + "停车场不能为空"); |
| | | // Assert.hasValue(os[9], (osIndex + 1) + "车位不能为空"); |
| | | if(os.length > 13) { |
| | | Assert.hasValue(os[14], (osIndex + 1) + "行起租时间不能为空"); |
| | | }else if(os.length > 14) { |
| | | Assert.hasValue(os[15], (osIndex + 1) + "行截止时间不能为空"); |
| | | } |
| | | |
| | | try { |
| | | importOwnerCar.setCommunityId(os[1].toString()); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException("请输入小区编码"); |
| | | } |
| | | // Assert.hasValue(os[12], (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[0].toString().trim()); |
| | | importOwnerCar.setOwnerName(os[1].toString().trim()); |
| | | importOwnerCar.setLink(os[2] == null ? "" : os[2].toString().trim()); |
| | | importOwnerCar.setCarBrand(os[3] == null ? "" : os[3].toString().trim()); |
| | | importOwnerCar.setCarType(os[4] == null ? "" : os[4].toString().trim()); |
| | | importOwnerCar.setCarColor(os[5] == null ? "" : os[5].toString().trim()); |
| | | importOwnerCar.setAreaNum(os[6] == null ? "" : os[6].toString().trim()); |
| | | importOwnerCar.setCarNum(os[8].toString().trim()); |
| | | importOwnerCar.setOwnerName(os[10].toString().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(os.length <= 4 || os[4] == null ? "" : os[4].toString().trim()); |
| | | // importOwnerCar.setLeaseType(os.length <= 5 || os[5] == null ? "" : os[5].toString().trim()); |
| | | // importOwnerCar.setCarColor(os.length <= 6 || os[6] == null ? "" : os[6].toString().trim()); |
| | | // importOwnerCar.setAreaNum(os.length <= 7 || os[7] == null ? "" : os[7].toString().trim()); |
| | | //获取车位 |
| | | String parkingLot = os[7] == null ? "" : os[7].toString().trim(); |
| | | String parkingLot = os.length <= 9 || os[9] == null ? "" : os[9].toString().trim(); |
| | | importOwnerCar.setNum(parkingLot); |
| | | importOwnerCar.setLogStartTime(startTime); |
| | | importOwnerCar.setLogEndTime(endTime); |
| | | importOwnerCar.setTypeCd(os[10] == null ? "" : os[10].toString().trim()); |
| | | importOwnerCar.setSpaceSate(os[11].toString().trim()); |
| | | importOwnerCar.setCommunityId(result.getCommunityId()); |
| | | importOwnerCar.setTypeCd(os.length <= 12 || os[12] == null ? "" : os[12].toString().trim()); |
| | | importOwnerCar.setSpaceSate("S"); |
| | | |
| | | importOwnerCar.setUserId(result.getUserId()); |
| | | ownerCars.add(importOwnerCar); |
| | | } |