chengf
2026-02-25 64b14b0549344f13b191e2c26ed199f62655c43f
service-api/src/main/java/com/java110/api/importData/adapt/ImportOwnerCarV2DataCleaningAdapt.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.api.importData.DefaultImportDataAdapt;
import com.java110.api.importData.IImportDataCleaningAdapt;
import com.java110.dto.importData.Vtil;
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.system.ComponentValidateResult;
import com.java110.intf.user.IOwnerV1InnerServiceSMO;
@@ -53,13 +54,16 @@
        OwnerCarDto importOwnerCar = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            Object[] os = oList.get(osIndex);
            if (osIndex <= 6) { // 第一行是 头部信息 直接跳过
            if (osIndex < 3) { // 第一行是 头部信息 直接跳过
                continue;
            }
            if (StringUtil.isNullOrNone(os[0])) {
                continue;
            }
            Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空");
//            Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空");
            if (os[8] == null || os[8].equals("")) {
                os[8] = "空";
            }
            if (defaultValue(os[1]).isEmpty() && defaultValue(os[2]).isEmpty()) {
                throw new IllegalArgumentException((osIndex + 1) + "行小区编码和小区名称必填其一");
            }
@@ -71,12 +75,12 @@
//            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[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()):"";
            String startTime = os.length >= 14 && os[14] != null ? Vtil.defaultValueToDate(os[14], "start") : null;
            String endTime = os.length >= 15 && os[15] != null ? Vtil.defaultValueToDate(os[15], "end") : null;
//            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();
@@ -112,13 +116,16 @@
        importOwnerCar = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            Object[] os = oList.get(osIndex);
            if (osIndex <= 6) { // 第一行是 头部信息 直接跳过
            if (osIndex < 3) { // 第一行是 头部信息 直接跳过
                continue;
            }
            if (StringUtil.isNullOrNone(os[0])) {
                continue;
            }
            Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空");
//            Assert.hasValue(os[8], (osIndex + 1) + "行车牌号不能为空");
            if (os[8] == null || os[8].equals("")) {
                os[8] = "空";
            }
            if (defaultValue(os[1]).isEmpty() && defaultValue(os[2]).isEmpty()) {
                throw new IllegalArgumentException((osIndex + 1) + "行小区编码和小区名称必填其一");
            }
@@ -130,12 +137,12 @@
//            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[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()):"";
            String startTime = os.length >= 14 && os[14] != null ? Vtil.defaultValueToDate(os[14], "start") : null;
            String endTime = os.length >= 15 && os[15] != null ? Vtil.defaultValueToDate(os[15], "end") : null;
//            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();
@@ -157,6 +164,11 @@
            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]));
            importOwnerCar.setParkingType(defaultValue(os[12]));
            ownerCars.add(importOwnerCar);
        }
    }