chengf
2026-01-27 b6184e2ddf3db37a94f7efb3b619bbc64642a292
service-api/src/main/java/com/java110/api/importData/adapt/ImportOwnerCarV2DataCleaningAdapt.java
@@ -36,6 +36,9 @@
        return ownerCars;
    }
    public String defaultValue(Object o) {
        return o == null ? "" : o.toString();
    }
    /**
     * 获取业主车辆信息
@@ -45,7 +48,7 @@
     */
    private void getOwnerCars(Workbook workbook, List<OwnerCarDto> ownerCars,  ComponentValidateResult result) throws ParseException {
        Sheet sheet = null;
        sheet = ImportExcelUtils.getSheet(workbook, "地面停车费 导入新模板 ");
        sheet = ImportExcelUtils.getSheet(workbook, "地面停车费 导入新模板");
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        OwnerCarDto importOwnerCar = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
@@ -56,9 +59,11 @@
            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) + "车辆类型不能为空");
@@ -66,17 +71,17 @@
//            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");
@@ -94,6 +99,10 @@
            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);
        }
@@ -109,9 +118,11 @@
            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) + "车辆类型不能为空");
@@ -119,17 +130,17 @@
//            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");