From 64b14b0549344f13b191e2c26ed199f62655c43f Mon Sep 17 00:00:00 2001
From: chengf <cgf12138@163.com>
Date: 星期三, 25 二月 2026 10:12:46 +0800
Subject: [PATCH] 导入测试

---
 service-job/src/main/java/com/java110/job/importData/adapt/ImportRoomOwnerV2QueueDataAdapt.java |  396 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 207 insertions(+), 189 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 e58f5cb..bd59320 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
@@ -5,6 +5,8 @@
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.dict.DictDto;
+import com.java110.dto.fee.FeeConfigDto;
+import com.java110.dto.fee.FeeDto;
 import com.java110.dto.importData.*;
 import com.java110.dto.log.AssetImportLogDetailDto;
 import com.java110.dto.menu.MenuDto;
@@ -12,17 +14,21 @@
 import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.room.RoomDto;
 import com.java110.fee.api.ApplyRoomDiscountApi;
+import com.java110.fee.bmo.fee.IFeeBMO;
 import com.java110.fee.dao.IApplyRoomDiscountServiceDao;
+import com.java110.fee.dao.IPayFeeConfigV1ServiceDao;
 import com.java110.intf.community.ICommunityInnerServiceSMO;
 import com.java110.intf.community.IImportOwnerRoomInnerServiceSMO;
 import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.intf.dev.IDictV1InnerServiceSMO;
-import com.java110.intf.fee.IOweFeeCallableV1InnerServiceSMO;
+import com.java110.intf.fee.*;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.intf.user.IOwnerV1InnerServiceSMO;
 import com.java110.job.importData.DefaultImportData;
 import com.java110.job.importData.IImportDataAdapt;
 import com.java110.po.dict.DictPo;
+import com.java110.po.fee.FeeAttrPo;
+import com.java110.po.fee.PayFeePo;
 import com.java110.po.oweFeeCallable.OweFeeCallablePo;
 import com.java110.po.owner.OwnerPo;
 import com.java110.po.room.ApplyRoomDiscountPo;
@@ -31,6 +37,7 @@
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
 import org.mybatis.spring.SqlSessionTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -73,7 +80,15 @@
     @Autowired
     private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
 
+    @Autowired
+    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
 
+    @Autowired
+    private IPayFeeV1InnerServiceSMO payFeeV1InnerServiceSMO;
+
+
+    @Autowired
+    private IFeeAttrInnerServiceSMO feeAttrInnerServiceSMO;
     @Override
     public void importData(List<AssetImportLogDetailDto> assetImportLogDetailDtos) {
         importDatas(assetImportLogDetailDtos);
@@ -90,7 +105,12 @@
                 updateImportLogDetailState(assetImportLogDetailDto.getDetailId());
             } catch (Exception e) {
                 e.printStackTrace();
-                updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e);
+                if (e.getMessage().contains("### Error updating database")){
+                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), "鏈煡閿欒锛岃鑱旂郴绠$悊鍛�");
+                }
+                else {
+                    updateImportLogDetailState(assetImportLogDetailDto.getDetailId(), e);
+                }
             }
         }
 
@@ -123,32 +143,32 @@
         DictDto dictDto = new DictDto();
         dictDto.setTableName("building_room");
         dictDto.setTableColumns("room_sub_type");
-        dictDto.setName(defaultValue(objects.get(1)));
+        dictDto.setName(Vtil.defaultValue(objects.get(1)));
         List<DictDto> dictDtos = dictV1InnerServiceSMOImpl.queryDictAndSpecs(dictDto);
         if (dictDtos.isEmpty()) {
             DictPo dictPo = new DictPo();
             dictPo.setStatusCd(GenerateCodeFactory.getGeneratorId("2"));
             dictPo.setTableName("building_room");
             dictPo.setTableColumns("room_sub_type");
-            dictPo.setName(defaultValue(objects.get(1)));
+            dictPo.setName(Vtil.defaultValue(objects.get(1)));
             dictV1InnerServiceSMOImpl.saveDict(dictPo);
             dictDtos = dictV1InnerServiceSMOImpl.queryDictAndSpecs(dictDto);
             if (dictDtos.isEmpty()) {
-                throw new IllegalArgumentException("瀵煎叆澶辫触:瀛楀吀涓笉瀛樺湪鐗╀笟绫诲瀷:" + defaultValue(objects.get(1)));
+                throw new IllegalArgumentException("瀵煎叆澶辫触:瀛楀吀涓笉瀛樺湪鐗╀笟绫诲瀷:" + Vtil.defaultValue(objects.get(1)));
             }
         }
         importOwnerRoomDto.setRoomSubType(dictDtos.get(0).getStatusCd());
         //----------
 
-        importOwnerRoomDto.setPropertyType(defaultValue(objects.get(2)));//浣忓畢绫诲瀷
+        importOwnerRoomDto.setPropertyType(Vtil.defaultValue(objects.get(2)));//浣忓畢绫诲瀷
 
         //--------鍖归厤灏忓尯
         CommunityDto communityDto = new CommunityDto();
