From dd6687b118561100e1677e88a9c2f5842a54c531 Mon Sep 17 00:00:00 2001
From: jialh <1972868360@qq.com>
Date: 星期四, 16 四月 2026 18:14:14 +0800
Subject: [PATCH] 水电话费
---
service-job/src/main/java/com/java110/job/importData/adapt/ImportReportMainV2QueueDataAdapt.java | 743 ++++++++++++++++++--------------------------------------
1 files changed, 238 insertions(+), 505 deletions(-)
diff --git a/service-job/src/main/java/com/java110/job/importData/adapt/ImportReportMainV2QueueDataAdapt.java b/service-job/src/main/java/com/java110/job/importData/adapt/ImportReportMainV2QueueDataAdapt.java
index bb7acdc..a927ca6 100644
--- a/service-job/src/main/java/com/java110/job/importData/adapt/ImportReportMainV2QueueDataAdapt.java
+++ b/service-job/src/main/java/com/java110/job/importData/adapt/ImportReportMainV2QueueDataAdapt.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.importData.Vtil;
import com.java110.dto.log.AssetImportLogDetailDto;
import com.java110.dto.msg.MaintenancePaymentPo;
import com.java110.dto.msg.MpFifthPaymentRecordPo;
@@ -55,7 +56,6 @@
// 娉ㄥ叆鏁版嵁搴撴湇鍔★紙SqlSessionTemplate鐗圫ervice锛�
@Override
- @Transactional(rollbackFor = Exception.class) // 浜嬪姟鎺у埗锛岀‘淇�3寮犺〃鏁版嵁涓�鑷存��
public void importData(List<AssetImportLogDetailDto> assetImportLogDetailDtos) {
for (AssetImportLogDetailDto logDetailDto : assetImportLogDetailDtos) {
try {
@@ -67,12 +67,6 @@
String flowNumber = getCellValue(cellArray, 1); // 绗�2鍒楋細娴佽浆缂栧彿
String projectName = getCellValue(cellArray, 4); // 绗�5鍒楋細椤圭洰鍚嶇О
String ownersCommitteeAmountStr = getCellValue(cellArray, 12); // 绗�13鍒楋細涓氬浼氶噾棰�
- if (isBlank(flowNumber) || isBlank(projectName) || isBlank(ownersCommitteeAmountStr)) {
- throw new IllegalArgumentException(
- String.format("鏍稿績瀛楁缂哄け锛氭祦杞紪鍙穂%s]銆侀」鐩悕绉癧%s]銆佷笟濮斾細閲戦[%s]",
- flowNumber, projectName, ownersCommitteeAmountStr)
- );
- }
AnnouncementTimeRangePo announcementTimeRangePo = null;
OwnersCommitteeConventionPo ocoPo = null;
OwnerWithdrawalInfoPo owiPo = null;
@@ -81,31 +75,32 @@
// 3. 鏋勫缓3寮犺〃鐨凱O瀵硅薄锛堝瓧娈垫槧灏�+涓氬姟璁$畻锛�
MaintenancePayment mainPo = buildMaintenancePaymentPoV2(cellArray);//涓昏〃
- if (!getCellValue(cellArray, 22).isEmpty() && !getCellValue(cellArray, 23).isEmpty()) {
- announcementTimeRangePo = buildAnnouncementTimeRangePo(cellArray, Long.valueOf(mainPo.getId()));//鍏叡鏀剁泭閲�
- }
- if (!getCellValue(cellArray, 26).isEmpty() && !getCellValue(cellArray, 27).isEmpty()) {
- ocoPo = buildOwnersCommitteeConventionPo(cellArray, Long.valueOf(mainPo.getId()));
- }
- if (!getCellValue(cellArray, 29).isEmpty()) {
- owiPo = buildOwnerWithdrawalInfoPo(cellArray, Long.valueOf(mainPo.getId()));
- }
- if (!getCellValue(cellArray, 39).isEmpty()) {
- oqgPo = buildOwnerQualityGuaranteePo(cellArray, Long.valueOf(mainPo.getId()));
- }
- List<MpPaymentRecordPo> paymentRecordPos = buildMpPaymentRecordPos(cellArray, mainPo.getFlowNumber(), String.valueOf(mainPo.getId()));
- List<MpFifthPaymentRecord> fifthPos = buildMpFifthPaymentRecordPos(cellArray, mainPo.getFlowNumber(), String.valueOf(mainPo.getId()));
- if (!getCellValue(cellArray, 137).isEmpty()) {
- ownerRemarkInfoPo = buildOwnerRemarkInfoPo(cellArray, mainPo.getFlowNumber(), String.valueOf(mainPo.getId()));
- }
+// if (!getCellValue(cellArray, 22).isEmpty() && !getCellValue(cellArray, 23).isEmpty()) {
+ announcementTimeRangePo = buildAnnouncementTimeRangePo(cellArray, mainPo.getId());//鍏叡鏀剁泭閲�
+// }
+// if (!getCellValue(cellArray, 26).isEmpty() && !getCellValue(cellArray, 27).isEmpty()) {
+ ocoPo = buildOwnersCommitteeConventionPo(cellArray, mainPo.getId());
+// }
+// if (!getCellValue(cellArray, 29).isEmpty()) {
+ owiPo = buildOwnerWithdrawalInfoPo(cellArray, mainPo.getId());
+// }
+// if (!getCellValue(cellArray, 39).isEmpty()) {
+ oqgPo = buildOwnerQualityGuaranteePo(cellArray, mainPo.getId());
+// }
+ List<MpPaymentRecordPo> paymentRecordPos = buildMpPaymentRecordPos(cellArray, mainPo.getFlowNumber(), mainPo.getId());
+ List<MpFifthPaymentRecord> fifthPos = buildMpFifthPaymentRecordPos(cellArray, mainPo.getFlowNumber(), mainPo.getId());
+// if (!getCellValue(cellArray, 137).isEmpty()) {
+ ownerRemarkInfoPo = buildOwnerRemarkInfoPo(cellArray, mainPo.getFlowNumber(), mainPo.getId());
+// }
importData(mainPo, announcementTimeRangePo, ocoPo, owiPo, oqgPo, paymentRecordPos, fifthPos, ownerRemarkInfoPo);
// 5. 鏇存柊瀵煎叆鏃ュ織鐘舵�侊紙鎴愬姛锛�- 璋冪敤鐖剁被鏂规硶
- super.updateImportLogDetailState(logDetailDto.getDetailId());
+ updateImportLogDetailState(logDetailDto.getDetailId());
} catch (Exception e) {
- throw new IllegalArgumentException(e.getMessage());
+ e.printStackTrace();
+ updateImportLogDetailState(logDetailDto.getDetailId(), e);
}
}
}
@@ -140,278 +135,218 @@
OwnerRemarkInfoPo po = new OwnerRemarkInfoPo();
long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
po.setId(longId);
- po.setMpId(flowNumber);
+ po.setMpId(id);
po.setRemarkPerson("瀵煎叆鍐呭");
- po.setRemarkContent(getCellValue(cellArray, 137));
+// po.setRemarkContent(getCellValue(cellArray, 137));
return po;
}
- private OwnerQualityGuaranteePo buildOwnerQualityGuaranteePo(JSONArray cellArray, Long aLong) {
+ private OwnerQualityGuaranteePo buildOwnerQualityGuaranteePo(JSONArray cellArray, String aLong) {
OwnerQualityGuaranteePo po = new OwnerQualityGuaranteePo();
long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
po.setId(longId); // 涓婚敭ID
- po.setMpId(aLong.toString());
- try {
- po.setQualityGuaranteePeriod2Start(parseDateToString(getCellValue(cellArray, 37)));
- po.setQualityGuaranteePeriod2End(parseDateToString(getCellValue(cellArray, 38)));
- po.setAcceptanceDate(parseDateToString(getCellValue(cellArray, 41)));
- po.setAvailableWithdrawalDate(parseDate(getCellValue(cellArray, 43)));
- } catch (ParseException e) {
- throw new RuntimeException("鏃ユ湡杞崲閿欒");
- }
- po.setQualityGuaranteeRatio(getCellNum(cellArray, 39));
- po.setQualityGuaranteeAmount(getCellNum(cellArray, 12) * po.getQualityGuaranteeRatio());
- po.setAuditStatus(getCellValue(cellArray, 42));
+ po.setMpId(aLong);
+// po.setQualityGuaranteePeriod2Start(Vtil.defaultValueToDate(getCellValue(cellArray, 37)));
+// po.setQualityGuaranteePeriod2End(Vtil.defaultValueToDate(getCellValue(cellArray, 38)));
+// po.setAcceptanceDate(Vtil.defaultValueToDate(getCellValue(cellArray, 41)));
+// po.setAvailableWithdrawalDate(Vtil.defaultValueToDate(getCellValue(cellArray, 43)));
+// po.setQualityGuaranteeRatio(getCellNum(cellArray, 39));
+// po.setQualityGuaranteeAmount(getCellNum(cellArray, 12) * po.getQualityGuaranteeRatio());
+// po.setAuditStatus(getCellValue(cellArray, 42));
return po;
}
- private OwnerWithdrawalInfoPo buildOwnerWithdrawalInfoPo(JSONArray cellArray, Long aLong) {
+ private OwnerWithdrawalInfoPo buildOwnerWithdrawalInfoPo(JSONArray cellArray, String aLong) {
OwnerWithdrawalInfoPo po = new OwnerWithdrawalInfoPo();
long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
po.setId(longId); // 涓婚敭ID
- po.setMpId(aLong.toString());
- po.setWithdrawalEncounteredProblem(getCellValue(cellArray, 28));
- po.setShortageOrArrears(getCellNum(cellArray, 29));
- po.setRoadName(getCellValue(cellArray, 30));
- po.setLane(getCellValue(cellArray, 31));
- po.setDoor(getCellValue(cellArray, 32));
- po.setRoom(getCellValue(cellArray, 33));
- po.setDoorRoomNumber(getCellValue(cellArray, 34));
- po.setOwnerAddress(getCellValue(cellArray, 35));
+ po.setMpId(aLong);
+// po.setWithdrawalEncounteredProblem(getCellValue(cellArray, 28));
+// po.setShortageOrArrears(getCellNum(cellArray, 29));
+// po.setRoadName(getCellValue(cellArray, 30));
+// po.setLane(getCellValue(cellArray, 31));
+// po.setDoor(getCellValue(cellArray, 32));
+// po.setRoom(getCellValue(cellArray, 33));
+// po.setDoorRoomNumber(getCellValue(cellArray, 34));
+// po.setOwnerAddress(getCellValue(cellArray, 35));
return po;
}
- private OwnersCommitteeConventionPo buildOwnersCommitteeConventionPo(JSONArray cellArray, Long mpId) {
+ private OwnersCommitteeConventionPo buildOwnersCommitteeConventionPo(JSONArray cellArray, String mpId) {
OwnersCommitteeConventionPo po = new OwnersCommitteeConventionPo();
long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
po.setId(longId); // 涓婚敭ID
po.setMpId(mpId);
- po.setQuota(getCellNum(cellArray, 25));
- po.setOwnersCommitteeResolution(getCellValue(cellArray, 26));
- po.setOwnersCommitteeConsultation(getCellValue(cellArray, 27));
+// po.setQuota(getCellNum(cellArray, 25));
+// po.setOwnersCommitteeResolution(getCellValue(cellArray, 26));
+// po.setOwnersCommitteeConsultation(getCellValue(cellArray, 27));
return po;
}
- private AnnouncementTimeRangePo buildAnnouncementTimeRangePo(JSONArray cellArray, Long mpId) {
+ private AnnouncementTimeRangePo buildAnnouncementTimeRangePo(JSONArray cellArray, String mpId) {
AnnouncementTimeRangePo po = new AnnouncementTimeRangePo();
long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
po.setId(longId); // 涓婚敭ID
po.setMpId(mpId);
- po.setPlannedAnnouncementStart(getCellValue(cellArray, 21));
- po.setPlannedAnnouncementEnd(getCellValue(cellArray, 22));
- po.setPublishedAnnouncementStart(getCellValue(cellArray, 23));
- po.setPublishedAnnouncementEnd(getCellValue(cellArray, 24));
+// po.setPlannedAnnouncementStart(getCellValue(cellArray, 21));
+// po.setPlannedAnnouncementEnd(getCellValue(cellArray, 22));
+// po.setPublishedAnnouncementStart(getCellValue(cellArray, 23));
+// po.setPublishedAnnouncementEnd(getCellValue(cellArray, 24));
return po;
}
private MaintenancePayment buildMaintenancePaymentPoV2(JSONArray cellArray) throws ParseException {
MaintenancePayment po = new MaintenancePayment();
- po.setId(GenerateCodeFactory.getGeneratorId("10")); // 涓婚敭ID
- po.setAuxiliaryColumn(getCellValue(cellArray, 0)); // 绗�1鍒楋細杈呭姪鍒�
- po.setFlowNumber(getCellValue(cellArray, 1)); // 绗�2鍒楋細娴佽浆缂栧彿
- po.setSerialNumber(parseInteger(getCellValue(cellArray, 2))); // 绗�3鍒楋細搴忓彿
- po.setProjectCode(getCellValue(cellArray, 3)); // 绗�4鍒楋細椤圭洰缂栫爜
- po.setProjectName(getCellValue(cellArray, 4)); // 绗�5鍒楋細椤圭洰鍚嶇О
- po.setYear(parseInteger(getCellValue(cellArray, 5))); // 绗�6鍒楋細骞翠唤
- po.setMonth(parseInteger(getCellValue(cellArray, 6))); // 绗�7鍒楋細鏈堜唤
- po.setDay(parseInteger(getCellValue(cellArray, 7))); // 绗�8鍒楋細鏃�
- po.setDate(parseDate(getCellValue(cellArray, 8))); // 绗�9鍒楋細鏃ユ湡
- po.setProjectContent(getCellValue(cellArray, 9)); // 绗�10鍒楋細宸ョ▼鍐呭
- po.setManagementOfficeAmount(getCellValue(cellArray, 10)); // 绗�11鍒楋細绠$悊澶勯噾棰�
- po.setManagementOfficeSeal(convertSealStatus(getCellValue(cellArray, 11))); // 绗�12鍒楋細绠$悊澶勬槸鍚﹀凡鐩栫珷锛堚垰杞�"鏄�"锛屽惁鍒�"鍚�"锛�
- po.setOwnersCommitteeAmount(getCellValue(cellArray, 12)); // 绗�13鍒楋細涓氬浼氶噾棰�
- po.setAuditAmount(getCellNum(cellArray, 13).toString()); // 绗�14鍒楋細瀹′环閲戦
- po.setOwnersCommitteeSeal(convertSealStatus(getCellValue(cellArray, 14))); // 绗�15鍒楋細涓氬浼氭槸鍚﹀凡鐩栫珷
- po.setReportDepartment(getCellValue(cellArray, 15)); // 绗�16鍒楋細绛炬姤閮ㄩ棬
- po.setFundTypeLevel1(getCellValue(cellArray, 16)); // 绗�17鍒楋細鍩洪噾绫诲瀷-涓�绾у垎绫�
- po.setFundTypeLevel2(getCellValue(cellArray, 17)); // 绗�18鍒楋細鍩洪噾绫诲瀷-浜岀骇鍒嗙被
- po.setMaintenanceType(getCellValue(cellArray, 18)); // 绗�19鍒楋細骞�/鍏ㄤ綋
- po.setBuildingOrAll(getCellValue(cellArray, 19)); // 绗�20鍒楋細缁翠慨绫诲瀷
- po.setPayeeName(getCellValue(cellArray, 145)); // 鏀粯鍏徃鍚嶇О/涓汉鍚嶅瓧
- po.setIdCardNumber(getCellValue(cellArray, 146)); // 涓汉韬唤璇佸彿鐮�
- po.setBankName(getCellValue(cellArray, 147)); // 寮�鎴烽摱琛�
- po.setBankAccount(getCellValue(cellArray, 148)); // 寮�鎴疯处鍙�
- return po;
+ try {
+ po.setId(GenerateCodeFactory.getGeneratorId("10")); // 涓婚敭ID
+ po.setAuxiliaryColumn(getCellValue(cellArray, 0)); // 绗�1鍒楋細杈呭姪鍒�
+ po.setFlowNumber(getCellValue(cellArray, 1)); // 绗�2鍒楋細娴佽浆缂栧彿
+ po.setSerialNumber(getCellValue(cellArray, 2)); // 绗�3鍒楋細搴忓彿
+ po.setProjectCode(getCellValue(cellArray, 3)); // 绗�4鍒楋細椤圭洰缂栫爜
+ po.setProjectName(getCellValue(cellArray, 4)); // 绗�5鍒楋細椤圭洰鍚嶇О
+ po.setYear(getCellValue(cellArray, 5)); // 绗�6鍒楋細骞翠唤
+ po.setMonth(getCellValue(cellArray, 6)); // 绗�7鍒楋細鏈堜唤
+ po.setDay(getCellValue(cellArray, 7)); // 绗�8鍒楋細鏃�
+ po.setDate(Vtil.defaultValueToDate(getCellValue(cellArray, 8))); // 绗�9鍒楋細鏃ユ湡
+ po.setProjectContent(getCellValue(cellArray, 9)); // 绗�10鍒楋細宸ョ▼鍐呭
+ po.setManagementOfficeAmount(getCellValue(cellArray, 10)); // 绗�11鍒楋細绠$悊澶勯噾棰�
+ po.setManagementOfficeSeal(getCellValue(cellArray, 11)); // 绗�12鍒楋細绠$悊澶勬槸鍚﹀凡鐩栫珷锛堚垰杞�"鏄�"锛屽惁鍒�"鍚�"锛�
+ po.setOwnersCommitteeAmount(getCellValue(cellArray, 12)); // 绗�13鍒楋細涓氬浼氶噾棰�
+ po.setAuditAmount(getCellValue(cellArray, 13)); // 绗�14鍒楋細瀹′环閲戦
+ po.setOwnersCommitteeSeal(getCellValue(cellArray, 14)); // 绗�15鍒楋細涓氬浼氭槸鍚﹀凡鐩栫珷
+ po.setReportDepartment(getCellValue(cellArray, 15)); // 绗�16鍒楋細绛炬姤閮ㄩ棬
+ po.setFundTypeLevel1(getCellValue(cellArray, 16)); // 绗�17鍒楋細鍩洪噾绫诲瀷-涓�绾у垎绫�
+ po.setFundTypeLevel2(getCellValue(cellArray, 17)); // 绗�18鍒楋細鍩洪噾绫诲瀷-浜岀骇鍒嗙被
+ po.setMaintenanceType(getCellValue(cellArray, 18)); // 绗�19鍒楋細骞�/鍏ㄤ綋
+ po.setBuildingOrAll(getCellValue(cellArray, 19)); // 绗�20鍒楋細缁翠慨绫诲瀷
+ po.setSpecificAnnouncementStatus(getCellValue(cellArray, 20));//鍏蜂綋鍏竷鎯呭喌 TODO 娣诲姞sql瀛楁
+ po.setQuota(getCellValue(cellArray, 21)); // 22锛氶搴�
+ po.setOwnersCommitteeResolution(getCellValue(cellArray, 22)); // 23锛氫笟濮斾細澶т細鍐宠锛堟槸/鍚︼級
+ po.setOwnersCommitteeConsultation(getCellValue(cellArray, 23)); // 24锛氫笟濮斾細寰佽琛紙鏄惁锛�
+ po.setWithdrawalEncounteredProblem(getCellValue(cellArray, 24)); // 25锛氭敮鍙栭亣鍒扮殑闂
+ po.setShortageOrArrears(getCellValue(cellArray, 25)); // 26锛氱己鏀�/娆犳锛堝厓锛�
+ po.setRoadName(getCellValue(cellArray, 26)); // 璺悕
+ po.setLane(getCellValue(cellArray, 27)); // 寮�
+ po.setDoor(getCellValue(cellArray, 28)); // 闂�
+ po.setRoom(getCellValue(cellArray, 29)); // 瀹�
+ po.setDoorRoomNumber(getCellValue(cellArray, 30)); // 闂ㄥ鍙�
+ po.setOwnerAddress(getCellValue(cellArray, 31)); // 涓氫富鍦板潃
+ po.setQualityGuaranteePeriod2(getCellValue(cellArray, 32)); // 33锛氳川淇濇湡锛堢浜屼釜锛�
+ po.setQualityGuaranteeRatio(getCellValue(cellArray, 33)); // 34锛氳川淇濋噾鍗犳瘮
+ po.setQualityGuaranteeAmount(getCellValue(cellArray, 34)); // 35锛氳川淇濋噾閲戦锛堝厓锛�
+ po.setAcceptanceDate(getCellValue(cellArray, 35)); // 楠屾敹鏃ユ湡
+ po.setAuditDate(getCellValue(cellArray, 36)); // 瀹¤鎯呭喌锛氬勾/鏈�
+ po.setAvailableWithdrawalDate(getCellValue(cellArray, 37)); // 绗�40鍒楋細鍙惎鍔ㄦ敮鍙栨棩鏈燂紙骞存湀鏃ワ級
+
+ po.setManagementFeeRatio(getCellValue(cellArray, 164)); // 绠$悊璐�
+ po.setPaymentTarget(getCellValue(cellArray, 168)); // 鏀粯瀵硅薄
+ po.setPayeeName(getCellValue(cellArray, 239)); // 鏀粯鍏徃鍚嶇О/涓汉鍚嶅瓧
+ po.setIdCardNumber(getCellValue(cellArray, 240)); // 涓汉韬唤璇佸彿鐮�
+ po.setBankName(getCellValue(cellArray, 241)); // 寮�鎴烽摱琛�
+ po.setBankAccount(getCellValue(cellArray, 242)); // 寮�鎴疯处鍙�
+ po.setAuditDate(getCellValue(cellArray, 252)); // 瀹¤鎯呭喌锛氬勾/鏈�
+ po.setAdvancedPayment(getCellValue(cellArray, 246));//鍨粯閲戦
+ po.setPayableAmountD(getCellValue(cellArray, 251));//搴斾粯閲戦D锛堢壒娈婁粯娆撅級_John
+ return po;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ return po;
+ }
}
/**
* 鏋勫缓 MaintenancePaymentPo锛堢淮淇祫閲戞敮鍙栦俊鎭〃锛�
* 瀛楁鏄犲皠瀵瑰簲"鑽i『鑻戠鎶ュ崟"琛ㄥご椤哄簭锛屽寘鍚�17涓嚜鍔ㄨ绠楀瓧娈�
*/
- private MaintenancePaymentPo buildMaintenancePaymentPo(JSONArray cellArray) throws ParseException {
- MaintenancePaymentPo po = new MaintenancePaymentPo();
- // 鍩虹瀛楁锛堢洿鎺ユ槧灏凟xcel鍗曞厓鏍硷級
- long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
- po.setId(longId+""); // 涓婚敭ID
- po.setAuxiliaryColumn(getCellValue(cellArray, 0)); // 绗�1鍒楋細杈呭姪鍒�
- po.setFlowNumber(getCellValue(cellArray, 1)); // 绗�2鍒楋細娴佽浆缂栧彿
- po.setSerialNumber(parseInteger(getCellValue(cellArray, 2))); // 绗�3鍒楋細搴忓彿
- po.setProjectCode(getCellValue(cellArray, 3)); // 绗�4鍒楋細椤圭洰缂栫爜
- po.setProjectName(getCellValue(cellArray, 4)); // 绗�5鍒楋細椤圭洰鍚嶇О
- po.setYear(parseInteger(getCellValue(cellArray, 5))); // 绗�6鍒楋細骞翠唤
- po.setMonth(parseInteger(getCellValue(cellArray, 6))); // 绗�7鍒楋細鏈堜唤
- po.setDay(parseInteger(getCellValue(cellArray, 7))); // 绗�8鍒楋細鏃�
- po.setDate(parseDate(getCellValue(cellArray, 8))); // 绗�9鍒楋細鏃ユ湡
- po.setProjectContent(getCellValue(cellArray, 9)); // 绗�10鍒楋細宸ョ▼鍐呭
- po.setManagementOfficeAmount(parseBigDecimal(getCellValue(cellArray, 10))); // 绗�11鍒楋細绠$悊澶勯噾棰�
- po.setManagementOfficeSeal(convertSealStatus(getCellValue(cellArray, 11))); // 绗�12鍒楋細绠$悊澶勬槸鍚﹀凡鐩栫珷锛堚垰杞�"鏄�"锛屽惁鍒�"鍚�"锛�
- po.setOwnersCommitteeAmount(parseBigDecimal(getCellValue(cellArray, 12))); // 绗�13鍒楋細涓氬浼氶噾棰�
- po.setAuditAmount(parseBigDecimal(getCellValue(cellArray, 13))); // 绗�14鍒楋細瀹′环閲戦
- po.setOwnersCommitteeSeal(convertSealStatus(getCellValue(cellArray, 14))); // 绗�15鍒楋細涓氬浼氭槸鍚﹀凡鐩栫珷
- po.setReportDepartment(getCellValue(cellArray, 15)); // 绗�16鍒楋細绛炬姤閮ㄩ棬
- po.setFundTypeLevel1(getCellValue(cellArray, 16)); // 绗�17鍒楋細鍩洪噾绫诲瀷-涓�绾у垎绫�
- po.setFundTypeLevel2(getCellValue(cellArray, 17)); // 绗�18鍒楋細鍩洪噾绫诲瀷-浜岀骇鍒嗙被
- po.setBuildingOrAll(getCellValue(cellArray, 18)); // 绗�19鍒楋細骞�/鍏ㄤ綋
- po.setMaintenanceType(getCellValue(cellArray, 19)); // 绗�20鍒楋細缁翠慨绫诲瀷
- po.setQualityGuaranteePeriod1(getCellValue(cellArray, 20)); // 绗�21鍒楋細璐ㄤ繚鏈燂紙绗竴涓級
- po.setPublicIncomeAnnouncement(getCellValue(cellArray, 21)); // 绗�22鍒楋細鍏叡鏀剁泭閲戝叕甯冩儏鍐�
- // 鍏叡鏀剁泭閲戝叕甯冨瓙瀛楁锛堢23-26鍒楋級
- po.setPlannedAnnouncementStart(getCellValue(cellArray, 21)); // 鎷熷叕甯�-璧峰锛堝勾鏈堬級
- po.setPlannedAnnouncementEnd(getCellValue(cellArray, 22)); // 鎷熷叕甯�-姝紙骞存湀锛�
- po.setPublishedAnnouncementStart(getCellValue(cellArray, 23)); // 宸插叕甯�-璧峰锛堝勾鏈堬級
- po.setPublishedAnnouncementEnd(getCellValue(cellArray, 24)); // 宸插叕甯�-姝紙骞存湀锛�
- po.setQuota(parseBigDecimal(getCellValue(cellArray, 25))); // 绗�27鍒楋細棰濆害
- po.setOwnersCommitteeResolution(convertYesNo(getCellValue(cellArray, 26))); // 绗�28鍒楋細涓氬浼氬ぇ浼氬喅璁紙鏄�/鍚︼級
- po.setOwnersCommitteeConsultation(convertYesNo(getCellValue(cellArray, 27))); // 绗�29鍒楋細涓氬浼氬緛璇㈣〃锛堟槸鍚︼級
- po.setWithdrawalEncounteredProblem(getCellValue(cellArray, 28)); // 绗�30鍒楋細鏀彇閬囧埌鐨勯棶棰�
- po.setShortageOrArrears(parseBigDecimal(getCellValue(cellArray, 29))); // 绗�31鍒楋細缂烘敮/娆犳锛堝厓锛�
- // 涓氫富鍦板潃瀛愬瓧娈碉紙绗�32-37鍒楋級
- po.setRoadName(getCellValue(cellArray, 30)); // 璺悕
- po.setLane(getCellValue(cellArray, 31)); // 寮�
- po.setDoor(getCellValue(cellArray, 32)); // 闂�
- po.setRoom(getCellValue(cellArray, 33)); // 瀹�
- po.setDoorRoomNumber(getCellValue(cellArray, 34)); // 闂ㄥ鍙�
- po.setOwnerAddress(getCellValue(cellArray, 35)); // 涓氫富鍦板潃
-// po.setWithdrawalProblem(getCellValue(cellArray, 36)); // 绗�38鍒楋細鏀彇瀛樺湪闂
- po.setProblemDifficulty(getCellValue(cellArray, 36)); // 绗�39鍒楋細闂闅惧害
- po.setAvailableWithdrawalDate(parseDate(getCellValue(cellArray, 37))); // 绗�40鍒楋細鍙惎鍔ㄦ敮鍙栨棩鏈燂紙骞存湀鏃ワ級
- po.setQualityGuaranteePeriod2(getCellValue(cellArray, 39) + "~" + getCellValue(cellArray, 40)); // 绗�41鍒楋細璐ㄤ繚鏈燂紙绗簩涓級
- po.setQualityGuaranteeRatio(parseBigDecimal(getCellValue(cellArray, 40))); // 绗�42鍒楋細璐ㄤ繚閲戝崰姣�
- po.setQualityGuaranteeAmount(parseBigDecimal(getCellValue(cellArray, 41))); // 绗�43鍒楋細璐ㄤ繚閲戦噾棰濓紙鍏冿級
- po.setReceivedQualityGuarantee(parseBigDecimal(getCellValue(cellArray, 42))); // 绗�44鍒楋細宸插埌璐﹁川淇濋噾
-// po.setStartDate(parseDate(getCellValue(cellArray, 44))); // 绗�45鍒楋細璧峰锛堝勾鏈堟棩锛�
-// po.setEndDate(parseDate(getCellValue(cellArray, 45))); // 绗�46鍒楋細缁堟锛堝勾鏈堟棩锛�
-
- // -------------------------- 17涓嚜鍔ㄨ绠楀瓧娈碉紙鏍稿績涓氬姟閫昏緫锛�--------------------------
- // 1. 鎵撳嵃鍚堣 = 绗竴娆绗簲娆℃墦鍗伴噾棰濅箣鍜岋紙绗�47鍒楁墦鍗伴噾棰�+绗�54鍒�+绗�61鍒�+绗�68鍒�+绗�75鍒楋級
- BigDecimal print1 = parseBigDecimal(getCellValue(cellArray, 45)); // 绗竴娆℃墦鍗伴噾棰濓紙绗�50鍒楋級
- BigDecimal print2 = parseBigDecimal(getCellValue(cellArray, 57)); // 绗簩娆℃墦鍗伴噾棰濓紙绗�57鍒楋級
- BigDecimal print3 = parseBigDecimal(getCellValue(cellArray, 69)); // 绗笁娆℃墦鍗伴噾棰濓紙绗�64鍒楋級
- BigDecimal print4 = parseBigDecimal(getCellValue(cellArray, 81)); // 绗洓娆℃墦鍗伴噾棰濓紙绗�71鍒楋級
- BigDecimal print5 = parseBigDecimal(getCellValue(cellArray, 93)); // 绗簲娆℃墦鍗伴噾棰濓紙绗�78鍒楋級
-// BigDecimal printTotal = add(print1, print2, print3, print4, print5);
-// po.setPrintTotal(printTotal); // 鑷畾涔夊瓧娈碉細鎵撳嵃鍚堣
-
- // 2. 鍒拌处鍚堣 = 绗竴娆绗簲娆″埌璐﹂噾棰濅箣鍜岋紙绗�51鍒�+绗�58鍒�+绗�65鍒�+绗�72鍒�+绗�79鍒楋級
- BigDecimal arrival1 = parseBigDecimal(getCellValue(cellArray, 48)); // 绗竴娆″埌璐﹂噾棰濓紙绗�52鍒楋級
- BigDecimal arrival2 = parseBigDecimal(getCellValue(cellArray, 60)); // 绗簩娆″埌璐﹂噾棰濓紙绗�59鍒楋級
- BigDecimal arrival3 = parseBigDecimal(getCellValue(cellArray, 72)); // 绗笁娆″埌璐﹂噾棰濓紙绗�66鍒楋級
- BigDecimal arrival4 = parseBigDecimal(getCellValue(cellArray, 84)); // 绗洓娆″埌璐﹂噾棰濓紙绗�73鍒楋級
- BigDecimal arrival5 = parseBigDecimal(getCellValue(cellArray, 96)); // 绗簲娆″埌璐﹂噾棰濓紙绗�80鍒楋級
-// BigDecimal arrivalTotal = add(arrival1, arrival2, arrival3, arrival4, arrival5);
-// po.setArrivalTotal(arrivalTotal); // 鑷畾涔夊瓧娈碉細鍒拌处鍚堣
-
- // 3. 缁翠慨鍩洪噾鍒拌处鐜� = IF(鍒拌处鍚堣<>0, 鍒拌处鍚堣/涓氬浼氶噾棰�, 0)
- BigDecimal ownersAmount = po.getOwnersCommitteeAmount();
-// BigDecimal fundArrivalRate = (arrivalTotal.compareTo(BigDecimal.ZERO) != 0 && ownersAmount.compareTo(BigDecimal.ZERO) != 0)
-// ? arrivalTotal.divide(ownersAmount, 4, BigDecimal.ROUND_HALF_UP) // 淇濈暀4浣嶅皬鏁�
-// : BigDecimal.ZERO;
-// po.setFundArrivalRate(fundArrivalRate); // 鑷畾涔夊瓧娈碉細缁翠慨鍩洪噾鍒拌处鐜�
-
- // 4. 灏氱己閲戦 = IF(鍩洪噾绫诲瀷<>"缁翠慨鍩洪噾", 0, 涓氬浼氶噾棰�-鍒拌处鍚堣)
- String fundType = po.getFundTypeLevel1();
-// BigDecimal shortageAmount = ("缁翠慨鍩洪噾".equals(fundType))
-// ? subtract(ownersAmount, arrivalTotal)
-// : BigDecimal.ZERO;
-// po.setFundShortageAmount(shortageAmount); // 鑷畾涔夊瓧娈碉細灏氱己閲戦
-
- // 5. 绠$悊璐� = 绠$悊澶勯噾棰� * 绠$悊璐瑰崰姣旓紙鐧惧垎姣旇浆灏忔暟锛�
- BigDecimal managementFeeRatio = po.getManagementFeeRatio() == null ? BigDecimal.ZERO : po.getManagementFeeRatio().divide(new BigDecimal(100));
- BigDecimal managementFee = multiply(po.getManagementOfficeAmount(), managementFeeRatio);
-// po.setManagementFee(managementFee); // 鑷畾涔夊瓧娈碉細绠$悊璐�
-
- // 6. 搴斾粯閲戦A = IF(瀹¤閲戦涓虹┖, 涓氬浼氶噾棰�-绠$悊璐�, 瀹¤閲戦-绠$悊璐�)
- BigDecimal auditAmount = po.getAuditAmount() == null ? BigDecimal.ZERO : po.getAuditAmount();
- BigDecimal payableA = (auditAmount.compareTo(BigDecimal.ZERO) == 0)
- ? subtract(ownersAmount, managementFee)
- : subtract(auditAmount, managementFee);
-// po.setPayableAmountA(payableA); // 鑷畾涔夊瓧娈碉細搴斾粯閲戦A
-
- // 7. 搴斾粯閲戦B = 涓氬浼氶噾棰�-绠$悊璐�-璐ㄤ繚閲戦噾棰�
- BigDecimal qualityGuaranteeAmount = po.getQualityGuaranteeAmount() == null ? BigDecimal.ZERO : po.getQualityGuaranteeAmount();
- BigDecimal payableB = subtract(ownersAmount, managementFee, qualityGuaranteeAmount);
-// po.setPayableAmountB(payableB); // 鑷畾涔夊瓧娈碉細搴斾粯閲戦B
-
- // 8. 搴斾粯閲戦C = 瀹炴敹閲戦-瀹炴敹閲戦脳绠$悊璐规瘮渚嬶紙瀹炴敹閲戦鍙栧埌璐﹀悎璁★級
-// BigDecimal payableC = multiply(arrivalTotal, BigDecimal.ONE.subtract(managementFeeRatio));
-// po.setPayableAmountC(payableC); // 鑷畾涔夊瓧娈碉細搴斾粯閲戦C
-
- // 9. 鎷熶粯鍚堣 = 绗竴娆绗簲娆℃嫙浠橀噾棰濅箣鍜岋紙绗�82鍒�+绗�88鍒�+绗�94鍒�+绗�100鍒�+绗�106鍒楋級
- BigDecimal plannedPay1 = parseBigDecimal(getCellValue(cellArray, 113)); // 绗竴娆℃嫙浠橀噾棰濓紙绗�83鍒楋級
- BigDecimal plannedPay2 = parseBigDecimal(getCellValue(cellArray, 119)); // 绗簩娆℃嫙浠橀噾棰濓紙绗�89鍒楋級
- BigDecimal plannedPay3 = parseBigDecimal(getCellValue(cellArray, 125)); // 绗笁娆℃嫙浠橀噾棰濓紙绗�95鍒楋級
- BigDecimal plannedPay4 = parseBigDecimal(getCellValue(cellArray, 131)); // 绗洓娆℃嫙浠橀噾棰濓紙绗�101鍒楋級
- BigDecimal plannedPay5 = parseBigDecimal(getCellValue(cellArray, 137)); // 绗簲娆℃嫙浠橀噾棰濓紙绗�107鍒楋級
- BigDecimal plannedPayTotal = add(plannedPay1, plannedPay2, plannedPay3, plannedPay4, plannedPay5);
-// po.setPlannedPayTotal(plannedPayTotal); // 鑷畾涔夊瓧娈碉細鎷熶粯鍚堣
-
- // 10. 瀹炰粯鍚堣 = 绗竴娆绗簲娆″疄浠橀噾棰濅箣鍜岋紙绗�85鍒�+绗�91鍒�+绗�97鍒�+绗�103鍒�+绗�109鍒楋級
- BigDecimal actualPay1 = parseBigDecimal(getCellValue(cellArray, 117)); // 绗竴娆″疄浠橀噾棰濓紙绗�86鍒楋級
- BigDecimal actualPay2 = parseBigDecimal(getCellValue(cellArray, 123)); // 绗簩娆″疄浠橀噾棰濓紙绗�92鍒楋級
- BigDecimal actualPay3 = parseBigDecimal(getCellValue(cellArray, 130)); // 绗笁娆″疄浠橀噾棰濓紙绗�98鍒楋級
- BigDecimal actualPay4 = parseBigDecimal(getCellValue(cellArray, 135)); // 绗洓娆″疄浠橀噾棰濓紙绗�104鍒楋級
- BigDecimal actualPay5 = parseBigDecimal(getCellValue(cellArray, 141)); // 绗簲娆″疄浠橀噾棰濓紙绗�110鍒楋級
- BigDecimal actualPayTotal = add(actualPay1, actualPay2, actualPay3, actualPay4, actualPay5);
-// po.setActualPayTotal(actualPayTotal); // 鑷畾涔夊瓧娈碉細瀹炰粯鍚堣
-
- // 11. 鏈粯鍚堣 = 瀹″畾閲戦-瀹炰粯鍚堣锛堝瀹氶噾棰濆彇瀹¤閲戦锛屾棤鍒欏彇涓氬浼氶噾棰濓級
- BigDecimal approvedAmount = (auditAmount.compareTo(BigDecimal.ZERO) == 0) ? ownersAmount : auditAmount;
- BigDecimal unpaidTotal = subtract(approvedAmount, actualPayTotal);
-// po.setUnpaidTotal(unpaidTotal); // 鑷畾涔夊瓧娈碉細鏈粯鍚堣
-
- // 12. 鍨粯閲戦 = 澶嶆潅鏉′欢鍒ゆ柇锛堝熀閲戠被鍨嬨�佸埌璐﹀悎璁°�佸叕甯冩儏鍐碉級
-// BigDecimal advanceAmount = calculateAdvanceAmount(fundType, arrivalTotal, actualPayTotal, po.getPublicIncomeAnnouncement());
-// po.setAdvanceAmount(advanceAmount); // 鑷畾涔夊瓧娈碉細鍨粯閲戦
-
- // 13. 鏈粯鍚堣锛堝埌璐﹀彛寰勶級 = 鎸夊叕甯冩儏鍐靛垎鏀绠�
-// BigDecimal unpaidByArrival = calculateUnpaidByArrival(po.getPublicIncomeAnnouncement(), ownersAmount, managementFee, actualPayTotal, arrivalTotal);
-// po.setUnpaidByArrival(unpaidByArrival); // 鑷畾涔夊瓧娈碉細鏈粯鍚堣锛堝埌璐﹀彛寰勶級
-
- // 14-16. 寰呬粯閲戦A/B/C
-// po.setPendingPayA(subtract(auditAmount, managementFee)); // 寰呬粯閲戦A = 瀹′环閲戦 - 绠$悊璐�
-// po.setPendingPayB(subtract(auditAmount, qualityGuaranteeAmount, managementFee)); // 寰呬粯閲戦B = 瀹′环閲戦 - 璐ㄤ繚閲� - 绠$悊璐�
-// po.setPendingPayC(multiply(arrivalTotal, BigDecimal.ONE.subtract(managementFeeRatio))); // 寰呬粯閲戦C = 鍒拌处鍚堣*(1-绠$悊璐瑰崰姣�)
-
- // 鏀粯淇℃伅锛堢111-116鍒楋級
- po.setPayeeName(getCellValue(cellArray, 143)); // 鏀粯鍏徃鍚嶇О/涓汉鍚嶅瓧
- po.setIdCardNumber(getCellValue(cellArray, 144)); // 涓汉韬唤璇佸彿鐮�
- po.setBankName(getCellValue(cellArray, 145)); // 寮�鎴烽摱琛�
- po.setBankAccount(getCellValue(cellArray, 146)); // 寮�鎴疯处鍙�
- po.setRemarks(getCellValue(cellArray, 155)); // 澶囨敞
- po.setAcceptanceDate(parseDate(getCellValue(cellArray, 156))); // 楠屾敹鏃ユ湡
- po.setAuditDate(getCellValue(cellArray, 157)); // 瀹¤鎯呭喌锛氬勾/鏈�
-
- return po;
- }
+// private MaintenancePaymentPo buildMaintenancePaymentPo(JSONArray cellArray) throws ParseException {
+// MaintenancePaymentPo po = new MaintenancePaymentPo();
+// // 鍩虹瀛楁锛堢洿鎺ユ槧灏凟xcel鍗曞厓鏍硷級
+// long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
+// po.setId(longId+""); // 涓婚敭ID
+// po.setAuxiliaryColumn(getCellValue(cellArray, 0)); // 绗�1鍒楋細杈呭姪鍒�
+// po.setFlowNumber(getCellValue(cellArray, 1)); // 绗�2鍒楋細娴佽浆缂栧彿
+// po.setSerialNumber(parseInteger(getCellValue(cellArray, 2))); // 绗�3鍒楋細搴忓彿
+// po.setProjectCode(getCellValue(cellArray, 3)); // 绗�4鍒楋細椤圭洰缂栫爜
+// po.setProjectName(getCellValue(cellArray, 4)); // 绗�5鍒楋細椤圭洰鍚嶇О
+// po.setYear(parseInteger(getCellValue(cellArray, 5))); // 绗�6鍒楋細骞翠唤
+// po.setMonth(parseInteger(getCellValue(cellArray, 6))); // 绗�7鍒楋細鏈堜唤
+// po.setDay(parseInteger(getCellValue(cellArray, 7))); // 绗�8鍒楋細鏃�
+// po.setDate(parseDate(getCellValue(cellArray, 8))); // 绗�9鍒楋細鏃ユ湡
+// po.setProjectContent(getCellValue(cellArray, 9)); // 绗�10鍒楋細宸ョ▼鍐呭
+// po.setManagementOfficeAmount(parseBigDecimal(getCellValue(cellArray, 10))); // 绗�11鍒楋細绠$悊澶勯噾棰�
+// po.setManagementOfficeSeal(convertSealStatus(getCellValue(cellArray, 11))); // 绗�12鍒楋細绠$悊澶勬槸鍚﹀凡鐩栫珷锛堚垰杞�"鏄�"锛屽惁鍒�"鍚�"锛�
+// po.setOwnersCommitteeAmount(parseBigDecimal(getCellValue(cellArray, 12))); // 绗�13鍒楋細涓氬浼氶噾棰�
+// po.setAuditAmount(parseBigDecimal(getCellValue(cellArray, 13))); // 绗�14鍒楋細瀹′环閲戦
+// po.setOwnersCommitteeSeal(convertSealStatus(getCellValue(cellArray, 14))); // 绗�15鍒楋細涓氬浼氭槸鍚﹀凡鐩栫珷
+// po.setReportDepartment(getCellValue(cellArray, 15)); // 绗�16鍒楋細绛炬姤閮ㄩ棬
+// po.setFundTypeLevel1(getCellValue(cellArray, 16)); // 绗�17鍒楋細鍩洪噾绫诲瀷-涓�绾у垎绫�
+// po.setFundTypeLevel2(getCellValue(cellArray, 17)); // 绗�18鍒楋細鍩洪噾绫诲瀷-浜岀骇鍒嗙被
+// po.setBuildingOrAll(getCellValue(cellArray, 18)); // 绗�19鍒楋細骞�/鍏ㄤ綋
+// po.setMaintenanceType(getCellValue(cellArray, 19)); // 绗�20鍒楋細缁翠慨绫诲瀷
+// po.setQualityGuaranteePeriod1(getCellValue(cellArray, 20)); // 绗�21鍒楋細璐ㄤ繚鏈燂紙绗竴涓級
+//// po.setPublicIncomeAnnouncement(getCellValue(cellArray, 21)); // 绗�22鍒楋細鍏叡鏀剁泭閲戝叕甯冩儏鍐�
+// // 鍏叡鏀剁泭閲戝叕甯冨瓙瀛楁锛堢23-26鍒楋級
+// po.setPlannedAnnouncementStart(getCellValue(cellArray, 21)); // 鎷熷叕甯�-璧峰锛堝勾鏈堬級
+// po.setPlannedAnnouncementEnd(getCellValue(cellArray, 22)); // 鎷熷叕甯�-姝紙骞存湀锛�
+// po.setPublishedAnnouncementStart(getCellValue(cellArray, 23)); // 宸插叕甯�-璧峰锛堝勾鏈堬級
+// po.setPublishedAnnouncementEnd(getCellValue(cellArray, 24)); // 宸插叕甯�-姝紙骞存湀锛�
+// po.setQuota(parseBigDecimal(getCellValue(cellArray, 25))); // 绗�27鍒楋細棰濆害
+// po.setOwnersCommitteeResolution(convertYesNo(getCellValue(cellArray, 26))); // 绗�28鍒楋細涓氬浼氬ぇ浼氬喅璁紙鏄�/鍚︼級
+// po.setOwnersCommitteeConsultation(convertYesNo(getCellValue(cellArray, 27))); // 绗�29鍒楋細涓氬浼氬緛璇㈣〃锛堟槸鍚︼級
+// po.setWithdrawalEncounteredProblem(getCellValue(cellArray, 28)); // 绗�30鍒楋細鏀彇閬囧埌鐨勯棶棰�
+// po.setShortageOrArrears(parseBigDecimal(getCellValue(cellArray, 29))); // 绗�31鍒楋細缂烘敮/娆犳锛堝厓锛�
+// // 涓氫富鍦板潃瀛愬瓧娈碉紙绗�32-37鍒楋級
+// po.setRoadName(getCellValue(cellArray, 30)); // 璺悕
+// po.setLane(getCellValue(cellArray, 31)); // 寮�
+// po.setDoor(getCellValue(cellArray, 32)); // 闂�
+// po.setRoom(getCellValue(cellArray, 33)); // 瀹�
+// po.setDoorRoomNumber(getCellValue(cellArray, 34)); // 闂ㄥ鍙�
+// po.setOwnerAddress(getCellValue(cellArray, 35)); // 涓氫富鍦板潃
+//// po.setWithdrawalProblem(getCellValue(cellArray, 36)); // 绗�38鍒楋細鏀彇瀛樺湪闂
+// po.setProblemDifficulty(getCellValue(cellArray, 36)); // 绗�36鍒楋細闂闅惧害
+// po.setAvailableWithdrawalDate(parseDate(getCellValue(cellArray, 43))); // 绗�40鍒楋細鍙惎鍔ㄦ敮鍙栨棩鏈燂紙骞存湀鏃ワ級
+// po.setQualityGuaranteePeriod2(getCellValue(cellArray, 37) + "~" + getCellValue(cellArray, 38)); // 绗�41鍒楋細璐ㄤ繚鏈燂紙绗簩涓級
+// po.setQualityGuaranteeRatio(parseBigDecimal(getCellValue(cellArray, 39))); // 绗�42鍒楋細璐ㄤ繚閲戝崰姣�
+// po.setQualityGuaranteeAmount(parseBigDecimal(getCellValue(cellArray, 40))); // 绗�43鍒楋細璐ㄤ繚閲戦噾棰濓紙鍏冿級
+// po.setReceivedQualityGuarantee(parseBigDecimal(getCellValue(cellArray, 44))); // 绗�44鍒楋細宸插埌璐﹁川淇濋噾
+//// po.setStartDate(parseDate(getCellValue(cellArray, 44))); // 绗�45鍒楋細璧峰锛堝勾鏈堟棩锛�
+//// po.setEndDate(parseDate(getCellValue(cellArray, 45))); // 绗�46鍒楋細缁堟锛堝勾鏈堟棩锛�
+//
+//
+// // 鏀粯淇℃伅锛堢111-116鍒楋級
+// po.setPayeeName(getCellValue(cellArray, 143)); // 鏀粯鍏徃鍚嶇О/涓汉鍚嶅瓧
+// po.setIdCardNumber(getCellValue(cellArray, 144)); // 涓汉韬唤璇佸彿鐮�
+// po.setBankName(getCellValue(cellArray, 145)); // 寮�鎴烽摱琛�
+// po.setBankAccount(getCellValue(cellArray, 146)); // 寮�鎴疯处鍙�
+// po.setRemarks(getCellValue(cellArray, 155)); // 澶囨敞
+// po.setAcceptanceDate(parseDate(getCellValue(cellArray, 156))); // 楠屾敹鏃ユ湡
+// po.setAuditDate(getCellValue(cellArray, 157)); // 瀹¤鎯呭喌锛氬勾/鏈�
+//
+// return po;
+// }
/**
* 鏋勫缓 MpPaymentRecordPo 鍒楄〃锛�5娆℃墦鍗版暟鎹級
*/
private List<MpPaymentRecordPo> buildMpPaymentRecordPos(JSONArray cellArray, String flowNumber,String mainPo) throws ParseException {
List<MpPaymentRecordPo> pos = new ArrayList<>();
- // 绗竴娆℃墦鍗版暟鎹紙绗�47-53鍒楋級
- buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 1, 45, pos);
+// 绗竴娆℃墦鍗版暟鎹紙绗�47-53鍒楋級
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 1, 38, pos);
// 绗簩娆℃墦鍗版暟鎹紙绗�54-60鍒楋級
- buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 2, 57, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 2, 50, pos);
// 绗笁娆℃墦鍗版暟鎹紙绗�61-67鍒楋級
- buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 3, 69, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 3, 62, pos);
// 绗洓娆℃墦鍗版暟鎹紙绗�68-74鍒楋級
- buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 4, 81, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 4, 74, pos);
// 绗簲娆℃墦鍗版暟鎹紙绗�75-81鍒楋級
- buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 5, 93, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 5, 86, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 6, 98, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 7, 110, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 8, 122, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 9, 134, pos);
+ buildSinglePaymentRecord(mainPo, cellArray, flowNumber, 10, 146, pos);
return pos;
}
@@ -421,30 +356,33 @@
private void buildSinglePaymentRecord(String mpId, JSONArray cellArray, String flowNumber, int printTimes,
int index, List<MpPaymentRecordPo> pos) throws ParseException {
- if (getCellValue(cellArray, index).isEmpty()) {
- return;
- }
+// if (getCellValue(cellArray, index).isEmpty()) {
+// return;
+// }
MpPaymentRecordPo po = new MpPaymentRecordPo();
- long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
- po.setId(longId+"");
- po.setMpId(mpId); // mp_id = 娴佽浆缂栧彿_鎵撳嵃娆℃暟锛堢‘淇濆敮涓�锛�
- po.setFirstPrintDate(parseDate(getCellValue(cellArray, index)));
- po.setResolutionNumber(getCellValue(cellArray, index + 1));
- po.setPrintAmount(parseBigDecimal(getCellValue(cellArray, index + 2)));
- po.setArrivalDate(parseDate(getCellValue(cellArray, index + 3)));
- po.setArrivalAmount(parseBigDecimal(getCellValue(cellArray, index + 4)));
- po.setWithdrawer(getCellValue(cellArray, index + 5));
- po.setShortageOrArrears(parseBigDecimal(getCellValue(cellArray, index + 6)));
- // 涓氫富鍦板潃淇℃伅锛堝鐢╩ain琛ㄧ殑鍦板潃锛�
- po.setRoadName(getCellValue(cellArray, index + 7));
- po.setLane(getCellValue(cellArray, index + 8));
- po.setDoor(getCellValue(cellArray, index + 9));
- po.setRoom(getCellValue(cellArray, index + 10));
- po.setOwnerAddress(getCellValue(cellArray, index + 11));
- po.setPrintAmount(new BigDecimal(flowNumber));
- po.setSnakeCase(getCellValue(cellArray, 105));
+ try {
+ po.setId(GenerateCodeFactory.getGeneratorId("33"));
+ po.setMpId(mpId); // mp_id = 娴佽浆缂栧彿_鎵撳嵃娆℃暟锛堢‘淇濆敮涓�锛�
+ po.setPrintCount(printTimes);
+ po.setFirstPrintDate(getCellValue(cellArray, index));
+ po.setResolutionNumber(getCellValue(cellArray, index + 1));
+ po.setPrintAmount(getCellValue(cellArray, index + 2));
+ po.setArrivalDate(getCellValue(cellArray, index + 3));
+ po.setArrivalAmount(getCellValue(cellArray, index + 4));
+ po.setWithdrawer(getCellValue(cellArray, index + 5));
+ po.setShortageOrArrears(getCellValue(cellArray, index + 6));
+ // 涓氫富鍦板潃淇℃伅锛堝鐢╩ain琛ㄧ殑鍦板潃锛�
+ po.setRoadName(getCellValue(cellArray, index + 7));
+ po.setLane(getCellValue(cellArray, index + 8));
+ po.setDoor(getCellValue(cellArray, index + 9));
+ po.setRoom(getCellValue(cellArray, index + 10));
+ po.setOwnerAddress(getCellValue(cellArray, index + 11));
+ po.setSnakeCase(getCellValue(cellArray, 158));
+ } catch (ArrayIndexOutOfBoundsException e) {
+
+ }
pos.add(po);
}
@@ -454,263 +392,58 @@
private List<MpFifthPaymentRecord> buildMpFifthPaymentRecordPos(JSONArray cellArray, String flowNumber,String mainPo) throws ParseException {
List<MpFifthPaymentRecord> pos = new ArrayList<>();
- buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 115);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 169,1);
- buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 121);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 176,2);
- buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 127);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 183,3);
- buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 133);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 190,4);
- buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 139);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 197,5);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 204,6);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 211,7);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 218,8);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 225,9);
+ buildMpFifthPaymentRecordPo(pos, cellArray, flowNumber, mainPo, 232,10);
return pos;
}
- private void buildMpFifthPaymentRecordPo(List<MpFifthPaymentRecord> pos, JSONArray cellArray, String flowNumber, String mainPo, int index) {
+ private void buildMpFifthPaymentRecordPo(List<MpFifthPaymentRecord> pos, JSONArray cellArray, String flowNumber, String mainPo, int index, int printTimes) throws ParseException {
- if (getCellValue(cellArray, index).isEmpty()) {
- return;
- }
+// if (getCellValue(cellArray, index).isEmpty()) {
+// return;
+// }
MpFifthPaymentRecord po = new MpFifthPaymentRecord();
- long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
- po.setId(longId+"");
- po.setMpId(flowNumber);
- po.setFifthPlannedPaymentAmount(new BigDecimal(getCellValue(cellArray, index)).toString());
try {
- po.setPlannedPaymentDate(parseDate(getCellValue(cellArray, index + 1)));
- po.setActualPaymentDate(parseDate(getCellValue(cellArray, index + 5)));
- } catch (ParseException e) {
- throw new RuntimeException(e);
- }
- po.setCategory(getCellValue(cellArray, index + 2));
- po.setReimburser(getCellValue(cellArray, index + 3));
- po.setActualPaymentAmount(new BigDecimal(getCellValue(cellArray, index + 4)).toString());
- }
+ long longId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE; // 閬垮厤璐熸暟
+ po.setId(longId+"");
+ po.setMpId(mainPo);
+ po.setPaymentCount(printTimes);
+ po.setFifthPlannedPaymentAmount(getCellValue(cellArray, index));
+ po.setPlannedPaymentDate(getCellValue(cellArray, index + 1));
+ po.setCategory(getCellValue(cellArray, index + 2));
+ po.setReimburser(getCellValue(cellArray, index + 3));
+ po.setPaymentTarget(getCellValue(cellArray, index + 4));
+ po.setActualPaymentAmount(getCellValue(cellArray, index + 5));
+ po.setActualPaymentDate(getCellValue(cellArray, index + 6));
+ } catch (ArrayIndexOutOfBoundsException e) {
- /**
- * 璁$畻鍨粯閲戦锛堟枃妗g鍗佷笁鏉¢�昏緫锛�
- */
- private BigDecimal calculateAdvanceAmount(String fundType, BigDecimal arrivalTotal,
- BigDecimal actualPayTotal, String publicIncomeAnnouncement) {
- // 鏉′欢1锛氬熀閲戠被鍨嬫槸"鍏叡鏀剁泭閲�"鎴�"缁翠慨鍩洪噾"
- if ("鍏叡鏀剁泭閲�".equals(fundType) || "缁翠慨鍩洪噾".equals(fundType)) {
- if (arrivalTotal.compareTo(BigDecimal.ZERO) != 0) {
- // 鍒拌处鍚堣鈮�0锛氬疄浠�>鍒拌处鍒欏灚浠�=瀹炰粯-鍒拌处锛屽惁鍒�0
- return (actualPayTotal.compareTo(arrivalTotal) > 0)
- ? subtract(actualPayTotal, arrivalTotal)
- : BigDecimal.ZERO;
- } else {
- // 鍒拌处鍚堣=0锛氬垽鏂�"鍏叡鏀剁泭閲戝叕甯冩儏鍐�"鏄惁鍚�"鍏竷"涓斾笉鍚�"鎷�"
- boolean hasPublish = !isBlank(publicIncomeAnnouncement) && publicIncomeAnnouncement.contains("鍏竷");
- boolean hasPlanned = !isBlank(publicIncomeAnnouncement) && publicIncomeAnnouncement.contains("鎷�");
- return (hasPublish && !hasPlanned) ? BigDecimal.ZERO : actualPayTotal;
- }
}
- // 鍏朵粬鍩洪噾绫诲瀷锛氬灚浠橀噾棰�=0
- return BigDecimal.ZERO;
+ pos.add(po);
}
-
- /**
- * 璁$畻鏈粯鍚堣锛堝埌璐﹀彛寰勶級锛堟枃妗g鍗佸洓鏉¢�昏緫锛�
- */
- private BigDecimal calculateUnpaidByArrival(String publicIncomeAnnouncement, BigDecimal ownersAmount,
- BigDecimal managementFee, BigDecimal actualPayTotal, BigDecimal arrivalTotal) {
- // 鍚�"鍏竷"锛氭湭浠�=涓氬浼氶噾棰�-绠$悊璐�-瀹炰粯鍚堣
- if (!isBlank(publicIncomeAnnouncement) && publicIncomeAnnouncement.contains("鍏竷")) {
- return subtract(ownersAmount, managementFee, actualPayTotal);
- } else {
- // 涓嶅惈"鍏竷"锛氬埌璐﹀悎璁�=0鍒�0锛屽惁鍒�=鍒拌处鍚堣-绠$悊璐�-瀹炰粯鍚堣
- return (arrivalTotal.compareTo(BigDecimal.ZERO) == 0)
- ? BigDecimal.ZERO
- : subtract(arrivalTotal, managementFee, actualPayTotal);
- }
- }
-
- // -------------------------- 宸ュ叿鏂规硶 --------------------------
- /**
- * 鑾峰彇鍗曞厓鏍煎�硷紙澶勭悊null/绌哄瓧绗︿覆锛�
- */
private String getCellValue(JSONArray cellArray, int index) {
- if (index < 0 || index >= cellArray.size()) {
- return "";
- }
- Object value = cellArray.get(index);
- return value == null ? "" : value.toString().trim();
- }
-
-
- private Double getCellNum(JSONArray cellArray, int index) {
- if (index < 0 || index >= cellArray.size()) {
- return 0.0;
- }
- Object value = cellArray.get(index);
- return value == null ? 0 : Double.parseDouble((String) value);
- }
-
- /**
- * 鍒ゆ柇瀛楃涓叉槸鍚︿负绌�
- */
- private boolean isBlank(String str) {
- return str == null || str.isEmpty() || "null".equalsIgnoreCase(str) || "#REF!".equals(str);
- }
-
- /**
- * 瑙f瀽Integer锛堢┖鍊艰繑鍥瀗ull锛�
- */
- private Integer parseInteger(String str) {
- if (isBlank(str)) {
- return null;
- }
try {
- return Integer.parseInt(str);
- } catch (NumberFormatException e) {
- return null;
- }
- }
-
- /**
- * 瑙f瀽BigDecimal锛堢┖鍊艰繑鍥�0锛屽鐞嗗崈鍒嗕綅閫楀彿锛�
- */
- private BigDecimal parseBigDecimal(String str) {
- if (isBlank(str)) {
- return BigDecimal.ZERO;
- }
- try {
- // 澶勭悊Excel涓殑鍗冨垎浣嶆牸寮忥紙濡�133,900.57锛�
- String cleanStr = str.replace(",", "").trim();
- return new BigDecimal(cleanStr);
- } catch (NumberFormatException e) {
- return BigDecimal.ZERO;
- }
- }
-
- private String parseDateToString(String str) throws ParseException{
- return parseDate(str) == null ? "" : str;
- }
-
- /**
- * 瑙f瀽鏃ユ湡锛堟敮鎸佸绉嶆牸寮忥紝绌哄�艰繑鍥瀗ull锛�
- */
- // 鎵╁睍鏀寔鐨勬棩鏈熸牸寮忥細瑕嗙洊妯嚎/鏂滄潬鍒嗛殧銆佸勾鏈堟棩/鏈堟棩骞寸瓑甯歌鏍煎紡
- private static final List<SimpleDateFormat> DATE_FORMATS = new ArrayList<SimpleDateFormat>() {{
- add(new SimpleDateFormat("yyyy-MM-dd")); // 2025-12-12
- add(new SimpleDateFormat("yyyy/MM/dd")); // 2025/12/12
- add(new SimpleDateFormat("yyyyMMdd")); // 20251212
- add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); // 甯︽椂鍒嗙鐨勬牸寮忥紙鍏煎锛�
- add(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"));
- add(new SimpleDateFormat("MM/dd/yyyy")); // 鍏煎鍥藉鏍煎紡锛堝彲閫夛級
- }};
-
- /**
- * 瑙f瀽鏃ユ湡锛氭敮鎸丒xcel鏃ユ湡搴忓垪鍙枫��2025-12-12銆�2025/12/12绛夋牸寮�
- * @param str 寰呰В鏋愮殑鏃ユ湡瀛楃涓诧紙鎴朎xcel搴忓垪鍙凤級
- * @return 瑙f瀽鍚庣殑Date瀵硅薄锛岀┖瀛楃涓茶繑鍥瀗ull
- * @throws ParseException 涓嶆敮鎸佺殑鏍煎紡鎶涘嚭寮傚父
- */
- private Date parseDate(String str) throws ParseException {
- // 绌哄�煎鐞�
- if (StringUtils.isBlank(str)) {
- return null;
- }
- String trimStr = str.trim();
-
- // 绗竴姝ワ細灏濊瘯瑙f瀽Excel鏃ユ湡搴忓垪鍙凤紙鏁板瓧鏍煎紡锛�
- try {
- double excelDateNum = Double.parseDouble(trimStr);
- return convertExcelSerialToDate(excelDateNum);
- } catch (NumberFormatException e) {
- // 涓嶆槸鏁板瓧锛岀户缁В鏋愭枃鏈棩鏈熸牸寮�
- }
-
- // 绗簩姝ワ細灏濊瘯瑙f瀽鏂囨湰鏍煎紡鏃ユ湡锛堣鐩�-鍜�/鍒嗛殧绗︼級
- for (SimpleDateFormat format : DATE_FORMATS) {
- try {
- format.setLenient(false); // 涓ユ牸鏍¢獙锛岄伩鍏�2025-13-32杩欑被鏃犳晥鏃ユ湡
- return format.parse(trimStr);
- } catch (ParseException e) {
- // 璇ユ牸寮忚В鏋愬け璐ワ紝灏濊瘯涓嬩竴涓�
- continue;
+ if (index < 0 || index >= cellArray.size()) {
+ return "";
}
- }
-
- // 鎵�鏈夋牸寮忛兘涓嶅尮閰嶏紝鎶涘紓甯�
- throw new ParseException("涓嶆敮鎸佺殑鏃ユ湡鏍煎紡锛�" + str, 0);
- }
-
- /**
- * 杞崲Excel鏃ユ湡搴忓垪鍙蜂负Date锛堜慨姝�1900闂板勾bug锛�
- * Excel搴忓垪鍙疯鍒欙細1=1900-01-01锛堥敊璇涓�1900鏄棸骞达紝澶氱畻1澶╋級
- * @param excelSerial Excel鏃ユ湡搴忓垪鍙凤紙濡�45735锛�
- * @return 瀵瑰簲鐨凞ate瀵硅薄
- */
- private Date convertExcelSerialToDate(double excelSerial) {
- // 鍒濆鍖朇alendar锛氭椂鍖鸿涓篏MT锛岄伩鍏嶆湰鍦版椂鍖哄亸绉�
- Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
- // Excel 1900鏃ユ湡绯荤粺鍩哄噯锛氬簭鍒楀彿1瀵瑰簲1900-01-01
- cal.set(1900, Calendar.JANUARY, 1, 0, 0, 0);
- cal.set(Calendar.MILLISECOND, 0);
-
- // 淇Excel鐨�1900闂板勾bug锛欵xcel璁や负1900鏄棸骞达紝瀹為檯涓嶆槸锛岄渶鍑�2澶�
- // 娉細濡傛灉搴忓垪鍙�<60锛堝搴�1900-02-28锛夛紝鍑�1澶╁嵆鍙紱閫氱敤鍦烘櫙鍑�2澶╁吋瀹规墍鏈夋儏鍐�
- int daysToAdd = (int) excelSerial - 2;
- cal.add(Calendar.DAY_OF_YEAR, daysToAdd);
-
- return cal.getTime();
- }
-
- /**
- * 杞崲鐩栫珷鐘舵�侊紙鈭氣啋鏄紝鍏朵粬鈫掑惁锛�
- */
- private String convertSealStatus(String str) {
- return "鈭�".equals(str) || "鏄�".equals(str) ? "鏄�" : "鍚�";
- }
-
- /**
- * 杞崲鏄�/鍚︼紙绌哄�艰繑鍥瀗ull锛�
- */
- private String convertYesNo(String str) {
- if (isBlank(str)) {
+ Object value = cellArray.get(index);
+ return value == null ? "" : value.toString().trim();
+ } catch (ArrayIndexOutOfBoundsException e) {
return null;
}
- return "鏄�".equals(str) || "鈭�".equals(str) ? "鏄�" : "鍚�";
- }
-
- /**
- * 澶氫釜BigDecimal鐩稿姞锛堝鐞唍ull锛宯ull瑙嗕负0锛�
- */
- private BigDecimal add(BigDecimal... decimals) {
- BigDecimal result = BigDecimal.ZERO;
- for (BigDecimal decimal : decimals) {
- result = result.add(decimal == null ? BigDecimal.ZERO : decimal);
- }
- return result;
- }
-
- /**
- * 澶氫釜BigDecimal鐩稿噺锛堝鐞唍ull锛宯ull瑙嗕负0锛�
- */
- private BigDecimal subtract(BigDecimal... decimals) {
- if (decimals == null || decimals.length == 0) {
- return BigDecimal.ZERO;
- }
- BigDecimal result = decimals[0] == null ? BigDecimal.ZERO : decimals[0];
- for (int i = 1; i < decimals.length; i++) {
- result = result.subtract(decimals[i] == null ? BigDecimal.ZERO : decimals[i]);
- }
- // 閬垮厤鍑虹幇璐熸暟锛堜笟鍔′腑閲戦涓嶈兘涓鸿礋鏃跺惎鐢級
- return result.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : result;
- }
-
- /**
- * 涓や釜BigDecimal鐩镐箻锛堝鐞唍ull锛宯ull瑙嗕负0锛�
- */
- private BigDecimal multiply(BigDecimal a, BigDecimal b) {
- if (a == null || b == null) {
- return BigDecimal.ZERO;
- }
- return a.multiply(b).setScale(2, BigDecimal.ROUND_HALF_UP); // 淇濈暀2浣嶅皬鏁�
}
}
\ No newline at end of file
--
Gitblit v1.8.0