From d28ee263b8a6fb95c9fe2add2ec58b7561d3fee9 Mon Sep 17 00:00:00 2001
From: jialh <1972868360@qq.com>
Date: 星期一, 20 四月 2026 16:33:01 +0800
Subject: [PATCH] 水电话费

---
 service-api/src/main/java/com/java110/api/importData/adapt/ImportPropertyWhiteListfFlowAdapt.java |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/service-api/src/main/java/com/java110/api/importData/adapt/ImportPropertyWhiteListfFlowAdapt.java b/service-api/src/main/java/com/java110/api/importData/adapt/ImportPropertyWhiteListfFlowAdapt.java
index 6813571..c7a0be4 100644
--- a/service-api/src/main/java/com/java110/api/importData/adapt/ImportPropertyWhiteListfFlowAdapt.java
+++ b/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,15 +88,22 @@
 
     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++) {
             Object[] os = oList.get(osIndex);
             if (osIndex == 0) { // 绗竴琛屾槸 澶撮儴淇℃伅 鐩存帴璺宠繃
                 continue;
             }
-            if (StringUtil.isNullOrNone(os[3])) {
+            if (os == null || os.length < 4 || StringUtil.isNullOrNone(os[3])) {
                 continue;
             }
             Assert.hasValue(os[3], (osIndex + 1) + "琛屾敹璐规棩鏈熶笉鑳戒负绌�");
@@ -113,14 +119,10 @@
                 inputTime = Vtil.defaultValueToDate(os[24]);
             }
             white.setChargeTime(chargeTime);//鏀惰垂鏃堕棿
-            white.setInvoiceReceiptNo(Vtil.defaultValueToDate(os[4]));//鍙戠エ
+            white.setInvoiceReceiptNo(Vtil.defaultValue(os[4]));//鍙戠エ
             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);
-            }
-            List<Map<String, Object>> maps = BeanConvertUtil.beanCovertMapListC(communityInnerServiceSMOImpl.queryCommunitys(new CommunityDto()));
             setCommunityId(white, os, maps);
             white.setSecondaryFeeTypeCd(os[13] == null ? null : os[13].toString());//鏀惰垂鍐呭
             white.setChargeAmount(os[14] == null ? null : os[14].toString());//鏀惰垂閲戦

--
Gitblit v1.8.0