-        communityDto.setCommunityCode(defaultValue(objects.get(3)));
-        communityDto.setName(defaultValue(objects.get(4)));
+        communityDto.setCommunityCode(Vtil.defaultValue(objects.get(3)));
+        communityDto.setName(Vtil.defaultValue(objects.get(4)));
         List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
         if (communityDtos.isEmpty()) {
-            throw new IllegalArgumentException("瀵煎叆澶辫触:灏忓尯涓笉瀛樺湪灏忓尯缂栫爜涓衡��" + defaultValue(objects.get(1)) + "鈥欑殑灏忓尯");
+            throw new IllegalArgumentException("瀵煎叆澶辫触:灏忓尯涓笉瀛樺湪灏忓尯缂栫爜涓衡��" + Vtil.defaultValue(objects.get(1)) + "鈥欑殑灏忓尯");
         } else if (communityDtos.size() > 1) {
             String communityNames = communityDtos.stream()
                     .map(CommunityDto::getName) // 鎻愬彇姣忎釜灏忓尯鐨勫悕绉�
@@ -160,13 +180,14 @@
         importOwnerRoomDto.setCommunityId(communityId);//灏忓尯缂栧彿
         //---------
 
-        importOwnerRoomDto.setRoadName(defaultValue(objects.get(5)));//璺悕
-        importOwnerRoomDto.setFloorNum(defaultValue(objects.get(6)));//寮�
-        importOwnerRoomDto.setUnitNum(defaultValue(objects.get(7)));//闂�
-        importOwnerRoomDto.setRoomNum(defaultValue(objects.get(8)));//瀹�
-        importOwnerRoomDto.setDoorRoomNum(defaultValue(objects.get(9)));//闂ㄥ競鍙�
-        importOwnerRoomDto.setPropertyAddress(defaultValue(objects.get(10)));//涓氫富鍦板潃
-        importOwnerRoomDto.setRoomBuyer(defaultValue(objects.get(11)));//璐埧浜�
+
+        importOwnerRoomDto.setRoadName(Vtil.defaultValue(objects.get(5)));//璺悕
+        importOwnerRoomDto.setFloorNum(Vtil.defaultValue(objects.get(6)));//寮�
+        importOwnerRoomDto.setUnitNum(Vtil.defaultValue(objects.get(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)));//璐埧浜�
 
         RoomDto roomDto = new RoomDto();
         roomDto.setCommunityId(importOwnerRoomDto.getCommunityId());
@@ -174,16 +195,30 @@
         roomDto.setFloorNum(importOwnerRoomDto.getFloorNum());
         roomDto.setUnitNum(importOwnerRoomDto.getUnitNum());
         roomDto.setRoomNum(importOwnerRoomDto.getRoomNum());
-
+        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("閲嶅鐨勬埧灞�");
         }
+        List<FeeConfigDto> feeDtos = null;
+        if (!importOwnerRoomDto.getCommunityId().isEmpty()){
+            FeeConfigDto feeConfigDto = new FeeConfigDto();
+            feeConfigDto.setCommunityId(importOwnerRoomDto.getCommunityId());
+            feeConfigDto.setSecondaryFeeTypeCdName(importOwnerRoomDto.getPropertyType());
+            feeDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
+            if (feeDtos.isEmpty()) {
+                throw new IllegalArgumentException("鐗╀笟绫诲瀷`"+importOwnerRoomDto.getPropertyType()+"`鏈煡璇㈠埌鏀惰垂椤�");
+            }
+        }
+
+
         //---------瀹跺涵鎴愬憳銆佺瀹�
         OwnerPo ownerPoTo3 = new OwnerPo();//
-        if (!defaultValue(objects.get(13)).isEmpty()) {
-            String link = defaultValue(objects.get(13));
+        if (!Vtil.defaultValue(objects.get(13)).isEmpty()) {
+            String link = Vtil.defaultValue(objects.get(13));
             OwnerDto ownerDto = new OwnerDto();
             ownerDto.setLink(link);
             ownerDto.setCommunityId(communityId);
@@ -196,15 +231,15 @@
             ownerPoTo3.setState(OwnerDto.STATE_FINISH);
             ownerPoTo3.setPersonType(OwnerDto.PERSON_TYPE_PERSON);
             ownerPoTo3.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER);
-            ownerPoTo3.setName(defaultValue(objects.get(12)));
+            ownerPoTo3.setName(Vtil.defaultValue(objects.get(12)));
             ownerPoTo3.setLink(link);
             ownerPoTo3.setSex("2");
             ownerPoTo3.setPersonRole(OwnerDto.PERSON_ROLE_MEMBER);
         }
 
         OwnerPo ownerPoTo2 = new OwnerPo();//TODO 绉熷鏈鍏�
