From b88a288f4f787b509463678e3cd9ccfa3f37014b Mon Sep 17 00:00:00 2001
From: chengf <cgf12138@163.com>
Date: 星期三, 11 三月 2026 12:01:05 +0800
Subject: [PATCH] 导入测试

---
 service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java |   49 ++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java b/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java
index bd59320..78410f7 100644
--- a/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java
+++ b/service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java
@@ -103,10 +103,15 @@
                 doImportData(assetImportLogDetailDto);
 
                 updateImportLogDetailState(assetImportLogDetailDto.getDetailId());
+                try {
+                    Thread.sleep(200);
+                } catch (InterruptedException e) {
+                    throw new RuntimeException(e);
+                }
             } catch (Exception e) {
                 e.printStackTrace();
                 if (e.getMessage().contains("### Error updating database")){
-                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), "鏈煡閿欒锛岃鑱旂郴绠$悊鍛�");
+                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), "鏈煡閿欒锛岃鑱旂郴绠$悊鍛�" + e.getMessage());
                 }
                 else {
                     updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e);
@@ -125,6 +130,15 @@
 
         int a = 6;
         JSONArray objects = JSONObject.parseArray(assetImportLogDetailDto.getContent());
+
+        if (Vtil.defaultValue(objects.get(16)).equals("")){
+            throw new IllegalArgumentException("鎴垮眿闈㈢Н涓嶈兘涓虹┖");
+        }
+
+        if (Vtil.defaultValue(objects.get(54)).length() > 1){
+            throw new IllegalArgumentException("鎬у埆鍐呭鏈夎!");
+        }
+
 
         ImportOwnerRoomDto importOwnerRoomDto = new ImportOwnerRoomDto();//鎴垮眿
         importOwnerRoomDto.setRoomId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId));
@@ -166,9 +180,12 @@
         CommunityDto communityDto = new CommunityDto();
         communityDto.setCommunityCode(Vtil.defaultValue(objects.get(3)));
         communityDto.setName(Vtil.defaultValue(objects.get(4)));
