From 56931dc90c4e070d279a0cbf5822af010c481812 Mon Sep 17 00:00:00 2001
From: chengf <cgf12138@163.com>
Date: 星期三, 18 三月 2026 15:36:42 +0800
Subject: [PATCH] 导入测试

---
 service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java |   74 ++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 33 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 e0ab829..b3dff87 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
@@ -110,11 +110,17 @@
                 }
             } catch (Exception e) {
                 e.printStackTrace();
-                if (e.getMessage().contains("### Error updating database")){
-                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), "鏈煡閿欒锛岃鑱旂郴绠$悊鍛�" + e.getMessage());
-                }
-                else {
-                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e);
+                String errorMsg = e.getMessage();
+                // 鍏堝垽绌猴紝鍐嶅垽鏂寘鍚叧绯�
+                if (errorMsg != null && errorMsg.contains("### Error updating database")) {
+                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(),
+                            "鏈煡閿欒锛岃鑱旂郴绠$悊鍛�" + errorMsg);
+                } else {
+                    // 琛ュ厖锛氳繖閲屼篃寤鸿瀵� e 鍋氬厹搴曞鐞嗭紝閬垮厤浼犻�掔┖鐨勫紓甯镐俊鎭�
+                    String finalMsg = errorMsg != null ? errorMsg : e.toString();
+                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), finalMsg);
+                    // 濡傛灉鍘熸柟娉� updateImportLogDetailState 鎺ユ敹 Exception 绫诲瀷鍙傛暟锛屽彲淇濈暀锛�
+                    // updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e);
                 }
             }
         }
@@ -131,13 +137,17 @@
         int a = 6;
         JSONArray objects = JSONObject.parseArray(assetImportLogDetailDto.getContent());
 