-        if (!defaultValue(objects.get(15)).isEmpty()) {
-            String link = defaultValue(objects.get(15));
+        if (!Vtil.defaultValue(objects.get(15)).isEmpty()) {
+            String link = Vtil.defaultValue(objects.get(15));
             OwnerDto ownerDto = new OwnerDto();
             ownerDto.setLink(link);
             ownerDto.setCommunityId(communityId);
@@ -218,41 +253,41 @@
             ownerPoTo2.setState(OwnerDto.STATE_FINISH);
             ownerPoTo2.setPersonType(OwnerDto.PERSON_ROLE_RENT);
             ownerPoTo2.setOwnerTypeCd(OwnerDto.OWNER_TYPE_CD_MEMBER);
-            ownerPoTo2.setName(defaultValue(objects.get(21+a)));
+            ownerPoTo2.setName(Vtil.defaultValue(objects.get(21+a)));
             ownerPoTo2.setLink(link);
             ownerPoTo2.setSex("2");
             ownerPoTo2.setPersonRole(OwnerDto.PERSON_ROLE_MEMBER);
         }
         //---------
-        importOwnerRoomDto.setBuiltUpArea(defaultValue(objects.get(16+a)));//闈㈢Н
-        importOwnerRoomDto.setRoomArea(defaultValue(objects.get(16+a)));//闈㈢Н
-        importOwnerRoomDto.setRoomRent(defaultValue(objects.get(16+a)));//闈㈢Н
-        importOwnerRoomDto.setBuyDate(defaultValueToDate(objects.get(20+a)));//璐叆鏃ユ湡
-        importOwnerRoomDto.setSellDate(defaultValueToDate(objects.get(22+a)));//鍗栧嚭鏃ユ湡
-        importOwnerRoomDto.setSellState(defaultValue(objects.get(23+a)));//鎴垮眿鐘舵��
+        importOwnerRoomDto.setBuiltUpArea(Vtil.defaultValue(objects.get(16)));//闈㈢Н
+        importOwnerRoomDto.setRoomArea(Vtil.defaultValue(objects.get(16)));//闈㈢Н
+        importOwnerRoomDto.setRoomRent(Vtil.defaultValue(objects.get(16)));//闈㈢Н
+        importOwnerRoomDto.setBuyDate(Vtil.defaultValueToDate(objects.get(28)));//璐叆鏃ユ湡
+        importOwnerRoomDto.setSellDate(Vtil.defaultValueToDate(objects.get(26)));//鍗栧嚭鏃ユ湡
+        importOwnerRoomDto.setSellState(Vtil.defaultValue(objects.get(23+a)));//鎴垮眿鐘舵��
 
-        importOwnerRoomDto.setEoc(defaultNum(objects.get(24+a)).toString());//璁惧杩愯璐�
+        importOwnerRoomDto.setEoc(Vtil.defaultNum(objects.get(24+a)).toString());//璁惧杩愯璐�
 
         //-----TODO 寰呭鍏�  鍌即淇℃伅
-        if (!defaultValue(objects.get(27)).isEmpty()) {
+        if (!Vtil.defaultValue(objects.get(31)).isEmpty()) {
             OwnerCollectionDto ownerCollection = new OwnerCollectionDto();
             ownerCollection.setOwnerId(importOwnerRoomDto.getOwnerId());
             ownerCollection.setRoomId(importOwnerRoomDto.getRoomId());
-            ownerCollection.setCollectionStartDate(defaultValueToDate(objects.get(25+a)));
-            ownerCollection.setCollectionEndDate(defaultValueToDate(objects.get(26+a)));
-            ownerCollection.setAmount(defaultValue(objects.get(27+a)));
-            ownerCollection.setFirstCollector(defaultValue(objects.get(28+a)));
-            ownerCollection.setSecondCollectorName(defaultValue(objects.get(29+a)));
-            ownerCollection.setSecondCollectorPhone(defaultValue(objects.get(30+a)));
-            ownerCollection.setSecondCollectorAddress(defaultValue(objects.get(31+a)));
-            ownerCollection.setReceiptNumber(defaultValue(objects.get(32+a)));
-            ownerCollection.setReceiptPhotoUrl(defaultValue(objects.get(33+a)));
-            ownerCollection.setRemark(defaultValue(objects.get(34+a)));
+            ownerCollection.setCollectionStartDate(Vtil.defaultValueToDate(objects.get(25+a)));
+            ownerCollection.setCollectionEndDate(Vtil.defaultValueToDate(objects.get(26+a)));
+            ownerCollection.setAmount(Vtil.defaultValue(objects.get(27+a)));
+            ownerCollection.setFirstCollector(Vtil.defaultValue(objects.get(28+a)));
+            ownerCollection.setSecondCollectorName(Vtil.defaultValue(objects.get(29+a)));
+            ownerCollection.setSecondCollectorPhone(Vtil.defaultValue(objects.get(30+a)));
+            ownerCollection.setSecondCollectorAddress(Vtil.defaultValue(objects.get(31+a)));
+            ownerCollection.setReceiptNumber(Vtil.defaultValue(objects.get(32+a)));
+            ownerCollection.setReceiptPhotoUrl(Vtil.defaultValue(objects.get(33+a)));
+            ownerCollection.setRemark(Vtil.defaultValue(objects.get(34+a)));
         }
         //-----
 
         //-----鎵撴姌淇℃伅 TODO 鏈坊鍔犻噸澶嶆牎楠�
-        if (!defaultValue(objects.get(38+a)).isEmpty()) {
+        if (!Vtil.defaultValue(objects.get(42)).isEmpty()) {
             ApplyRoomDiscountPo applyRoomDiscountPo = new ApplyRoomDiscountPo();//鎵撴姌
             applyRoomDiscountPo.setArdId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ardId));
             applyRoomDiscountPo.setCommunityId(importOwnerRoomDto.getCommunityId());
@@ -260,50 +295,40 @@
             applyRoomDiscountPo.setRoomName(importOwnerRoomDto.getPropertyAddress());
             applyRoomDiscountPo.setDiscountId("132025112781200067");
             applyRoomDiscountPo.setApplyType("152025112756040048");
-            applyRoomDiscountPo.setFixedDiscountValue(defaultNum(objects.get(36+a)));
-            applyRoomDiscountPo.setDiscountedAmount(defaultNum(objects.get(37+a)));
-            // 2. 瀹氫箟鏍煎紡鍖栧櫒锛堟敞鎰忥細SimpleDateFormat 绾跨▼涓嶅畨鍏紝姣忔浣跨敤鏂板缓瀹炰緥锛�
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/M");
-
-            try {
-                SimpleDateFormat outputSdf = new SimpleDateFormat("yyyy-MM-dd");
-                applyRoomDiscountPo.setStartTime(defaultValueToDate(objects.get(38+a)));
-                applyRoomDiscountPo.setEndTime(defaultValueToDate(objects.get(39+a)));
-            }catch (Exception e){
-                throw new IllegalArgumentException("瀵煎叆澶辫触锛氬鐞嗘姌鎵f棩鏈熷尯闂存椂鍑洪敊");
-            }
-            applyRoomDiscountPo.setDiscountArchiveDate(defaultValueToDate(objects.get(40+a)));
-            applyRoomDiscountPo.setCreateRemark(defaultValue(objects.get(41+a)));
-            applyRoomDiscountPo.setCheckRemark("瀹℃壒浜猴細" + defaultValue(objects.get(42+a)));
-            applyRoomDiscountPo.setReviewRemark("瀹℃壒浜猴細" + defaultValue(objects.get(43+a)));
+            applyRoomDiscountPo.setFixedDiscountValue(Vtil.defaultNum(objects.get(36+a)));
+            applyRoomDiscountPo.setDiscountedAmount(Vtil.defaultNum(objects.get(37+a)));
+            applyRoomDiscountPo.setStartTime(Vtil.defaultValueToDate(objects.get(38+a),"start", null));
+            applyRoomDiscountPo.setEndTime(Vtil.defaultValueToDate(objects.get(39+a), "end", null));
+            applyRoomDiscountPo.setDiscountArchiveDate(Vtil.defaultValueToDate(objects.get(40+a)));
+            applyRoomDiscountPo.setCreateRemark(Vtil.defaultValue(objects.get(41+a)));
+            applyRoomDiscountPo.setCheckRemark("瀹℃壒浜猴細" + Vtil.defaultValue(objects.get(42+a)));
+            applyRoomDiscountPo.setReviewRemark("瀹℃壒浜猴細" + Vtil.defaultValue(objects.get(43+a)));
             applyRoomDiscountPo.setCreateUserTel("鏃�");
             applyRoomDiscountPo.setCreateUserName("鐢辩郴缁熷鍏�");
             applyRoomDiscountPo.setState("4");
             applyRoomDiscountPo.setStatusCd("0");
             applyRoomDiscountPo.setInUse("0");
             applyRoomDiscountPo.setReturnWay("1001");
-            applyRoomDiscountPo.setRelatedAttachments(defaultValue(objects.get(44+a)));
+            applyRoomDiscountPo.setRelatedAttachments(Vtil.defaultValue(objects.get(44+a)));
             try {
                 applyRoomDiscountServiceDaoImpl.saveApplyRoomDiscountInfo(BeanConvertUtil.beanCovertMap(applyRoomDiscountPo));
             }catch (Exception e){
                 throw new IllegalArgumentException("瀵煎叆澶辫触:鎵撴姌淇℃伅瀵煎叆瀛樺湪閿欒");
             }
         }
-        //-----
-
         //-----涓氫富淇℃伅
-        importOwnerRoomDto.setTel(defaultValue(objects.get(45+a)));//鎵嬫満鍙�
-        importOwnerRoomDto.setIdCard(defaultValue(objects.get(46+a)));//韬唤璇�
-        importOwnerRoomDto.setAddress(defaultValue(objects.get(47+a)));//TODO 瀵煎叆閫昏緫鏈坊鍔犺瀛楁  鑱旂粶鍦板潃
-        importOwnerRoomDto.setSex(defaultValue(objects.get(48+a)).equals("") ?"2" :  defaultValue(objects.get(48+a)));
-        importOwnerRoomDto.setOwnerName(defaultValue(objects.get(11)));
-        importOwnerRoomDto.setHouseholdPoliceStation(defaultValue(objects.get(50+a)));
-        importOwnerRoomDto.setPropertyCertificateNo(defaultValue(objects.get(51+a)));
-        importOwnerRoomDto.setIsEvChargerInstalled(defaultValue(objects.get(52+a)));
+        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.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(57+a),null) != null) {
+        if (Vtil.defaultValue(objects.get(61),null) != null) {
             OweFeeCallablePo oweFeeCallablePo = new OweFeeCallablePo();
             oweFeeCallablePo.setOfcId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
             oweFeeCallablePo.setAmountdOwed("0");
@@ -315,23 +340,23 @@
             oweFeeCallablePo.setConfigId("");
             oweFeeCallablePo.setOwnerId(importOwnerRoomDto.getOwnerId());
             oweFeeCallablePo.setOwnerName(importOwnerRoomDto.getOwnerName());
-            oweFeeCallablePo.setPayerObjId("");
+            oweFeeCallablePo.setPayerObjId(importOwnerRoomDto.getRoomId());
             oweFeeCallablePo.setPayerObjName(importOwnerRoomDto.getPropertyAddress());
             oweFeeCallablePo.setPayerObjType("3333");
-            oweFeeCallablePo.setRemark(defaultValue(objects.get(57+a)));
+            oweFeeCallablePo.setRemark(Vtil.defaultValue(objects.get(57+a)) + "\n\n鍌敹鏃舵锛�" + Vtil.defaultValueToDate(objects.get(61)));
             oweFeeCallablePo.setStaffId("302025062612580518");
             oweFeeCallablePo.setStaffName("鍒樺織鍕�");
             oweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE);
-            oweFeeCallablePo.setStartTime(defaultValueToDate(objects.get(56+a)));//TODO 鏃堕棿娈甸渶瑕佹媶鍒�
-            oweFeeCallablePo.setEndTime(defaultValueToDate(objects.get(56+a)));
-            oweFeeCallablePo.setCreateTime(defaultValueToDate(objects.get(53+a)));
+//            oweFeeCallablePo.setStartTime(Vtil.defaultValueToDate(objects.get(61)));//TODO 鏃堕棿娈甸渶瑕佹媶鍒�
+//            oweFeeCallablePo.setEndTime(Vtil.defaultValueToDate(objects.get(61)));
+            oweFeeCallablePo.setCreateTime(Vtil.defaultValueToDate(objects.get(53+a)));
             int flag = oweFeeCallableV1InnerServiceSMOImpl.saveOweFeeCallable(oweFeeCallablePo);
             if (flag < 1) {
                 throw new IllegalArgumentException("鍌敹淇℃伅瀵煎叆澶辫触");
             }
 
             for (int i = 0; i < 5 ; i++) {
-                int index = i*4 + 59+a;
+                int index = i*4 + 65;
                 if(objects.get(index) == null){
                     break;
                 }
@@ -340,11 +365,11 @@
                 houseMailRecord.setOwnerId(importOwnerRoomDto.getOwnerId());
                 houseMailRecord.setHouseId(importOwnerRoomDto.getRoomId());
                 houseMailRecord.setCallableId(oweFeeCallablePo.getOfcId());
-                houseMailRecord.setCreateTime(defaultValueToDate(objects.get(index)));
-                houseMailRecord.setMailNo(defaultValue(objects.get(index+1)));
-                houseMailRecord.setServiceFee(defaultValue(objects.get(index+2)));
-                houseMailRecord.setMailResult(defaultValue(objects.get(index+3)));
-                houseMailRecord.setRemark(defaultValue(objects.get(79+a)));
+                houseMailRecord.setCreateTime(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)));
+                houseMailRecord.setRemark(Vtil.defaultValue(objects.get(79+a)));
 
                 int save = applyRoomDiscountServiceDaoImpl.saveHouseMailRecord(BeanConvertUtil.beanCovertMap(houseMailRecord));
             }
