From d592f667781dbc43e0656c7d3c7cd50b1f5fd5cf Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Thu, 26 Dec 2024 17:46:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/form/ContractSettleBillPlugin.java | 2 +- .../pr/plugin/form/EcContractFromPlugin.java | 20 +++++++++++++++++++ .../pr/plugin/form/ProjectEditExtUI.java | 17 ++++++++++++++-- .../DynamicSetPMApprovalFlowPlugin.java | 12 +++++++---- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java index 43054ef..d59979f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractSettleBillPlugin.java @@ -20,7 +20,7 @@ import java.util.EventObject; /** * 单据界面插件 - * 支出合同结算供应商变更插件 + * 合同结算公共插件插件 */ public class ContractSettleBillPlugin extends ContractSettleCommonEditPlugin{ diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java index 0632bc8..a046a15 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java @@ -107,6 +107,26 @@ public class EcContractFromPlugin extends AbstractBillPlugIn implements Plugin { dataEntity.set("zcgj_hshtdj", ofamount); // this.getModel().setValue("zcgj_hshtdj", ofamount); this.getView().updateView(); + } else if (name.equals("zcgj_bnyjhshte")) { + Object zcgjbnyjbhshte = this.getModel().getValue("zcgj_bnyjhshte"); + if (zcgjbnyjbhshte != null) { + ofamount = new BigDecimal(zcgjbnyjbhshte.toString()); + } + amount = ofamount.divide(pRate, 6, BigDecimal.ROUND_HALF_UP); + rate = ofamount.subtract(amount); + dataEntity.set("zcgj_bnyjbhshte", amount); + dataEntity.set("zcgj_bnyjse", rate); + this.getView().updateView(); + } else if (name.equals("zcgj_bnyjbhshte")) { + Object zcgjbnyjhshte = this.getModel().getValue("zcgj_bnyjbhshte"); + if (zcgjbnyjhshte != null) { + amount = new BigDecimal(zcgjbnyjhshte.toString()); + } + ofamount = amount.multiply(pRate); + rate = ofamount.subtract(amount); + dataEntity.set("zcgj_bnyjhshte", ofamount); + dataEntity.set("zcgj_bnyjse", rate); + this.getView().updateView(); } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ProjectEditExtUI.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ProjectEditExtUI.java index a7846eb..194be0e 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ProjectEditExtUI.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ProjectEditExtUI.java @@ -1,5 +1,7 @@ package zcgj.zcdev.zcdev.pr.plugin.form; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.field.FieldEdit; @@ -27,7 +29,18 @@ public class ProjectEditExtUI extends ProjectEditUI { if ("boqmode".equals(propertyName)) { data = args.getChangeSet()[0]; String unitProjectName = (String) data.getNewValue(); - setUnitProMustInput(unitProjectName); + + + +// setUnitProMustInput(unitProjectName); + } + Object projectorg = this.getModel().getValue("projectorg"); + if (projectorg !=null) { + DynamicObject projectOrg = (DynamicObject) projectorg; + DynamicObjectCollection entryEntity = this.getModel().getEntryEntity("unitproject"); + for (int i = 0; i < entryEntity.size(); i++) { + this.getModel().setValue("responsibleorg",projectOrg,i); + } } } @@ -39,7 +52,7 @@ public class ProjectEditExtUI extends ProjectEditUI { if ("unitproject".equals(value)) { pronumber.setMustInput(true); proname.setMustInput(true); -// proorg.setMustInput(true); + proorg.setMustInput(false); this.getView().setEnable(true, new String[]{"unitproject", "addunitproject", "deleteunitproject"}); this.getModel().setValue("editonunit", true); } else { diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java index 9c60e2e..85c3582 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java @@ -1,6 +1,8 @@ package zcgj.zcdev.zcdev.pr.plugin.workflow; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.logging.Log; +import kd.bos.logging.LogFactory; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.workflow.api.AgentExecution; import kd.bos.workflow.engine.extitf.IWorkflowPlugin; @@ -12,12 +14,13 @@ import java.util.List; * 支出合同动态设置某个节点审批人 */ public class DynamicSetPMApprovalFlowPlugin implements IWorkflowPlugin { - + private static final Log log = LogFactory.getLog(DynamicSetPMApprovalFlowPlugin.class); //根据【经理】制定当前节点的审批人 @Override public List calcUserIds(AgentExecution execution) { - List ApproversIdList = new ArrayList<>(); +// List ApproversIdList = new ArrayList<>(); + List currentApprover = execution.getCurrentApprover(); // 获取单据id String pkId = execution.getBusinessKey(); String entityNumber = execution.getEntityNumber(); @@ -27,8 +30,9 @@ public class DynamicSetPMApprovalFlowPlugin implements IWorkflowPlugin { DynamicObject projectInfo = BusinessDataServiceHelper.loadSingle(project.getLong("id"), "ec_project"); DynamicObject zcgjManger = projectInfo.getDynamicObject("zcgj_pm"); long userId = zcgjManger.getLong("id"); - ApproversIdList.add(userId); + log.info("经理审批人id为"+userId+zcgjManger.getString("name")); + currentApprover.add(userId); // 返回审批人的id集合 - return ApproversIdList; + return currentApprover; } }