From 633a003d232e37c79b7135ccda35eda1c69952c6 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期一, 25 五月 2026 17:28:01 +0800
Subject: [PATCH] feat:统计数据测试调整

---
 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java |   44 +++++++++++++++++++++++---------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
index ba953e1..9507420 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/OutBoundServiceImpl.java
@@ -269,21 +269,21 @@
 
 					//鏇存柊鍙戣揣鍓嶆敹娆剧敓鏁堟椂闂�
 					if (ObjUtil.isNull(schedule.getEffectiveDate())) {
-						schedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
+						schedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
 						//鏌ヨ鏄惁鏈夊悗缁樁娈�
-						List<ContractPaymentSchedule> afterSchedule = scheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contractId)
-								.gt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()));
-						if (ArrayUtil.isEmpty(afterSchedule.toArray())) {
-							schedule.setEffectiveEndDate(contract.getExpirationDate());
-						}
+//						List<ContractPaymentSchedule> afterSchedule = scheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contractId)
+//								.gt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()));
+//						if (ArrayUtil.isEmpty(afterSchedule.toArray())) {
+//							schedule.setEffectiveEndDate(contract.getExpirationDate());
+//						}
 						scheduleMapper.updateById(schedule);
 						//鏌ヨ鏄惁鏈変箣鍓嶉樁娈�
-						ContractPaymentSchedule beforeSchedule = scheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, schedule.getContractId())
-								.lt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()).orderByDesc(ContractPaymentSchedule::getCreateTime).last("limit 1"));
-						if (ObjUtil.isNotNull(beforeSchedule)) {
-							beforeSchedule.setEffectiveEndDate(schedule.getEffectiveDate());
-							scheduleMapper.updateById(beforeSchedule);
-						}
+//						ContractPaymentSchedule beforeSchedule = scheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, schedule.getContractId())
+//								.lt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()).orderByDesc(ContractPaymentSchedule::getCreateTime).last("limit 1"));
+//						if (ObjUtil.isNotNull(beforeSchedule)) {
+//							beforeSchedule.setEffectiveEndDate(schedule.getEffectiveDate());
+//							scheduleMapper.updateById(beforeSchedule);
+//						}
 						//鏇存柊灞ョ害
 						ContractPaymentScheduleProcess contractPaymentScheduleProcess = new ContractPaymentScheduleProcess();
 						contractPaymentScheduleProcess.setContractId(schedule.getContractId());
@@ -291,7 +291,11 @@
 						contractPaymentScheduleProcess.setScheduleId(schedule.getId());
 						contractPaymentScheduleProcess.setScheduleName(schedule.getStageName());
 						contractPaymentScheduleProcess.setProcessDate(addDTO.getOutBoundTime());
-						scheduleProcessMapper.insert(contractPaymentScheduleProcess);
+						ContractPaymentScheduleProcess lastProcess = scheduleProcessMapper.selectOne(Wrappers.<ContractPaymentScheduleProcess>lambdaQuery().eq(ContractPaymentScheduleProcess::getContractId, schedule.getContractId())
+								.eq(ContractPaymentScheduleProcess::getScheduleId, schedule.getId()).last("limit 1"));
+						if (ObjUtil.isNull(lastProcess)) {
+							scheduleProcessMapper.insert(contractPaymentScheduleProcess);
+						}
 					}
 
 					//鏌ヨ鏄惁鏈夊悗缁樁娈�
@@ -303,13 +307,11 @@
 						//鏈�鍚庨樁娈电敓鏁堟椂闂�
 						ContractPaymentSchedule endSchedule = afterSchedule.get(0);
 						if (StrUtil.equals(endSchedule.getStageName(), "璐ㄤ繚閲�")) {
-							endSchedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), endSchedule.getAgreedDays()));
-							endSchedule.setEffectiveEndDate(contract.getExpirationDate());
-							scheduleMapper.updateById(endSchedule);
+//							endSchedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), endSchedule.getAgreedDays()));
+//							scheduleMapper.updateById(endSchedule);
 							//褰撳墠闃舵鐢熸晥鏃堕棿
-							schedule.setEffectiveDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
-							schedule.setEffectiveEndDate(endSchedule.getEffectiveDate());
-							scheduleMapper.updateById(schedule);
+//							schedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getOutBoundTime(), schedule.getAgreedDays()));
+//							scheduleMapper.updateById(schedule);
 							//鏈�鍚庨樁娈靛簲鏀�
 							PaymentConfirm newConfim = new PaymentConfirm();
 							newConfim.setBusinessType(endSchedule.getStageName() + "搴旀敹");
@@ -344,8 +346,8 @@
 						contractMapper.updateById(contract);
 					}
 					if (ArrayUtil.isEmpty(afterSchedule.toArray())) {
-						schedule.setEffectiveEndDate(contract.getExpirationDate());
-						scheduleMapper.updateById(schedule);
+//						schedule.setEffectiveEndDate(contract.getExpirationDate());
+//						scheduleMapper.updateById(schedule);
 						//鏇存柊鍚堝悓涓嬩釜闃舵
 						contract.setNextScheduleName("鏃�");
 						contractMapper.updateById(contract);

--
Gitblit v1.9.1