From 9fd115b6ac32006f3b87fbbc0aa227764c8782a3 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Tue, 7 Jan 2025 19:58:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8D=B0=E7=AB=A0=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96(=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=94=B2=E6=96=B9=E7=B1=BB=E5=9E=8B=E6=9D=A1=E4=BB=B6)=202.?= =?UTF-8?q?=E5=BE=85=E5=8A=9E=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96(?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=96=B9=E6=B3=95=E5=8F=98=E6=9B=B4=E4=B8=BA?= =?UTF-8?q?=E5=B7=B2=E5=8A=9E)=203.=E5=AE=9A=E6=A0=87=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=90=88=E5=90=8C=E6=90=BA=E5=B8=A6=E9=87=87=E8=B4=AD=E6=96=B9?= =?UTF-8?q?=E5=BC=8F,=E7=A8=8E=E7=8E=87null,=E7=94=B2=E6=96=B9,=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E4=BD=93=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../repc/iwork/IWorkParticipantPlugin.java | 24 ++-- .../repc/iwork/IWorkParticipantsPlugin.java | 6 +- .../formplugin/ContractProjectFormPlugin.java | 111 ++++++++++++++++++ .../todotask/todoZyTaskServiceHandler.java | 24 ++-- 4 files changed, 139 insertions(+), 26 deletions(-) diff --git a/main/java/shkd/repc/iwork/IWorkParticipantPlugin.java b/main/java/shkd/repc/iwork/IWorkParticipantPlugin.java index 220e085..3cceba7 100644 --- a/main/java/shkd/repc/iwork/IWorkParticipantPlugin.java +++ b/main/java/shkd/repc/iwork/IWorkParticipantPlugin.java @@ -131,33 +131,35 @@ public class IWorkParticipantPlugin implements IWorkflowPlugin { } private void handleContractBill(DynamicObject entity, List currentApprover) { - String partyatype = entity.getString("partyatype"); // 甲方类别 - if ("qeug_recon_developer".equals(partyatype)) { +// String partyatype = entity.getString("partyatype"); // 甲方类别 +// if ("qeug_recon_developer".equals(partyatype)) { DynamicObject dynamicObject = entity.getDynamicObject("multitypepartya"); // 甲方 addApprover(currentApprover, dynamicObject, "qeug_userfield2", "印章管理员"); - } +// } } private void handlePayReqBill(DynamicObject entity, List currentApprover) { DynamicObject contractbill = entity.getDynamicObject("contractbill"); // 付款申请_获取选择的合同 if (contractbill != null) { contractbill = BusinessDataServiceHelper.loadSingle(contractbill.getPkValue(), "recon_contractbill"); - String partyatype1 = contractbill.getString("partyatype"); // 甲方类别 - if ("qeug_recon_developer".equals(partyatype1)) { +// String partyatype1 = contractbill.getString("partyatype"); // 甲方类别 +// if ("qeug_recon_developer".equals(partyatype1)) { DynamicObject dynamicObject = contractbill.getDynamicObject("multitypepartya"); // 甲方 addApprover(currentApprover, dynamicObject, "qeug_userfield", "园区会计"); - } +// } } } public static void addApprover(List currentApprover, DynamicObject dynamicObject, String field, String role) { if (dynamicObject != null) { dynamicObject = BusinessDataServiceHelper.loadSingle(dynamicObject.getPkValue(), "qeug_recon_developer"); - DynamicObject approver = dynamicObject.getDynamicObject(field); - if (approver != null) { - Long id = approver.getLong("id"); - currentApprover.add(id); - logger.info("添加参与人(" + role + "):" + id + " " + approver.getString("name")); + if (null != dynamicObject) { + DynamicObject approver = dynamicObject.getDynamicObject(field); + if (approver != null) { + Long id = approver.getLong("id"); + currentApprover.add(id); + logger.info("添加参与人(" + role + "):" + id + " " + approver.getString("name")); + } } } } diff --git a/main/java/shkd/repc/iwork/IWorkParticipantsPlugin.java b/main/java/shkd/repc/iwork/IWorkParticipantsPlugin.java index 77f0ae1..1345f45 100644 --- a/main/java/shkd/repc/iwork/IWorkParticipantsPlugin.java +++ b/main/java/shkd/repc/iwork/IWorkParticipantsPlugin.java @@ -41,11 +41,11 @@ public class IWorkParticipantsPlugin implements IWorkflowPlugin { DynamicObject contractbill = entity.getDynamicObject("contractbill"); // 付款申请_获取选择的合同 if (contractbill != null) { contractbill = BusinessDataServiceHelper.loadSingle(contractbill.getPkValue(), "recon_contractbill"); - String partyatype1 = contractbill.getString("partyatype"); // 甲方类别 - if ("qeug_recon_developer".equals(partyatype1)) { +// String partyatype1 = contractbill.getString("partyatype"); // 甲方类别 +// if ("qeug_recon_developer".equals(partyatype1)) { DynamicObject dynamicObject = contractbill.getDynamicObject("multitypepartya"); // 甲方 addApprover(currentApprover, dynamicObject, "qeug_userfield1", "资金出纳"); - } +// } } } } diff --git a/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java index 9c754f9..9802c2d 100644 --- a/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ContractProjectFormPlugin.java @@ -1,21 +1,132 @@ package shkd.repc.recon.formplugin; +import com.alibaba.nacos.shaded.com.google.common.collect.Lists; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.metadata.IDataEntityType; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.PropertyChangedArgs; +import kd.bos.form.IFormView; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import java.util.EventObject; +import java.util.List; public class ContractProjectFormPlugin extends AbstractBillPlugIn { + @Override + public void afterCreateNewData(EventObject e) { + super.afterCreateNewData(e); + + IFormView parentView = this.getView().getParentView(); + if (null != parentView) { + parentView = parentView.getParentView(); + if (null != parentView) { + IDataModel model = parentView.getModel(); + DynamicObject dataEntity = model.getDataEntity(); + IDataEntityType dataEntityType = dataEntity.getDataEntityType(); + String name = dataEntityType.getName(); + if ("rebm_decision".equals(name)) { + DynamicObject org = (DynamicObject)this.getView().getModel().getValue("org"); + DynamicObject contractbill = this.getView().getModel().getDataEntity(); + contractbill = BusinessDataServiceHelper.loadSingle(contractbill.getPkValue(), "recon_contractbill"); + + if (null != org) { + String qeugCombofield = org.getString("qeug_combofield");//业务体系 + contractbill.set("qeug_combofield",qeugCombofield); + contractbill.set("partyatype","qeug_recon_developer");//甲方类别:财务组织 + org = BusinessDataServiceHelper.loadSingle(org.getPkValue(),"bos_org"); + DynamicObject qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle("qeug_recon_orgrelation", + new QFilter[]{new QFilter("number", QCP.equals, org.getString("number"))}); + if (null != qeug_recon_orgrelation) { + //行政与财务组织对应关系 + qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle(qeug_recon_orgrelation.getPkValue(),"qeug_recon_orgrelation"); + //甲方 + DynamicObject qeug_recon_developer = BusinessDataServiceHelper.loadSingle("qeug_recon_developer", + new QFilter[]{new QFilter("number", QCP.equals, qeug_recon_orgrelation.getString("qeug_companynumber"))}); + if (null != qeug_recon_developer) { + contractbill.set("multitypepartya",qeug_recon_developer);//甲方 + } + } + } + DynamicObject bidproject = contractbill.getDynamicObject("bidproject");//定标名称 + if (null != bidproject) { + DynamicObject bidmode = bidproject.getDynamicObject("bidmode");//采购方式 + if (null != bidmode) { + contractbill.set("qeug_bidmode",bidmode); + } + } + contractbill.set("bd_taxrate",null);//税率 + SaveServiceHelper.save(new DynamicObject[]{contractbill}); + this.getView().invokeOperation("refresh"); + DynamicObject qeugBidmode = contractbill.getDynamicObject("qeug_bidmode"); + if (null == qeugBidmode) { + this.getView().updateView("qeug_bidmode"); + } + } + } + } + + } + @Override public void afterBindData(EventObject e) { super.afterBindData(e); //根据组织携带项目 updateRenovationProject(); + + IFormView parentView = this.getView().getParentView(); + if (null != parentView) { + parentView = parentView.getParentView(); + if (null != parentView) { + IDataModel model = parentView.getModel(); + DynamicObject dataEntity = model.getDataEntity(); + IDataEntityType dataEntityType = dataEntity.getDataEntityType(); + String name = dataEntityType.getName(); + if ("rebm_decision".equals(name)) { + DynamicObject org = (DynamicObject)this.getView().getModel().getValue("org"); + DynamicObject contractbill = this.getView().getModel().getDataEntity(); + contractbill = BusinessDataServiceHelper.loadSingle(contractbill.getPkValue(), "recon_contractbill"); + + if (null != org) { + String qeugCombofield = org.getString("qeug_combofield");//业务体系 + contractbill.set("qeug_combofield",qeugCombofield); + contractbill.set("partyatype","qeug_recon_developer");//甲方类别:财务组织 + org = BusinessDataServiceHelper.loadSingle(org.getPkValue(),"bos_org"); + DynamicObject qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle("qeug_recon_orgrelation", + new QFilter[]{new QFilter("number", QCP.equals, org.getString("number"))}); + if (null != qeug_recon_orgrelation) { + //行政与财务组织对应关系 + qeug_recon_orgrelation = BusinessDataServiceHelper.loadSingle(qeug_recon_orgrelation.getPkValue(),"qeug_recon_orgrelation"); + //甲方 + DynamicObject qeug_recon_developer = BusinessDataServiceHelper.loadSingle("qeug_recon_developer", + new QFilter[]{new QFilter("number", QCP.equals, qeug_recon_orgrelation.getString("qeug_companynumber"))}); + if (null != qeug_recon_developer) { + contractbill.set("multitypepartya",qeug_recon_developer);//甲方 + } + } + } + DynamicObject bidproject = contractbill.getDynamicObject("bidproject");//定标名称 + if (null != bidproject) { + DynamicObject bidmode = bidproject.getDynamicObject("bidmode");//采购方式 + if (null != bidmode) { + contractbill.set("qeug_bidmode",bidmode); + } + } + contractbill.set("bd_taxrate",null);//税率 + SaveServiceHelper.save(new DynamicObject[]{contractbill}); + + DynamicObject qeugBidmode = (DynamicObject)this.getView().getModel().getValue("qeug_bidmode"); + if (null == qeugBidmode) { + this.getView().invokeOperation("refresh"); + } + } + } + } + } @Override diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index c015a35..a6c5779 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -151,20 +151,20 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { //获取当前任务ID Long taskId = messageContext.getTaskId(); //获取任务步骤 - Long executionId = messageContext.getExecutionId(); - List operationLogByTaskId = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId); - String decisionType = ""; - if (operationLogByTaskId.size() > 0) { - decisionType = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getDecisionType(); - } else { - return; - } +// Long executionId = messageContext.getExecutionId(); +// List operationLogByTaskId = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId); +// String decisionType = ""; +// if (operationLogByTaskId.size() > 0) { +// decisionType = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getDecisionType(); +// } else { +// return; +// } String subState = "0"; - //驳回 - if ("reject".equals(decisionType)) { - subState = "3"; - } +// //驳回 +// if ("reject".equals(decisionType)) { +// subState = "3"; +// } //获取流程实例ID Long processInstanceId = messageContext.getProcessInstanceId();