chengf
2026-03-24 b2358fc44148073645def4e723c8153a98a701da
service-api/src/main/java/com/java110/api/importData/adapt/ImportPropertyWhiteListfFlowAdapt.java
@@ -1,7 +1,6 @@
package com.java110.api.importData.adapt;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.components.ValueUtil;
import com.java110.api.importData.DefaultImportDataAdapt;
import com.java110.api.importData.IImportDataCleaningAdapt;
import com.java110.dto.PropertyWhiteListFlowDto;
@@ -52,9 +51,6 @@
        //获取车辆信息
        getPropertyWhiteListFlowDtos(workbook, whiteLists);
        for (PropertyWhiteListFlowDto whiteList : whiteLists){
            whiteList.setCommunityId(paramIn.getString("communityId"));
        }
        return whiteLists;
    }
@@ -62,24 +58,27 @@
    public void setCommunityId(PropertyWhiteListFlowDto po, Object[] os, List<Map<String, Object>> maps) {
        for (Map<String, Object> map : maps) {
            if (ValueUtil.defaultValue(os[1]).isEmpty()) {
                if (ValueUtil.defaultValue(os[2]).equals(map.get("name"))) {
            if (Vtil.defaultValue(os[1]) == null && Vtil.defaultValue(os[2]) == null){
                throw new IllegalArgumentException("小区名称和小区编号均为空");
            }
            if (Vtil.defaultValue(os[1]) == null) {
                if (Vtil.defaultValue(map.get("name")).contains(Vtil.defaultValue(os[2]))) {
                    po.setCommunityId(map.get("communityId").toString());
                    return;
                }
            } else if (ValueUtil.defaultValue(os[2]).isEmpty()){
                if (ValueUtil.defaultValue(os[1]).equals(map.get("communityCode"))) {
            } else if (Vtil.defaultValue(os[2]) == null){
                if (Vtil.defaultValue(map.get("communityCode")).equals(Vtil.defaultValue(os[1]))) {
                    po.setCommunityId(map.get("communityId").toString());
                    return;
                }
            } else {
                if (ValueUtil.defaultValue(os[1]).equals(map.get("communityCode")) && ValueUtil.defaultValue(os[1]).equals(map.get("name"))) {
                if (Vtil.defaultValue(map.get("communityCode")).equals(Vtil.defaultValue(os[1])) && Vtil.defaultValue(map.get("name")).contains(Vtil.defaultValue(os[2]))) {
                    po.setCommunityId(map.get("communityId").toString());
                    return;
                }
            }
        }
        throw new IllegalArgumentException("未查询到小区:" + Vtil.appendHyphenToRight(ValueUtil.defaultValue(os[1])) + ValueUtil.defaultValue(os[2]));
        throw new IllegalArgumentException("未查询到小区:" + Vtil.appendHyphenToRight(Vtil.defaultValue(os[1])) + Vtil.defaultValue(os[2]));
    }
@@ -89,8 +88,14 @@
    private void getPropertyWhiteListFlowDtos(Workbook workbook, List<PropertyWhiteListFlowDto> whiteLists) {
        Sheet sheet = null;
        sheet = ImportExcelUtils.getSheet(workbook, "白单流水  导入新模板");
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        List<Object[]> oList;
        try {
            sheet = ImportExcelUtils.getSheet(workbook, "白单流水  导入新模板");
            oList = ImportExcelUtils.listFromSheet(sheet);
        } catch (IllegalArgumentException e) {
            sheet = ImportExcelUtils.getSheet(workbook, "Sheet1");
            oList = ImportExcelUtils.listFromSheet(sheet);
        }
        PropertyWhiteListFlowDto white = null;
        List<Map<String, Object>> maps = BeanConvertUtil.beanCovertMapListC(communityInnerServiceSMOImpl.queryCommunitys(new CommunityDto()));
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
@@ -118,9 +123,6 @@
            white.setRoomId(os[5] == null ? null : os[5].toString());//房号
            white.setPropertyAddress(os[5] == null ? null : os[5].toString());//业主地址
            white.setDoorRoomNum((os[6] == null ? "" : os[6].toString() + "-") + (os[7] == null ? "" : os[7].toString() + "-") + (os[8] == null ? "" : os[8].toString()) );//门市号
            if (white.getDoorRoomNum().isEmpty()){
                white.setDoorRoomNum(null);
            }
            setCommunityId(white, os, maps);
            white.setSecondaryFeeTypeCd(os[13] == null ? null : os[13].toString());//收费内容
            white.setChargeAmount(os[14] == null ? null : os[14].toString());//收费金额