-        if (Vtil.defaultValue(objects.get(16)).equals("")){
+//        if (Vtil.defaultValue(objects.get(11)) == null) {
+//            throw new IllegalArgumentException("涓氫富鍚嶇О涓嶈兘涓虹┖");
+//        }
+
+        if (Vtil.defaultValue(objects.get(16)) == null){
             throw new IllegalArgumentException("鎴垮眿闈㈢Н涓嶈兘涓虹┖");
         }
 
-        if (Vtil.defaultValue(objects.get(54)).length() > 1){
-            throw new IllegalArgumentException("鎬у埆鍐呭鏈夎!");
-        }
+//        if (Vtil.defaultValue(objects.get(54)) == null){
+//            throw new IllegalArgumentException("鎬у埆鍐呭鏈夎!");
+//        }
 
 
         ImportOwnerRoomDto importOwnerRoomDto = new ImportOwnerRoomDto();//鎴垮眿
@@ -153,7 +163,7 @@
         importOwnerRoomDto.setPersonRole(OwnerDto.PERSON_ROLE_OWNER);
         importOwnerRoomDto.setMonthlyUnitPrice(objects.getString(23));
         importOwnerRoomDto.setPropertyFeeMonth(objects.getString(24));
-        if (!Vtil.defaultValue(objects.get(1)).isEmpty()) {
+        if (Vtil.defaultValue(objects.get(1)) != null) {
             //--------璁剧疆鐗╀笟绫诲瀷
             DictDto dictDto = new DictDto();
             dictDto.setTableName("building_room");
@@ -182,7 +192,7 @@
         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("")) {
+        if (communityDto.getCommunityCode() == null && communityDto.getName() == null) {
             throw new IllegalArgumentException("瀵煎叆澶辫触锛氬皬鍖虹紪鐮佸拰灏忓尯鍚嶇О閮戒负绌�");
         }
         List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
@@ -206,7 +216,7 @@
         importOwnerRoomDto.setRoomNum(Vtil.defaultValue(objects.get(8)));//瀹�
         importOwnerRoomDto.setDoorRoomNum(Vtil.defaultValue(objects.get(9)));//闂ㄥ競鍙�
         importOwnerRoomDto.setPropertyAddress(Vtil.defaultValue(objects.get(10)));//涓氫富鍦板潃
-        importOwnerRoomDto.setRoomBuyer(Vtil.defaultValue(objects.get(11)));//璐埧浜�
+        importOwnerRoomDto.setRoomBuyer(Vtil.defaultValue(objects.get(11) , null) == null ? "鎴垮眿锛�" + importOwnerRoomDto.getPropertyAddress() + "璐埧浜哄鍚嶄负绌猴紝寰呰ˉ鍏�": Vtil.defaultValue(objects.get(11)));//璐埧浜�
 
         RoomDto roomDto = new RoomDto();
         roomDto.setCommunityId(importOwnerRoomDto.getCommunityId());
@@ -238,7 +248,7 @@
 
         //---------瀹跺涵鎴愬憳銆佺瀹�
         OwnerPo ownerPoTo3 = new OwnerPo();//
-        if (!Vtil.defaultValue(objects.get(13)).isEmpty()) {
+        if (Vtil.defaultValue(objects.get(13)) != null) {
             String link = Vtil.defaultValue(objects.get(13));
             OwnerDto ownerDto = new OwnerDto();
             ownerDto.setLink(link);
@@ -259,7 +269,7 @@
         }
 
         OwnerPo ownerPoTo2 = new OwnerPo();//TODO 绉熷鏈鍏�
-        if (!Vtil.defaultValue(objects.get(15)).isEmpty()) {
+        if (Vtil.defaultValue(objects.get(15)) != null) {
             String link = Vtil.defaultValue(objects.get(15));
             OwnerDto ownerDto = new OwnerDto();
             ownerDto.setLink(link);
@@ -290,7 +300,7 @@
         importOwnerRoomDto.setEoc(Vtil.defaultNum(objects.get(24+a)).toString());//璁惧杩愯璐�
 
         //-----TODO 寰呭鍏�  鍌即淇℃伅
-        if (!Vtil.defaultValue(objects.get(31)).isEmpty()) {
+        if (Vtil.defaultValue(objects.get(31)) != null) {
             OwnerCollectionDto ownerCollection = new OwnerCollectionDto();
             ownerCollection.setOwnerId(importOwnerRoomDto.getOwnerId());
             ownerCollection.setRoomId(importOwnerRoomDto.getRoomId());
@@ -308,7 +318,7 @@
         //-----
 
         //-----鎵撴姌淇℃伅 TODO 鏈坊鍔犻噸澶嶆牎楠�
-        if (!Vtil.defaultValue(objects.get(42)).isEmpty()) {
+        if (Vtil.defaultValue(objects.get(42)) != null) {
             ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo();//鎵撴姌
             applyRoomDiscountPo.setArdId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ardId));
             applyRoomDiscountPo.setCommunityId(importOwnerRoomDto.getCommunityId());
@@ -341,15 +351,15 @@
         importOwnerRoomDto.setTel(Vtil.defaultValue(objects.get(45+a)));//鎵嬫満鍙�
         importOwnerRoomDto.setIdCard(Vtil.defaultValue(objects.get(46+a)));//韬唤璇�
         importOwnerRoomDto.setAddress(Vtil.defaultValue(objects.get(47+a)));//TODO 瀵煎叆閫昏緫鏈坊鍔犺瀛楁  鑱旂粶鍦板潃
-        importOwnerRoomDto.setSex(Vtil.defaultValue(objects.get(48+a)).equals("") ?"2" :  Vtil.defaultValue(objects.get(48+a)));
-        importOwnerRoomDto.setOwnerName(Vtil.defaultValue(objects.get(11)));
+        importOwnerRoomDto.setSex(Vtil.defaultValue(objects.get(48+a)) == null ?"2" :  Vtil.defaultValue(objects.get(48+a)));
+        importOwnerRoomDto.setOwnerName(Vtil.defaultValue(Vtil.defaultValue(objects.get(11) , null) == null ? "鎴垮眿锛�" + importOwnerRoomDto.getPropertyAddress() + "璐埧浜哄鍚嶄负绌猴紝寰呰ˉ鍏�": Vtil.defaultValue(objects.get(11))));
         importOwnerRoomDto.setHouseholdPoliceStation(Vtil.defaultValue(objects.get(50+a)));
         importOwnerRoomDto.setPropertyCertificateNo(Vtil.defaultValue(objects.get(51+a)));
         importOwnerRoomDto.setIsEvChargerInstalled(Vtil.defaultValue(objects.get(52+a)));
 
 
 
-        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()) {
+        if (Vtil.defaultValue(objects.get(61),null) != null || Vtil.defaultValue(objects.get(141)) == null || Vtil.defaultValue(objects.get(147+a)) == null || Vtil.defaultValue(objects.get(149+a)) == null) {
             OweFeeCallablePo oweFeeCallablePo = new OweFeeCallablePo();
             oweFeeCallablePo.setOfcId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
             oweFeeCallablePo.setAmountdOwed("0");
@@ -373,7 +383,7 @@
 //            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("")) {
+            if (Vtil.defaultValue(objects.get(160+a), "") != null) {
                 oweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "銆傚娉ㄤ俊鎭細" + Vtil.defaultValue(objects.get(160+a)));
             }
 //            oweFeeCallablePo.setStartTime(Vtil.defaultValueToDate(objects.get(61)));//TODO 鏃堕棿娈甸渶瑕佹媶鍒�
@@ -386,9 +396,9 @@
 
             for (int i = 0; i < 5 ; i++) {
                 int index = i*4 + 65;
-                if(objects.get(index) == null || objects.get(index).equals("")) {
-                    break;
-                }
+//                if(objects.get(index) == null || objects.get(index).equals("")) {
+//                    break;
+//                }
                 HouseMailRecord houseMailRecord = new HouseMailRecord();
                 houseMailRecord.setId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_houseId));
                 houseMailRecord.setOwnerId(importOwnerRoomDto.getOwnerId());
@@ -426,7 +436,7 @@
             //----
 
             //----娉曢櫌瀹$悊绋嬪簭
-            if (!Vtil.defaultValue(objects.get(141)).isEmpty()) {
+//            if (!Vtil.defaultValue(objects.get(141)).isEmpty()) {
                 CourtTrialProcedure courtTrialProcedure = new CourtTrialProcedure();
                 courtTrialProcedure.setCallableId(oweFeeCallablePo.getOfcId());
                 courtTrialProcedure.setOwnerId(importOwnerRoomDto.getOwnerId());
@@ -446,11 +456,11 @@
                 courtTrialProcedure.setJudgmentResult(Vtil.defaultValue(objects.get(145+a)));
                 courtTrialProcedure.setRemark(Vtil.defaultValue(objects.get(146+a)));
                 applyRoomDiscountServiceDaoImpl.saveCourtTrialProcedure(BeanConvertUtil.beanCovertMap(courtTrialProcedure));
-            }
+//            }
             //-----
 
             //娉曢櫌鎵ц绋嬪簭
-            if (!Vtil.defaultValue(objects.get(147+a)).isEmpty() || !Vtil.defaultValue(objects.get(149+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());
@@ -465,13 +475,13 @@
                 courtExecutionProcedure.setRemark(Vtil.defaultValue(objects.get(160+a)));
 
                 applyRoomDiscountServiceDaoImpl.saveCourtExecutionProcedure(BeanConvertUtil.beanCovertMap(courtExecutionProcedure));
-            }
+//            }
 
             //----娣诲姞鐢佃仈
             List<Object> mailCallRecords = new ArrayList<Object>();
             for (int i = 0 ; i < 9 ; i++) {
                 int index = i * 3 + 86;
-                if(Vtil.defaultValue(objects.get(index)).isEmpty()){
+                if(Vtil.defaultValue(objects.get(index)) == null){
 //                if (i == 0){
 //                    MailCallRecord mailCallRecord = new MailCallRecord();
 //                    mailCallRecord.setRemark(objects.get(115).toString());
@@ -500,7 +510,7 @@
 
 
         //浜ц皟鏃ユ湡
-        if (!Vtil.defaultValue(objects.get(126)).isEmpty()) {
+//        if (!Vtil.defaultValue(objects.get(126)).isEmpty()) {
             OwnerPropertySurvey ownerPropertySurvey = new OwnerPropertySurvey();
             ownerPropertySurvey.setOwnerId(importOwnerRoomDto.getOwnerId());
             ownerPropertySurvey.setRoomId(importOwnerRoomDto.getRoomId());
@@ -509,11 +519,10 @@
             ownerPropertySurvey.setName(Vtil.defaultValue(objects.get(127)));
             ownerPropertySurvey.setExtraDate(Vtil.defaultValueToDate(objects.get(128)));
             int save = applyRoomDiscountServiceDaoImpl.saveOwnerPropertySurvey(BeanConvertUtil.beanCovertMap(ownerPropertySurvey));
-        }
+//        }
         //----
 
         //璇夎
-        if (!Vtil.defaultValue(objects.get(130)).isEmpty()) {
             LitigationInfoPo litigationInfoPo = new LitigationInfoPo();
             litigationInfoPo.setLitigationDate(Vtil.defaultValue(objects.get(130)));
             litigationInfoPo.setArrearsPeriod(Vtil.defaultValue(objects.get(131)));
@@ -526,8 +535,7 @@
             litigationInfoPo.setOwnerId(importOwnerRoomDto.getOwnerId());
             sqlSessionTemplate.insert("litigationInfoServiceDaoImpl.saveLitigationInfo",
                     BeanConvertUtil.beanCovertMap(litigationInfoPo));
-        }
-        importOwnerRoomDto.setRoomState(importOwnerRoomDto.getOwnerName().equals("") ? "2004" : "2001");
+        importOwnerRoomDto.setRoomState(importOwnerRoomDto.getOwnerName() == null ? "2004" : "2001");
 
         importOwnerRoomInnerServiceSMOImpl.saveOwnerRoom(importOwnerRoomDto);
         OwnerDto ownerDto = new OwnerDto();

--
Gitblit v1.8.0