From 5b1c84423d590c7240209fa9a68d33c0116457af Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期二, 26 五月 2026 17:27:03 +0800
Subject: [PATCH] feat:测试调整

---
 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
index 378b775..817cc74 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
@@ -176,6 +176,18 @@
 					currentConfim.setTotalAmount(lastTotal.subtract(currentConfim.getReceivableAmount()));
 					if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
 						paymentConfirmMapper.insert(currentConfim);
+						//鏇存柊褰撳墠闃舵浠樻鎯呭喌
+						if (lastTotal.compareTo(new BigDecimal("0"))>0){
+							if (currentConfim.getTotalAmount().compareTo(new BigDecimal("0"))>=0) {
+								schedule.setPaymentStatus(2);
+								schedule.setPlannedAmount(schedule.getPlannedAmount());
+								contractPaymentScheduleMapper.updateById(schedule);
+							}else {
+								schedule.setPaymentStatus(1);
+								schedule.setPlannedAmount(lastTotal);
+							}
+						}
+
 					}
 
 					//鏌ヨ鏄惁鏈夊悗缁樁娈�
@@ -213,6 +225,7 @@
 							newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
 							if (endSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
 								paymentConfirmMapper.insert(newConfim);
+
 							}
 
 						}
@@ -265,6 +278,17 @@
 			currentConfim.setTotalAmount(lastTotal.subtract(currentConfim.getReceivableAmount()));
 			if (schedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
 				paymentConfirmMapper.insert(currentConfim);
+				//鏇存柊褰撳墠闃舵浠樻鎯呭喌
+				if (lastTotal.compareTo(new BigDecimal("0"))>0){
+					if (currentConfim.getTotalAmount().compareTo(new BigDecimal("0"))>=0) {
+						schedule.setPaymentStatus(2);
+						schedule.setPlannedAmount(schedule.getPlannedAmount());
+						contractPaymentScheduleMapper.updateById(schedule);
+					}else {
+						schedule.setPaymentStatus(1);
+						schedule.setPlannedAmount(lastTotal);
+					}
+				}
 			}
 
 			//鏌ヨ鏄惁鏈夊悗缁樁娈�
@@ -302,6 +326,17 @@
 					newConfim.setTotalAmount(lastNewTotal.subtract(newConfim.getReceivableAmount()));
 					if (endSchedule.getPaymentRatio().compareTo(new BigDecimal("0")) > 0) {
 						paymentConfirmMapper.insert(newConfim);
+						//鏇存柊褰撳墠闃舵浠樻鎯呭喌
+						if (lastNewTotal.compareTo(new BigDecimal("0"))>0){
+							if (newConfim.getTotalAmount().compareTo(new BigDecimal("0"))>=0) {
+								schedule.setPaymentStatus(2);
+								schedule.setPlannedAmount(schedule.getPlannedAmount());
+								contractPaymentScheduleMapper.updateById(schedule);
+							}else {
+								schedule.setPaymentStatus(1);
+								schedule.setPlannedAmount(lastNewTotal);
+							}
+						}
 					}
 
 				}

--
Gitblit v1.9.1