@@ -352,18 +377,18 @@
             //----瀵规柟鏀舵鍗曚綅琛�
             PayeeReceiveInfoPo payeeReceiveInfoPo = new PayeeReceiveInfoPo();
             payeeReceiveInfoPo.setCallableId(oweFeeCallablePo.getOfcId());
-            payeeReceiveInfoPo.setCallerName(defaultValue(objects.get(80+a)));
-            payeeReceiveInfoPo.setContactInfo(defaultValue(objects.get(81+a)));
-            payeeReceiveInfoPo.setPayeeInfo(defaultValue(objects.get(82+a)));
-            payeeReceiveInfoPo.setInvoiceNo(defaultValue(objects.get(83+a)));
-            payeeReceiveInfoPo.setInvoiceDate(objects.getDate(84+a));
-            payeeReceiveInfoPo.setReceiptNo(defaultValue(objects.get(85+a)));
-            payeeReceiveInfoPo.setReceiptDate(objects.getDate(86+a));
-            payeeReceiveInfoPo.setReceiptNote(defaultValue(objects.get(87+a)));
-            payeeReceiveInfoPo.setReceiptNoteDate(objects.getDate(88+a));
-            payeeReceiveInfoPo.setImageFile(defaultValue(objects.get(89+a)));
-            payeeReceiveInfoPo.setOurCompanyReceiveDate(objects.getDate(90+a));
-            payeeReceiveInfoPo.setAttachmentFile(defaultValue(objects.get(91+a)));
+            payeeReceiveInfoPo.setCallerName(Vtil.defaultValue(objects.get(88)));
+            payeeReceiveInfoPo.setContactInfo(Vtil.defaultValue(objects.get(89)));
+            payeeReceiveInfoPo.setPayeeInfo(Vtil.defaultValue(objects.get(90)));
+            payeeReceiveInfoPo.setInvoiceNo(Vtil.defaultValue(objects.get(91)));
+            payeeReceiveInfoPo.setInvoiceDate(objects.getDate(92));
+            payeeReceiveInfoPo.setReceiptNo(Vtil.defaultValue(objects.get(93)));
+            payeeReceiveInfoPo.setReceiptDate(objects.getDate(94));
+            payeeReceiveInfoPo.setReceiptNote(Vtil.defaultValue(objects.get(95)));
+            payeeReceiveInfoPo.setReceiptNoteDate(objects.getDate(96));
+            payeeReceiveInfoPo.setImageFile(Vtil.defaultValue(objects.get(97)));
+            payeeReceiveInfoPo.setOurCompanyReceiveDate(objects.getDate(98));
+            payeeReceiveInfoPo.setAttachmentFile(Vtil.defaultValue(objects.get(99)));
             payeeReceiveInfoPo.setOwnerId(importOwnerRoomDto.getOwnerId());
             payeeReceiveInfoPo.setRoomId(importOwnerRoomDto.getRoomId());
             int insert = sqlSessionTemplate.insert("payeeReceiveInfoServiceDaoImpl.savePayeeReceiveInfo",
@@ -372,102 +397,103 @@
             //----
 
             //----娉曢櫌瀹$悊绋嬪簭
-            if (!defaultValue(objects.get(132+a)).isEmpty()) {
+            if (!Vtil.defaultValue(objects.get(141)).isEmpty()) {
                 CourtTrialProcedure courtTrialProcedure = new CourtTrialProcedure();
                 courtTrialProcedure.setCallableId(oweFeeCallablePo.getOfcId());
                 courtTrialProcedure.setOwnerId(importOwnerRoomDto.getOwnerId());
-                courtTrialProcedure.setAcceptCourtName(defaultValue(objects.get(132+a)));
-                courtTrialProcedure.setJudgeName(defaultValue(objects.get(133+a)));
-                courtTrialProcedure.setJudgeContact(defaultValue(objects.get(134+a)));
-                courtTrialProcedure.setJudgeNoticeAcceptDate(defaultValueToDate(objects.get(135+a)));
-                courtTrialProcedure.setCourtMediationDate(defaultValueToDate(objects.get(136+a)));
-                courtTrialProcedure.setMediationResult(defaultValue(objects.get(137+a)));
-                courtTrialProcedure.setSubpoenaSignDate(defaultValueToDate(objects.get(138+a)));
-                courtTrialProcedure.setUndeliveredDate(defaultValueToDate(objects.get(139+a)));
-                courtTrialProcedure.setCourtSessionDate1(defaultValueToDate(objects.get(140+a)));
-                courtTrialProcedure.setCourtSessionDate2(defaultValueToDate(objects.get(141+a)));
-                courtTrialProcedure.setCaseNumber(defaultValue(objects.get(142+a)));
-                courtTrialProcedure.setCourtSessionResult(defaultValue(objects.get(143+a)));
-                courtTrialProcedure.setJudgmentDate(defaultValueToDate(objects.get(144+a)));
-                courtTrialProcedure.setJudgmentResult(defaultValue(objects.get(145+a)));
-                courtTrialProcedure.setRemark(defaultValue(objects.get(146+a)));
+                courtTrialProcedure.setAcceptCourtName(Vtil.defaultValue(objects.get(132+a)));
+                courtTrialProcedure.setJudgeName(Vtil.defaultValue(objects.get(133+a)));
+                courtTrialProcedure.setJudgeContact(Vtil.defaultValue(objects.get(134+a)));
+                courtTrialProcedure.setJudgeNoticeAcceptDate(Vtil.defaultValueToDate(objects.get(135+a)));
+                courtTrialProcedure.setCourtMediationDate(Vtil.defaultValueToDate(objects.get(136+a)));
+                courtTrialProcedure.setMediationResult(Vtil.defaultValue(objects.get(137+a)));
+                courtTrialProcedure.setSubpoenaSignDate(Vtil.defaultValueToDate(objects.get(138+a)));
+                courtTrialProcedure.setUndeliveredDate(Vtil.defaultValueToDate(objects.get(139+a)));
+                courtTrialProcedure.setCourtSessionDate1(Vtil.defaultValueToDate(objects.get(140+a)));
+                courtTrialProcedure.setCourtSessionDate2(Vtil.defaultValueToDate(objects.get(141+a)));
+                courtTrialProcedure.setCaseNumber(Vtil.defaultValue(objects.get(142+a)));
+                courtTrialProcedure.setCourtSessionResult(Vtil.defaultValue(objects.get(143+a)));
+                courtTrialProcedure.setJudgmentDate(Vtil.defaultValueToDate(objects.get(144+a)));
+                courtTrialProcedure.setJudgmentResult(Vtil.defaultValue(objects.get(145+a)));
+                courtTrialProcedure.setRemark(Vtil.defaultValue(objects.get(146+a)));
                 applyRoomDiscountServiceDaoImpl.saveCourtTrialProcedure(BeanConvertUtil.beanCovertMap(courtTrialProcedure));
             }
             //-----
 
             //娉曢櫌鎵ц绋嬪簭
-            if (!defaultValue(objects.get(147+a)).isEmpty()) {
+            if (!Vtil.defaultValue(objects.get(147+a)).isEmpty()) {
                 CourtExecutionProcedure courtExecutionProcedure = new CourtExecutionProcedure();
                 courtExecutionProcedure.setCallableId(oweFeeCallablePo.getOfcId());
                 courtExecutionProcedure.setOwnerId(importOwnerRoomDto.getOwnerId());
-                courtExecutionProcedure.setApplyTime(defaultValueToDate(objects.get(147+a)));
-                courtExecutionProcedure.setJudgmentDocNumber(defaultValue(objects.get(148+a)));
-                courtExecutionProcedure.setArrearsPeriod(defaultValue(objects.get(149+a)));
-                courtExecutionProcedure.setArrearsAmount(defaultValue(objects.get(150+a)));
-                courtExecutionProcedure.setLateFee(defaultValue(objects.get(151+a)));
-                courtExecutionProcedure.setAcceptanceFee(defaultValue(objects.get(152+a)));
-                courtExecutionProcedure.setOtherFee(defaultValue(objects.get(153+a)));
-                courtExecutionProcedure.setTotalAmount(defaultValue(objects.get(154+a)));
-                courtExecutionProcedure.setRemark(defaultValue(objects.get(160+a)));
+                courtExecutionProcedure.setApplyTime(Vtil.defaultValueToDate(objects.get(147+a)));
+                courtExecutionProcedure.setJudgmentDocNumber(Vtil.defaultValue(objects.get(148+a)));
+                courtExecutionProcedure.setArrearsPeriod(Vtil.defaultValue(objects.get(149+a)));
+                courtExecutionProcedure.setArrearsAmount(Vtil.defaultValue(objects.get(150+a)));
+                courtExecutionProcedure.setLateFee(Vtil.defaultValue(objects.get(151+a)));
+                courtExecutionProcedure.setAcceptanceFee(Vtil.defaultValue(objects.get(152+a)));
+                courtExecutionProcedure.setOtherFee(Vtil.defaultValue(objects.get(153+a)));
+                courtExecutionProcedure.setTotalAmount(Vtil.defaultValue(objects.get(154+a)));
+                courtExecutionProcedure.setRemark(Vtil.defaultValue(objects.get(160+a)));
 
                 applyRoomDiscountServiceDaoImpl.saveCourtExecutionProcedure(BeanConvertUtil.beanCovertMap(courtExecutionProcedure));
             }
-        }
 
-        //----娣诲姞鐢佃仈
-        List<MailCallRecord> mailCallRecords = new ArrayList<MailCallRecord>();
-        for (int i = 0 ; i < 9 ; i++) {
-            int index = i * 3 + 92;
-            if(defaultValue(objects.get(index)).isEmpty()){
+            //----娣诲姞鐢佃仈
+            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 (i == 0){
 //                    MailCallRecord mailCallRecord = new MailCallRecord();
 //                    mailCallRecord.setRemark(objects.get(115).toString());
 //
 //                    int save = applyRoomDiscountServiceDaoImpl.saveMailCallRecord(BeanConvertUtil.beanCovertMap(mailCallRecord));
 //                }
-                break;
+                    break;
+                }
+                MailCallRecord mailCallRecord = new MailCallRecord();
+                mailCallRecord.setMailId(oweFeeCallablePo.getOfcId());
+                mailCallRecord.setCallDate(Vtil.defaultValueToDate(objects.get(index + (i == 0 ? 0 : 12))));
+                mailCallRecord.setCallResult(Vtil.defaultValue(objects.get(index+1 + (i == 0 ? 0 : 12))));
+                mailCallRecord.setCallContact(Vtil.defaultValue(objects.get(index+2 + 12)));
+                mailCallRecord.setRemark(Vtil.defaultValue(objects.get(125)));
+                mailCallRecords.add(mailCallRecord);
             }
-            MailCallRecord mailCallRecord = new MailCallRecord();
-            mailCallRecord.setMailId(importOwnerRoomDto.getOwnerId());
-            mailCallRecord.setCallDate(defaultValueToDate(objects.get(index)));
-            mailCallRecord.setCallResult(defaultValue(objects.get(index+1)));
-            mailCallRecord.setCallContact(defaultValue(objects.get(index+2)));
-            mailCallRecord.setRemark(defaultValue(objects.get(119)));
-            mailCallRecords.add(mailCallRecord);
+            if (mailCallRecords.size() > 0) {
+                Map<String, Object> param = new HashMap<>();
+                param.put("mailCallRecordList", BeanConvertUtil.beanCovertMapList(mailCallRecords));
+
+                sqlSessionTemplate.insert("mailCallRecordServiceDaoImpl.batchSaveMailCallRecord", param);
+            }
+            //----
+
         }
 
-        if (mailCallRecords.size() > 0) {
-            Map<String, Object> param = new HashMap<>();
-            param.put("mailCallRecordList", BeanConvertUtil.beanCovertMap(mailCallRecords));
-
-            sqlSessionTemplate.insert("mailCallRecordServiceDaoImpl.batchSaveMailCallRecord", param);
-        }
-        //----
 
         //浜ц皟鏃ユ湡
-        if (!defaultValue(objects.get(120)).isEmpty()) {
+        if (!Vtil.defaultValue(objects.get(126)).isEmpty()) {
             OwnerPropertySurvey ownerPropertySurvey = new OwnerPropertySurvey();
             ownerPropertySurvey.setOwnerId(importOwnerRoomDto.getOwnerId());
             ownerPropertySurvey.setRoomId(importOwnerRoomDto.getRoomId());
-            ownerPropertySurvey.setSurveyWarrantApplyDate(defaultValueToDate(objects.get(123)));
-            ownerPropertySurvey.setPropertySurveyDate(defaultValueToDate(objects.get(120)));
-            ownerPropertySurvey.setName(defaultValue(objects.get(121)));
-            ownerPropertySurvey.setExtraDate(defaultValueToDate(objects.get(122)));
+            ownerPropertySurvey.setSurveyWarrantApplyDate(Vtil.defaultValueToDate(objects.get(129)));
+            ownerPropertySurvey.setPropertySurveyDate(Vtil.defaultValueToDate(objects.get(126)));
+            ownerPropertySurvey.setName(Vtil.defaultValue(objects.get(127)));
+            ownerPropertySurvey.setExtraDate(Vtil.defaultValueToDate(objects.get(128)));
             int save = applyRoomDiscountServiceDaoImpl.saveOwnerPropertySurvey(BeanConvertUtil.beanCovertMap(ownerPropertySurvey));
         }
         //----
 
         //璇夎
-        if (!defaultValue(objects.get(124)).isEmpty()) {
+        if (!Vtil.defaultValue(objects.get(130)).isEmpty()) {
             LitigationInfoPo litigationInfoPo = new LitigationInfoPo();
-            litigationInfoPo.setLitigationDate(defaultValue(objects.get(124)));
-            litigationInfoPo.setArrearsPeriod(defaultValue(objects.get(125)));
-            litigationInfoPo.setArrearsAmount(defaultValue(objects.get(126)));
-            litigationInfoPo.setLateFee(defaultValue(objects.get(127)));
-            litigationInfoPo.setAcceptanceFee(defaultValue(objects.get(128)));
-            litigationInfoPo.setOtherFee(defaultValue(objects.get(129)));
-            litigationInfoPo.setTotalAmount(defaultValue(objects.get(130)));
-            litigationInfoPo.setSubmitter(defaultValue(objects.get(131)));
+            litigationInfoPo.setLitigationDate(Vtil.defaultValue(objects.get(130)));
+            litigationInfoPo.setArrearsPeriod(Vtil.defaultValue(objects.get(131)));
+            litigationInfoPo.setArrearsAmount(Vtil.defaultValue(objects.get(132)));
+            litigationInfoPo.setLateFee(Vtil.defaultValue(objects.get(133)));
+            litigationInfoPo.setAcceptanceFee(Vtil.defaultValue(objects.get(134)));
+            litigationInfoPo.setOtherFee(Vtil.defaultValue(objects.get(135)));
+            litigationInfoPo.setTotalAmount(Vtil.defaultValue(objects.get(136)));
+            litigationInfoPo.setSubmitter(Vtil.defaultValue(objects.get(137)));
             litigationInfoPo.setOwnerId(importOwnerRoomDto.getOwnerId());
             sqlSessionTemplate.insert("litigationInfoServiceDaoImpl.saveLitigationInfo",
                     BeanConvertUtil.beanCovertMap(litigationInfoPo));
@@ -488,41 +514,33 @@
                 ownerV1InnerServiceSMOImpl.saveOwner(ownerPoTo3);
             }
         }
-    }
-
-    private String defaultValueToDate(Object o) {
-        // 绌哄�肩洿鎺ヨ繑鍥瀗ull锛堝師鏈夐�昏緫锛�
-        if (o == null || o.toString().isEmpty() || o.toString().equals("0")) {
-            return null;
+        for (int i = 0 ; i < feeDtos.size(); i++) {
+            FeeConfigDto feeDto = feeDtos.get(i);
+            PayFeePo payFeePo = new PayFeePo();
+            payFeePo.setFeeId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_feeId));
+            payFeePo.setbId("-1");
+            payFeePo.setFeeTypeCd(feeDto.getFeeTypeCd());
+            payFeePo.setSecondaryFeeTypeCd(feeDto.getSecondaryFeeTypeCd());
+            payFeePo.setCommunityId(importOwnerRoomDto.getCommunityId());
+            payFeePo.setPayerObjId(importOwnerRoomDto.getRoomId());
+            payFeePo.setIncomeObjId("102025062610470035");
+            payFeePo.setStartTime(feeDto.getStartTime());
+            payFeePo.setEndTime(feeDto.getStartTime());
+            payFeePo.setUserId(importOwnerRoomDto.getUserId());
+            payFeePo.setStatusCd("0");
+            payFeePo.setFeeFlag(feeDto.getFeeFlag());
+            payFeePo.setConfigId(feeDto.getConfigId());
+            payFeePo.setState("2008001");
+            payFeePo.setPayerObjType("3333");
+            payFeePo.setBatchId(assetImportLogDetailDto.getLogId());
+            payFeeV1InnerServiceSMO.savePayFee(payFeePo);
+            List<FeeAttrPo> feeAttrPos = new ArrayList<>();
+            feeAttrPos.add(new FeeAttrPo(payFeePo.getFeeId(), payFeePo.getCommunityId(), GenerateCodeFactory.getGeneratorId("11"), "390007" , importOwnerRoomDto.getOwnerId()));
+            feeAttrPos.add(new FeeAttrPo(payFeePo.getFeeId(), payFeePo.getCommunityId(), GenerateCodeFactory.getGeneratorId("11"), "390010" , feeDto.getEndTime().split(" ")[0] + " 23:59:59"));
+            feeAttrPos.add(new FeeAttrPo(payFeePo.getFeeId(), payFeePo.getCommunityId(), GenerateCodeFactory.getGeneratorId("11"), "390009" , importOwnerRoomDto.getTel()));
+            feeAttrPos.add(new FeeAttrPo(payFeePo.getFeeId(), payFeePo.getCommunityId(), GenerateCodeFactory.getGeneratorId("11"), "390008" , importOwnerRoomDto.getOwnerName()));
+            feeAttrPos.add(new FeeAttrPo(payFeePo.getFeeId(), payFeePo.getCommunityId(), GenerateCodeFactory.getGeneratorId("11"), "390012" , importOwnerRoomDto.getDoorRoomNum()));
+            int i1 = feeAttrInnerServiceSMO.saveFeeAttrs(feeAttrPos);
         }
-
-        try {
-            // 灏濊瘯灏嗗璞¤浆鎹负鏁板瓧锛堝吋瀹笶xcel鏃ユ湡搴忓垪鍙凤紝濡�44747锛�
-            double excelDateNum = Double.parseDouble(o.toString());
-
-            // Excel 1900鏃ユ湡绯荤粺鍩哄噯锛堜慨姝i棸鏃ug锛屽疄闄呭熀鍑嗘槸1899-12-30锛�
-            Calendar calendar = Calendar.getInstance();
-            calendar.set(1899, 11, 30, 0, 0, 0); // 鏈堜唤浠�0寮�濮嬶紝11浠h〃12鏈�
-            calendar.set(Calendar.MILLISECOND, 0);
-
-            // 璁$畻瀵瑰簲鐨勫疄闄呮棩鏈�
-            calendar.add(Calendar.DAY_OF_MONTH, (int) excelDateNum);
-
-            // 鏍煎紡鍖栦负yyyy-MM-dd鐨勬棩鏈熷瓧绗︿覆
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-            return sdf.format(calendar.getTime());
-        } catch (NumberFormatException e) {
-            // 闈炴暟瀛楃被鍨嬶紝鎵ц鍘熸湁閫昏緫杩斿洖toString()
-            return o.toString();
-        }
-    }
-
-    public String defaultValue(Object o) {
-        return o == null ? "" : o.toString();
-    }
-
-
-    public BigDecimal defaultNum(Object o) {
-        return o == null ? new BigDecimal(0) : new BigDecimal(o.toString());
     }
 }

--
Gitblit v1.8.0