From a3399800c34444c2554d2fca9d50ea3be8c52004 Mon Sep 17 00:00:00 2001 From: zhangzhiguo Date: Sat, 11 Jan 2025 14:11:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fs/plugin/form/CostcompanyDefaultPlugin.java | 14 ++++++++++++-- .../fs/plugin/form/DailyreimbursExpAccPlugin.java | 3 +++ .../plugin/form/TriprCostcompanyDefaultPlugin.java | 14 ++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/CostcompanyDefaultPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/CostcompanyDefaultPlugin.java index 9455ef9..fa0202b 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/CostcompanyDefaultPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/CostcompanyDefaultPlugin.java @@ -4,6 +4,7 @@ import kd.bos.bill.AbstractBillPlugIn; import kd.bos.context.RequestContext; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.orm.query.QCP; @@ -11,6 +12,7 @@ import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.user.UserServiceHelper; import kd.sdk.plugin.Plugin; +import sinoma.cus.common.autoinfo.CommonUtils; import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils; import java.util.EventObject; @@ -21,12 +23,20 @@ import java.util.EventObject; public class CostcompanyDefaultPlugin extends AbstractBillPlugIn implements Plugin { - @Override + /*@Override public void afterCreateNewData(EventObject e) { super.afterCreateNewData(e); setCostValue(); - } + }*/ + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + IDataModel model = this.getModel(); + if (CommonUtils.isNewData(model)) { + this.setCostValue(); + } + } @Override public void propertyChanged(PropertyChangedArgs e) { diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java index a919bf9..1a6f4eb 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java @@ -94,6 +94,9 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu if(id!=null){ QFilter nameQFilter = new QFilter(prefix+"_account_item",QCP.equals,id); QFilter billTypeQFilter = new QFilter(prefix+"_entryentity.zcgj_rim_expense_type.number",QCP.equals,BILL_TYPE); + DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany"); + String number = costcompany.getString("number"); + QFilter createorg = new QFilter("createorg",QCP.equals,number); DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle(MAP_TABLE, "createorg,zcgj_entryentity,zcgj_entryentity.zcgj_entity_items", new QFilter[]{nameQFilter,billTypeQFilter}); DynamicObject dynamicObject2 = this.getModel().getDataEntity(true).getDynamicObjectCollection(EXPENSE_ENTRY_ENTITY).get(selectRow); boolean isEx = false; diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TriprCostcompanyDefaultPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TriprCostcompanyDefaultPlugin.java index 2bc1961..868344f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TriprCostcompanyDefaultPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TriprCostcompanyDefaultPlugin.java @@ -4,6 +4,7 @@ import kd.bos.bill.AbstractBillPlugIn; import kd.bos.context.RequestContext; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.orm.query.QCP; @@ -11,6 +12,7 @@ import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.user.UserServiceHelper; import kd.sdk.plugin.Plugin; +import sinoma.cus.common.autoinfo.CommonUtils; import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils; import java.util.EventObject; @@ -21,11 +23,19 @@ import java.util.EventObject; public class TriprCostcompanyDefaultPlugin extends AbstractBillPlugIn implements Plugin { - @Override + /* @Override public void afterCreateNewData(EventObject e) { super.afterCreateNewData(e); setCostValue(); - } + }*/ + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + IDataModel model = this.getModel(); + if (CommonUtils.isNewData(model)) { + this.setCostValue(); + } + } @Override public void propertyChanged(PropertyChangedArgs e) { From 1feb4408372a5f269f64ed582681c109329bdcc4 Mon Sep 17 00:00:00 2001 From: zhangzhiguo Date: Mon, 13 Jan 2025 09:49:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java | 4 ++++ .../fs/plugin/operate/TripreimbursebillIsHomeCheckOp.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java index 6ea2c3f..221f0d6 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursHomeCheckOp.java @@ -83,6 +83,10 @@ public class DailyreimbursHomeCheckOp extends AbstractOperationServicePlugIn { "id,zcgj_month_times as monthTime", visitSetFilterArray, null ); + if(homeDataSet == null || homeDataSet.isEmpty()){ + String message = String.format("提交人没有往来居家配置。"); + this.addFatalErrorMessage(extendedDataEntity, message); + } int monthTime = 0; for (Row row : homeDataSet) { monthTime = row.getInteger("monthTime"); diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillIsHomeCheckOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillIsHomeCheckOp.java index c9b51c9..c7b4210 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillIsHomeCheckOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillIsHomeCheckOp.java @@ -83,15 +83,20 @@ public class TripreimbursebillIsHomeCheckOp extends AbstractOperationServicePlug "id,zcgj_month_times as monthTime", visitSetFilterArray, null ); + if(homeDataSet == null || homeDataSet.isEmpty()){ + String message = String.format("提交人没有往来居家配置。"); + this.addFatalErrorMessage(extendedDataEntity, message); + } int monthTime = 0; for (Row row : homeDataSet) { monthTime = row.getInteger("monthTime"); } if(monthTime != 0){ DynamicObjectCollection tripentry = dataEntity.getDynamicObjectCollection("zcgj_homeentity");//oa流程分录 + boolean isOk=true; + Map homeentityCountMap = new HashMap<>(); int i = 1; - boolean isOk=true; for (DynamicObject dynamicObject : tripentry) { Date bxmonth = dynamicObject.getDate("zcgj_bxmonth"); String yearMonth = dateFormat.format(bxmonth);