chengf
2026-02-25 64b14b0549344f13b191e2c26ed199f62655c43f
service-api/src/main/java/com/java110/api/importData/adapt/ImportRoomOwnerDataV2CleaningAdapt.java
@@ -7,6 +7,7 @@
import com.java110.dto.owner.OwnerDto;
import com.java110.dto.room.RoomDto;
import com.java110.dto.system.ComponentValidateResult;
import com.java110.utils.util.Assert;
import com.java110.utils.util.ImportExcelUtils;
import com.java110.utils.util.StringUtil;
import org.apache.poi.ss.usermodel.Sheet;
@@ -47,13 +48,57 @@
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        ImportOwnerRoomDto importOwnerRoomDto = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            if (osIndex < 7) {
            if (osIndex < 5) {
                continue;
            }
            Object[] os = oList.get(osIndex);
            if (oList.get(osIndex)[0] == null) {
                break;
            }
            Object[] os = new Object[170];
            try {
                System.arraycopy(oList.get(osIndex), 0, os, 0, oList.get(osIndex).length);
            } catch (ArrayIndexOutOfBoundsException e) {
                throw new IllegalArgumentException("Excel长度过长!");
            }
//            Assert.hasValue(os[3], (osIndex + 1) + "行项目编码不能为空");
            Assert.hasValue("住宅物业费 导入新模板中" + os[5], (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[16], (osIndex + 1) + "行住宅面积不能为空");
            os[169] = result.getUserId();
            ownerRoomDtos.add(os);
        }
        sheet = ImportExcelUtils.getSheet(workbook, " 商铺物业费 导入新模板");
        oList = ImportExcelUtils.listFromSheet(sheet);
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            if (osIndex < 5) {
                continue;
            }
            if (oList.get(osIndex)[0] == null) {
                break;
            }
            Object[] os = new Object[170];
            System.arraycopy(oList.get(osIndex), 0, os, 0, oList.get(osIndex).length);
//            Assert.hasValue(os[3], (osIndex + 1) + "行项目编码不能为空");
            Assert.hasValue("商铺物业费 导入新模板中" + os[5], (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[16], (osIndex + 1) + "行住宅面积不能为空");
            os[169] = result.getUserId();
            ownerRoomDtos.add(os);
        }
        if (ownerRoomDtos.size() == 0) {
            throw new IllegalArgumentException("sheet内容为空");
        }
    }