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();