From 66caff6a371df5088d7b34d7b864bd0c65793818 Mon Sep 17 00:00:00 2001 From: XiangLingFeng <1518871916@qq.com> Date: Thu, 11 Dec 2025 10:27:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=201=E3=80=81?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E7=99=BB=E8=AE=B0=E5=8F=8D=E5=86=99=E8=B5=B7?= =?UTF-8?q?=E6=81=AF=E6=97=A5=E3=80=81=E7=BB=93=E6=81=AF=E6=97=A5=202?= =?UTF-8?q?=E3=80=81=E8=AE=A1=E6=81=AF=E5=8D=95=E5=88=A0=E9=99=A4=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=8F=8A=E5=88=A0=E9=99=A4=E4=B8=8A=E6=B8=B8=E4=B8=A4?= =?UTF-8?q?=E8=A1=A8=E5=85=B3=E8=81=94=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/CdmInterestAccrualPlugin.java | 6 +++--- .../operate/InterestAccrualDeletePlugin.java | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/CdmInterestAccrualPlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/CdmInterestAccrualPlugin.java index 6abaa79..19a401e 100644 --- a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/CdmInterestAccrualPlugin.java +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/CdmInterestAccrualPlugin.java @@ -78,7 +78,7 @@ public class CdmInterestAccrualPlugin extends AbstractOperationServicePlugIn imp String FeeBillSelectField = "id,billno,org,feetype,currency,amountrate,payamt,kdsz_pushjx"; DynamicObject[] feeBills = BusinessDataServiceHelper.load(FeeBill_KEY, FeeBillSelectField, new QFilter[]{filter}); if (feeBills == null || feeBills.length == 0){ - logger.info("应付票据:" + billNo + "没有费用明细无需下推!"); + logger.info("应付票据:" + billNo + "没有费用明细需要下推!"); continue; } OperationResult result = genJXBill(dataMap,feeBills); @@ -97,8 +97,8 @@ public class CdmInterestAccrualPlugin extends AbstractOperationServicePlugIn imp payEntry.set("kdsz_interestbill",successPkId); payEntry.set("kdsz_interestbillno",jxBill.getString("billno")); payEntry.set("kdsz_interestbillid",successPkId); -// payEntry.set("",); -// payEntry.set("",); + payEntry.set("kdsz_valuedate",jxBill.getDate("kdsz_valuedate")); + payEntry.set("kdsz_settledate",jxBill.getDate("kdsz_maturitydate")); // payEntry.set("",); } SaveServiceHelper.save(new DynamicObject[]{bill}); diff --git a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/InterestAccrualDeletePlugin.java b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/InterestAccrualDeletePlugin.java index 9f1c549..7a9cd2b 100644 --- a/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/InterestAccrualDeletePlugin.java +++ b/code/tmc/kdsz-zyf25-tmc-cfm/src/main/java/kdsz/zyf25/tmc/cfm/plugin/operate/InterestAccrualDeletePlugin.java @@ -15,6 +15,7 @@ import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; import java.util.HashSet; +import java.util.Iterator; /** * 计息单删除校验以及反写上游开票登记、费用明细下推状态 @@ -56,6 +57,7 @@ public class InterestAccrualDeletePlugin extends AbstractOperationServicePlugIn for (DynamicObject bill : bills) { String srcEntity = bill.getString("kdsz_srcentity"); Object srcBillId = bill.get("kdsz_srcbillid"); + //根据源单id,源单类型找到源单并将下推状态改为未下推 DynamicObject feeBill = BusinessDataServiceHelper.loadSingle(srcBillId, srcEntity); if (feeBill != null) { feeBill.set("kdsz_pushjx","A"); @@ -66,18 +68,22 @@ public class InterestAccrualDeletePlugin extends AbstractOperationServicePlugIn long pjId = feeEntry.getLong("srcbillid"); srcBillIds.add(pjId); } + //根据费用明细分录的上游id查询上游单据的付息记录并将本条计息单的记录删除 QFilter filter = new QFilter("id", "in", srcBillIds); // TODO: 2025/12/10 暂时定为开票登记 + Long id = bill.getLong("id"); DynamicObject[] srcBills = BusinessDataServiceHelper.load("cdm_payablebill", "id,kdsz_payentry.kdsz_interestbillid", new QFilter[]{filter}); for (DynamicObject srcBill : srcBills) { DynamicObjectCollection srcPayEntries = srcBill.getDynamicObjectCollection("kdsz_payentry"); - for (int i = srcPayEntries.size() - 1; i > 0 ; i--) { - DynamicObject srcPayEntry = srcPayEntries.get(i); - long srcJXBillId = srcPayEntry.getLong("kdsz_interestbillid"); - long id = bill.getLong("id"); - if (srcJXBillId == id){ - srcPayEntries.remove( i); + if (srcPayEntries != null){ + Iterator iterator = srcPayEntries.iterator(); + while (iterator.hasNext()){ + DynamicObject next = iterator.next(); + Long srcJXBillId = next.getLong("kdsz_interestbillid"); + if (srcJXBillId.compareTo( id) == 0){ + iterator.remove(); + } } } }