From c9398aa9923e162bd7cdb0d354ea001cea1b9592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=B4=B5=E5=BC=BA?= Date: Fri, 11 Jul 2025 14:22:42 +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=89=8D=E6=95=B0=E6=8D=AE=E5=B8=A6=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/RecBillChangeFormPlugin.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeFormPlugin.java diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeFormPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeFormPlugin.java new file mode 100644 index 0000000..b8bd95a --- /dev/null +++ b/main/java/shjh/jhzj7/fi/fi/plugin/form/RecBillChangeFormPlugin.java @@ -0,0 +1,71 @@ +package shjh.jhzj7.fi.fi.plugin.form; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.db.DB; +import kd.bos.db.DBRoute; +import kd.bos.form.plugin.AbstractFormPlugin; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.sdk.plugin.Plugin; + +import java.util.EventObject; + +/** + * 动态表单插件 + */ +public class RecBillChangeFormPlugin extends AbstractFormPlugin implements Plugin { + + private static final String UPDATE_TOP = "update t_cas_recbillchang_e set fk_shjh_oldbizebig = ?,fk_shjh_oldbizsmall = ?,fk_shjh_oldcostcenter = ?,fk_shjh_oldprofitcenter = ?,fk_shjh_oldproductgroups = ?,fk_shjh_oldcountry = ?,fk_shjh_oldcity = ?,fk_shjh_oldbankcharges = ?,fk_shjh_bthirdpartyfees =? where fid=?;"; + + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + if ("A".equals((String)this.getModel().getValue("billstatus"))){ + boolean dataChanged = this.getModel().getDataChanged(); + if (!dataChanged){ + Long bizBigId=0L; + Long bizSmallId=0L; + Long costCenterId=0L; + Long profitCenterId=0L; + Long productGroupsId=0L; + Object pkValue = this.getModel().getDataEntity().getPkValue(); + DynamicObject bizBig = (DynamicObject) this.getModel().getValue("shjh_bizebig"); + if (bizBig!=null){ + bizBigId=bizBig.getLong("id"); + } + DynamicObject bizSmall = (DynamicObject) this.getModel().getValue("shjh_bizsmall"); + if (bizSmall!=null){ + bizSmallId=bizSmall.getLong("id"); + } + DynamicObject costCenter = (DynamicObject) this.getModel().getValue("shjh_costcenter"); + if (costCenter!=null){ + costCenterId=costCenter.getLong("id"); + } + DynamicObject profitCenter = (DynamicObject) this.getModel().getValue("shjh_profitcenter"); + if (profitCenter!=null){ + profitCenterId=profitCenter.getLong("id"); + } + DynamicObject productGroups = (DynamicObject) this.getModel().getValue("shjh_productgroups"); + if (productGroups!=null){ + productGroupsId=productGroups.getLong("id"); + } + DB.update(DBRoute.of("fi"),UPDATE_TOP,new Object[]{ + bizBigId, + bizSmallId, + costCenterId, + profitCenterId, + productGroupsId, + this.getModel().getValue("shjh_country"), + this.getModel().getValue("shjh_city"), + this.getModel().getValue("shjh_bankcharges"), + this.getModel().getValue("shjh_thirdpartyfees"), + pkValue + }); + } + } + } + + +} \ No newline at end of file