+        if (communityDto.getCommunityCode().equals("") && communityDto.getName().equals("")) {
+            throw new IllegalArgumentException("瀵煎叆澶辫触锛氬皬鍖虹紪鐮佸拰灏忓尯鍚嶇О閮戒负绌�");
+        }
         List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
         if (communityDtos.isEmpty()) {
-            throw new IllegalArgumentException("瀵煎叆澶辫触:灏忓尯涓笉瀛樺湪灏忓尯缂栫爜涓衡��" + Vtil.defaultValue(objects.get(1)) + "鈥欑殑灏忓尯");
+            throw new IllegalArgumentException("瀵煎叆澶辫触:灏忓尯涓笉瀛樺湪灏忓尯鈥�" + Vtil.defaultValue(objects.get(3))+Vtil.defaultValue(objects.get(4)) + "鈥�");
         } else if (communityDtos.size() > 1) {
             String communityNames = communityDtos.stream()
                     .map(CommunityDto::getName) // 鎻愬彇姣忎釜灏忓尯鐨勫悕绉�
@@ -195,13 +212,15 @@
         roomDto.setFloorNum(importOwnerRoomDto.getFloorNum());
         roomDto.setUnitNum(importOwnerRoomDto.getUnitNum());
         roomDto.setRoomNum(importOwnerRoomDto.getRoomNum());
-        if (roomDto.getRoomNum() ==null || roomDto.getRoomNum().equals("")){
-            roomDto.setPropertyType("鍟嗛摵");
-        }
+        roomDto.setDoorRoomNum(importOwnerRoomDto.getDoorRoomNum());
+        roomDto.setPropertyAddress(importOwnerRoomDto.getPropertyAddress());
+//        if (roomDto.getRoomNum() ==null || roomDto.getRoomNum().equals("")){
+//            roomDto.setPropertyType("鍟嗛摵");
+//        }
 
         List<Object> objects1 = sqlSessionTemplate.selectList("roomServiceDaoImpl.getRoomInfo", BeanConvertUtil.beanCovertMap(roomDto));
         if (!objects1.isEmpty()) {
-            throw new IllegalArgumentException("閲嶅鐨勬埧灞�");
+            throw new IllegalArgumentException("閲嶅鐨勬埧灞�:");
         }
         List<FeeConfigDto> feeDtos = null;
         if (!importOwnerRoomDto.getCommunityId().isEmpty()){
@@ -313,7 +332,7 @@
             try {
                 applyRoomDiscountServiceDaoImpl.saveApplyRoomDiscountInfo(BeanConvertUtil.beanCovertMap(applyRoomDiscountPo));
             }catch (Exception e){
-                throw new IllegalArgumentException("瀵煎叆澶辫触:鎵撴姌淇℃伅瀵煎叆瀛樺湪閿欒");
+                throw new IllegalArgumentException("瀵煎叆澶辫触:鎵撴姌淇℃伅瀵煎叆瀛樺湪閿欒" + e.getMessage());
             }
         }
         //-----涓氫富淇℃伅
@@ -328,7 +347,7 @@
 
 
 
-        if (Vtil.defaultValue(objects.get(61),null) != null) {
+        if (Vtil.defaultValue(objects.get(61),null) != null || Vtil.defaultValue(objects.get(141)).isEmpty() || Vtil.defaultValue(objects.get(147+a)).isEmpty() || Vtil.defaultValue(objects.get(149+a)).isEmpty()) {
             OweFeeCallablePo oweFeeCallablePo = new OweFeeCallablePo();
             oweFeeCallablePo.setOfcId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
             oweFeeCallablePo.setAmountdOwed("0");
@@ -347,6 +366,14 @@
             oweFeeCallablePo.setStaffId("302025062612580518");
             oweFeeCallablePo.setStaffName("鍒樺織鍕�");
             oweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE);
+            oweFeeCallablePo.setReceivableAmount(Vtil.defaultValue(objects.get(155+a)));
+            oweFeeCallablePo.setReceivedAmount(Vtil.defaultValue(objects.get(156+a)));
+//            oweFeeCallablePo.setDifferenceReason(Vtil.defaultValue(objects.get(157+a)));
+//            oweFeeCallablePo.setReceiptTime(Vtil.defaultValue(objects.get(158+a)));
+            oweFeeCallablePo.setPayee(Vtil.defaultValue(objects.get(159+a)));
+            if (!Vtil.defaultValue(objects.get(160+a), "").equals("")) {
+                oweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "銆傚娉ㄤ俊鎭細" + Vtil.defaultValue(objects.get(160+a)));
+            }
 //            oweFeeCallablePo.setStartTime(Vtil.defaultValueToDate(objects.get(61)));//TODO 鏃堕棿娈甸渶瑕佹媶鍒�
 //            oweFeeCallablePo.setEndTime(Vtil.defaultValueToDate(objects.get(61)));
             oweFeeCallablePo.setCreateTime(Vtil.defaultValueToDate(objects.get(53+a)));
@@ -357,7 +384,7 @@
 
             for (int i = 0; i < 5 ; i++) {
                 int index = i*4 + 65;
-                if(objects.get(index) == null){
+                if(objects.get(index) == null || objects.get(index).equals("")) {
                     break;
                 }
                 HouseMailRecord houseMailRecord = new HouseMailRecord();
@@ -365,7 +392,7 @@
                 houseMailRecord.setOwnerId(importOwnerRoomDto.getOwnerId());
                 houseMailRecord.setHouseId(importOwnerRoomDto.getRoomId());
                 houseMailRecord.setCallableId(oweFeeCallablePo.getOfcId());
-                houseMailRecord.setCreateTime(Vtil.defaultValueToDate(objects.get(index)));
+                houseMailRecord.setSendDate(Vtil.defaultValueToDate(objects.get(index)));
                 houseMailRecord.setMailNo(Vtil.defaultValue(objects.get(index+1)));
                 houseMailRecord.setServiceFee(Vtil.defaultValue(objects.get(index+2)));
                 houseMailRecord.setMailResult(Vtil.defaultValue(objects.get(index+3)));
@@ -421,7 +448,7 @@
             //-----
 
             //娉曢櫌鎵ц绋嬪簭
-            if (!Vtil.defaultValue(objects.get(147+a)).isEmpty()) {
+            if (!Vtil.defaultValue(objects.get(147+a)).isEmpty() || !Vtil.defaultValue(objects.get(149+a)).isEmpty()) {
                 CourtExecutionProcedure courtExecutionProcedure = new CourtExecutionProcedure();
                 courtExecutionProcedure.setCallableId(oweFeeCallablePo.getOfcId());
                 courtExecutionProcedure.setOwnerId(importOwnerRoomDto.getOwnerId());

--
Gitblit v1.8.0