From bc4f6588b92d207bef56edf3b5b38d8e4e2b8236 Mon Sep 17 00:00:00 2001
From: 6c <420680616@qq.com>
Date: 星期四, 12 六月 2025 16:34:11 +0800
Subject: [PATCH] 合同管理

---
 src/main/java/com/product/contract/service/ContractPaymentService.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/product/contract/service/ContractPaymentService.java b/src/main/java/com/product/contract/service/ContractPaymentService.java
index 159b3b6..9d08061 100644
--- a/src/main/java/com/product/contract/service/ContractPaymentService.java
+++ b/src/main/java/com/product/contract/service/ContractPaymentService.java
@@ -65,14 +65,15 @@
     private void writeBackPayment(FieldSetEntity fs){
         //鍥炲啓鍙戠エ鍙峰洖娆�
         DataTableEntity dt = fs.getSubDataTable(CmnConst.LX_PROJECT_CONTRACT_PAYMENT_COLLECTION);
+        String contractTermsUUID = fs.getString("contract_terms");
         for (int i = 0; i <dt.getRows() ; i++) {
             FieldSetEntity subFs = dt.getFieldSetEntity(i);
             FieldSetEntity collection_amount_fs = baseDao.getFieldSetBySQL("SELECT sum(collection_amount) collection_amount FROM `product_project_contract_payment_collection` where invoice_num=?", new String[]{subFs.getString("invoice_num")}, false);
-            baseDao.executeUpdate("UPDATE product_project_contract_invoice_info set payment_amount=? where invoice_num=?",new String[]{collection_amount_fs.getString("collection_amount"),subFs.getString("invoice_num")});
+            baseDao.executeUpdate("UPDATE product_project_contract_invoice_info set payment_amount=? where invoice_num=? AND contract_terms=?",new String[]{collection_amount_fs.getString("collection_amount"), subFs.getString("invoice_num"), contractTermsUUID});
         }
         //鍥炲啓鏉℃鍥炴
         FieldSetEntity contractTerms = baseDao.getFieldSetBySQL("SELECT sum(collection_amount) collection_amount FROM `product_project_contract_payment_collection` \n" +
-                "where contract_payment_uuid in(SELECT uuid FROM product_project_contract_payment where contract_terms=?)", new String[]{fs.getString("contract_terms")}, false);
+                "where contract_payment_uuid in(SELECT uuid FROM product_project_contract_payment where contract_terms=?)", new String[]{contractTermsUUID}, false);
         if (contractTerms!=null&&!StringUtils.isEmpty(contractTerms.getString("collection_amount"))) {
             FieldSetEntity contractInfoSub = new FieldSetEntity();
             contractInfoSub.setTableName(CmnConst.LX_PROJECT_CONTRACT_INFO_SUB);

--
Gitblit v1.9.2