From 02589371e61ca1632758a5bc03c892df85eaa98a Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Mon, 12 May 2025 17:25:19 +0800 Subject: [PATCH] =?UTF-8?q?--=E6=94=B6=E6=AC=BE=E4=B8=9A=E5=8A=A1=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E5=90=8E=E7=94=9F=E6=88=90=E7=9A=84=E7=BA=A2=E3=80=81?= =?UTF-8?q?=E8=93=9D=E5=AD=97=E6=94=B6=E6=AC=BE=E5=8D=95=E6=90=BA=E5=B8=A6?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=89=8D=E6=94=B6=E6=AC=BE=E5=8D=95=E7=9A=84?= =?UTF-8?q?sap=E5=87=AD=E8=AF=81=E5=8F=B7=EF=BC=8C=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8E=A8=E9=80=81sap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit s --- .../plugin/operate/RecBillSaveOperation.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java b/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java index 2200ea6..b6a08e2 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/operate/RecBillSaveOperation.java @@ -13,6 +13,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; +import java.math.BigDecimal; import java.util.*; /** @@ -47,6 +48,23 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme //携带生单规则分录的业务大类,业务小类,成本中心,利润中心到收款处理单头,原因码到分录 carryCustomer(bill); SaveServiceHelper.save(new DynamicObject[]{bill}); + + //若源单为收款处理,清空单据头.SAP凭证号;单据头.是否已推送SAP;单据头.SAP会计年度 cas_recbill + String sourcebilltype = bill.getString("sourcebilltype"); + if ("cas_recbill".equals(sourcebilltype) || "收款单".equals(sourcebilltype)) { + BigDecimal sourcebillid = bill.getBigDecimal("sourcebillid"); + QFilter q1 = new QFilter("id", QCP.equals, sourcebillid); + DynamicObject[] load = BusinessDataServiceHelper.load("cas_recbill", + "id,billno,shjh_vouchernum,shjh_sapfiscalyear,shjh_ispushsap,shjh_issourceblue", q1.toArray()); + for (DynamicObject dynamicObject : load) { + boolean shjhIssourceblue = dynamicObject.getBoolean("shjh_issourceblue"); + if (!shjhIssourceblue) { + dynamicObject.set("shjh_ispushsap", false); + dynamicObject.set("shjh_issourceblue", true); + SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + } + } + } } }