From 367ae891b5c7282a1eead8fb272fc7294d5b680a Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Tue, 19 Nov 2024 10:36:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E6=B6=88=E6=81=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96,=E8=B5=84=E8=B4=A8=E9=A2=84=E5=AE=A1=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=BC=98=E5=8C=96,=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E6=90=BA=E5=B8=A6=E5=AD=97=E6=AE=B5=E5=8F=98=E6=9B=B4(?= =?UTF-8?q?=E5=86=85=E9=83=A8=E6=8E=A8=E8=8D=90=E4=BA=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formplugin/WorkloadcfmbillFormPlugin.java | 49 +++++----- .../listplugin/ContractSummaryListPlugin.java | 1 - .../formplugin/PortraitBasicsFormPlugin.java | 3 + .../formplugin/TycQzSupplierFormPlugin.java | 49 ++++++---- .../opplugin/RegisteredFinishregOPPlugin.java | 3 +- .../todotask/todoZyTaskServiceHandler.java | 95 +++++++++++-------- 6 files changed, 109 insertions(+), 91 deletions(-) diff --git a/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java b/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java index 484ecc8..26ec2db 100644 --- a/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/WorkloadcfmbillFormPlugin.java @@ -185,32 +185,29 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab "qeug_unit,qeug_decimalqty,qeug_unitprice,qeug_amounttotal,qeug_artificial,qeug_provisional," + "qeug_remarks,qeug_contractid,qeug_sheetname,qeug_cumulativepreofpro,qeug_mechanicalunitprice," + "qeug_unitpriceofmainmater", new QFilter[]{q3,q4,q5}); - if (recon_contractbills.length > 0) { - for (int i = 0; i < recon_contractbills.length; i++) { - DynamicObject contractsummarylist = recon_contractbills[i]; - DynamicObject add = BusinessDataServiceHelper.newDynamicObject("qeug_contractsummarylist"); - add.set("qeug_seqs", contractsummarylist.getString("qeug_seqs")); - add.set("qeug_projectnumber", contractsummarylist.getString("qeug_projectnumber").trim()); - add.set("qeug_projectname", contractsummarylist.getString("qeug_projectname").trim()); - add.set("qeug_featuredescript", contractsummarylist.getString("qeug_featuredescript")); - add.set("qeug_engincontent", contractsummarylist.getString("qeug_engincontent")); - add.set("qeug_unit", contractsummarylist.getString("qeug_unit")); - add.set("qeug_decimalqty", contractsummarylist.getBigDecimal("qeug_decimalqty")); - add.set("qeug_unitprice", contractsummarylist.getBigDecimal("qeug_unitprice")); - add.set("qeug_amounttotal", contractsummarylist.getBigDecimal("qeug_amounttotal")); - add.set("qeug_artificial", contractsummarylist.getBigDecimal("qeug_artificial")); - add.set("qeug_provisional", contractsummarylist.getBigDecimal("qeug_provisional")); - add.set("qeug_unitpriceofmainmater", contractsummarylist.getBigDecimal("qeug_unitpriceofmainmater")); - add.set("qeug_mechanicalunitprice", contractsummarylist.getBigDecimal("qeug_mechanicalunitprice")); - add.set("qeug_remarks", contractsummarylist.getString("qeug_remarks")); - add.set("qeug_contractid", contractsummarylist.getString("qeug_contractid")); - add.set("qeug_sheetname", contractsummarylist.getString("qeug_sheetname")); - add.set("qeug_cumulativepreofpro", contractsummarylist.getString("qeug_cumulativepreofpro"));//累计完成百分比 - add.set("qeug_workloadcfmid",String.valueOf(this.getModel().getDataEntity().getPkValue())); - add.set("enable","1");//使用状态 - add.set("status","A");//数据状态 - SaveServiceHelper.save(new DynamicObject[]{add}); - } + for (DynamicObject contractsummarylist : recon_contractbills) { + DynamicObject add = BusinessDataServiceHelper.newDynamicObject("qeug_contractsummarylist"); + add.set("qeug_seqs", contractsummarylist.getString("qeug_seqs")); + add.set("qeug_projectnumber", contractsummarylist.getString("qeug_projectnumber").trim()); + add.set("qeug_projectname", contractsummarylist.getString("qeug_projectname").trim()); + add.set("qeug_featuredescript", contractsummarylist.getString("qeug_featuredescript")); + add.set("qeug_engincontent", contractsummarylist.getString("qeug_engincontent")); + add.set("qeug_unit", contractsummarylist.getString("qeug_unit")); + add.set("qeug_decimalqty", contractsummarylist.getBigDecimal("qeug_decimalqty")); + add.set("qeug_unitprice", contractsummarylist.getBigDecimal("qeug_unitprice")); + add.set("qeug_amounttotal", contractsummarylist.getBigDecimal("qeug_amounttotal")); + add.set("qeug_artificial", contractsummarylist.getBigDecimal("qeug_artificial")); + add.set("qeug_provisional", contractsummarylist.getBigDecimal("qeug_provisional")); + add.set("qeug_unitpriceofmainmater", contractsummarylist.getBigDecimal("qeug_unitpriceofmainmater")); + add.set("qeug_mechanicalunitprice", contractsummarylist.getBigDecimal("qeug_mechanicalunitprice")); + add.set("qeug_remarks", contractsummarylist.getString("qeug_remarks")); + add.set("qeug_contractid", contractsummarylist.getString("qeug_contractid")); + add.set("qeug_sheetname", contractsummarylist.getString("qeug_sheetname")); + add.set("qeug_cumulativepreofpro", contractsummarylist.getString("qeug_cumulativepreofpro"));//累计完成百分比 + add.set("qeug_workloadcfmid", String.valueOf(this.getModel().getDataEntity().getPkValue())); + add.set("enable", "1");//使用状态 + add.set("status", "A");//数据状态 + SaveServiceHelper.save(new DynamicObject[]{add}); } } diff --git a/main/java/shkd/repc/recon/listplugin/ContractSummaryListPlugin.java b/main/java/shkd/repc/recon/listplugin/ContractSummaryListPlugin.java index 4a546c5..151fb26 100644 --- a/main/java/shkd/repc/recon/listplugin/ContractSummaryListPlugin.java +++ b/main/java/shkd/repc/recon/listplugin/ContractSummaryListPlugin.java @@ -38,7 +38,6 @@ public class ContractSummaryListPlugin extends AbstractListPlugin implements ILi @Override public void beforeDoOperation(BeforeDoOperationEventArgs args) { super.beforeDoOperation(args); - Map customParams = this.getView().getFormShowParameter().getCustomParams(); Object Workloadcfmbill_id = customParams.get("Workloadcfmbill_id"); diff --git a/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java b/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java index 879a4b5..7624fab 100644 --- a/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/PortraitBasicsFormPlugin.java @@ -29,6 +29,7 @@ public class PortraitBasicsFormPlugin extends AbstractFormPlugin { String qeug_orgnumberes = supplier1.getString("qeug_orgnumberes");//组织机构代码 String qeug_regstatuses = supplier1.getString("qeug_regstatuses");//经营状态 String qeug_linkman = supplier1.getString("qeug_linkman");//外部联系人 + String qeug_recommender = supplier1.getString("qeug_recommender");//内部推荐人 this.getView().getModel().setValue("qeug_controllingperson", qeug_controllingperses); @@ -36,11 +37,13 @@ public class PortraitBasicsFormPlugin extends AbstractFormPlugin { this.getView().getModel().setValue("qeug_orgnumber", qeug_orgnumberes); this.getView().getModel().setValue("qeug_regstatus", qeug_regstatuses); this.getView().getModel().setValue("qeug_linkman", qeug_linkman); + this.getView().getModel().setValue("qeug_recommender", qeug_recommender); this.getView().updateView("qeug_controllingperson"); this.getView().updateView("qeug_regnumber"); this.getView().updateView("qeug_orgnumber"); this.getView().updateView("qeug_regstatus"); this.getView().updateView("qeug_linkman"); + this.getView().updateView("qeug_recommender"); // this.getView().updateView(); } diff --git a/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java b/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java index 902941c..12a5601 100644 --- a/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java +++ b/main/java/shkd/repc/resm/formplugin/TycQzSupplierFormPlugin.java @@ -47,31 +47,38 @@ public class TycQzSupplierFormPlugin extends AbstractFormPlugin { public void beforeItemClick(BeforeItemClickEvent evt) { if (evt.getItemKey().equals("qeug_preaudit")) { - DynamicObject regSupplier = BusinessDataServiceHelper.loadSingle(this.getModel().getDataEntity().getPkValue(), "resm_regsupplier"); - String socode = regSupplier.getString("societycreditcode"); - String personType = regSupplier.getString("persontype"); - if (!PersontypeEnum.PERSONAL.getVal().equals(personType) && StringUtils.isEmpty(socode)) { - this.getView().showMessage(ResManager.loadKDString("社会统一信用代码不能为空。", "ImportRegSupplierList_2", "repc-resm-formplugin", new Object[0])); + try { + DynamicObject regSupplier = BusinessDataServiceHelper.loadSingle(this.getModel().getDataEntity().getPkValue(), "resm_regsupplier"); + String socode = regSupplier.getString("societycreditcode"); + String personType = regSupplier.getString("persontype"); + if (!PersontypeEnum.PERSONAL.getVal().equals(personType) && StringUtils.isEmpty(socode)) { + this.getView().showMessage(ResManager.loadKDString("社会统一信用代码不能为空。", "ImportRegSupplierList_2", "repc-resm-formplugin", new Object[0])); + evt.setCancel(true); + return; + } + OperationResult result = OperationServiceHelper.executeOperate("save", "resm_regsupplier", new DynamicObject[]{regSupplier}, OperateOption.create()); + if (!result.isSuccess()) { + evt.setCancel(true); + StringJoiner joiner = new StringJoiner("\n"); + result.getAllErrorOrValidateInfo().forEach((info) -> { + joiner.add(info.getMessage()); + }); + this.getView().showMessage(joiner.toString()); + return; + } + + boolean isSuccess = SupplierAptUtils.checkAptitudeFile(this.getView(), regSupplier); + if (!isSuccess) { + evt.setCancel(true); + return; + } + }catch (Exception e){ + this.getView().showMessage(ResManager.loadKDString("请先保存", "ImportRegSupplierList_2", "repc-resm-formplugin", new Object[0])); evt.setCancel(true); - return; } - OperationResult result = OperationServiceHelper.executeOperate("save", "resm_regsupplier", new DynamicObject[]{regSupplier}, OperateOption.create()); - if (!result.isSuccess()) { - evt.setCancel(true); - StringJoiner joiner = new StringJoiner("\n"); - result.getAllErrorOrValidateInfo().forEach((info) -> { - joiner.add(info.getMessage()); - }); - this.getView().showMessage(joiner.toString()); - return; - } - boolean isSuccess = SupplierAptUtils.checkAptitudeFile(this.getView(), regSupplier); - if (!isSuccess) { - evt.setCancel(true); - return; - } + } } diff --git a/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java b/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java index ef9e4fe..6ef3789 100644 --- a/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java +++ b/main/java/shkd/repc/resm/opplugin/RegisteredFinishregOPPlugin.java @@ -35,7 +35,8 @@ public class RegisteredFinishregOPPlugin extends AbstractOperationServicePlugIn regSupplier.set("qeug_orgnumberes",resp_registered.getString("qeug_orgnumberes"));//组织机构代码 regSupplier.set("qeug_regstatuses",resp_registered.getString("qeug_regstatuses"));//经营状态 regSupplier.set("qeug_linkman",resp_registered.getString("qeug_linkman"));//外部联系人 - regSupplier.set("recommender",resp_registered.getDynamicObject("recommender"));//外部联系人 +// regSupplier.set("recommender",resp_registered.getDynamicObject("recommender"));//外部联系人 + regSupplier.set("qeug_recommender",resp_registered.getDynamicObject("qeug_recommender"));//内部推荐人 SaveServiceHelper.save(new DynamicObject[]{regSupplier}); DobeDWUtils.saveLog("注册供应商", "注册供应商",null, null, diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index f6ae65f..0ab03bc 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -22,22 +22,24 @@ import java.util.*; import static shkd.utils.OAUtils.*; -public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { +public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { private static final Log logger = LogFactory.getLog(todoZyTaskServiceHandler.class); /** * 通过人员id获取人员信息 - * @param userIds 人员id集合 + * + * @param userIds 人员id集合 * @param approvers 人员信息集合 */ - private List getApprovers(List userIds,List approvers){ + private List getApprovers(List userIds, List approvers) { for (Long userId : userIds) { DynamicObject user = BusinessDataServiceHelper.loadSingle(userId, "bos_user"); approvers.add(user); } return approvers; } + @Override public void createToDo(MessageContext messageContext, ToDoInfo toDoInfo) { System.out.println("createToDo"); @@ -62,7 +64,7 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { // 节点名称 String executionName = ""; DynamicObject execution = BusinessDataServiceHelper.loadSingle(executionId, "wf_execution"); - if(execution != null){ + if (execution != null) { executionName = execution.getString("activityname");// 节点名称 } //获取Url @@ -99,19 +101,19 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { if (StringUtils.isNotEmpty(oaToken)) { //todo OA人员绑定接口 - thirdpartyUser(approversLists, oaToken,billNo); + thirdpartyUser(approversLists, oaToken, billNo); HashMap thirdPartyMap = new HashMap<>(); - thirdPartyMap.put("oaToken",oaToken); - thirdPartyMap.put("approversLists",approversLists); - thirdPartyMap.put("taskId",taskId); - thirdPartyMap.put("title",title); - thirdPartyMap.put("startName",startName); - thirdPartyMap.put("createDateStr",createDateStr); - thirdPartyMap.put("url",url); - thirdPartyMap.put("url1",url1); - thirdPartyMap.put("billNo",billNo); - thirdPartyMap.put("startNumber",startNumber);//发起人 + thirdPartyMap.put("oaToken", oaToken); + thirdPartyMap.put("approversLists", approversLists); + thirdPartyMap.put("taskId", taskId); + thirdPartyMap.put("title", title); + thirdPartyMap.put("startName", startName); + thirdPartyMap.put("createDateStr", createDateStr); + thirdPartyMap.put("url", url); + thirdPartyMap.put("url1", url1); + thirdPartyMap.put("billNo", billNo); + thirdPartyMap.put("startNumber", startNumber);//发起人 //推送OA待办新增接口 thirdParty(thirdPartyMap); @@ -132,13 +134,13 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { String decisionType = ""; if (operationLogByTaskId.size() > 0) { decisionType = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getDecisionType(); - }else { + } else { return; } String subState = "0"; //驳回 - if("reject".equals(decisionType)){ + if ("reject".equals(decisionType)) { subState = "3"; } @@ -153,11 +155,11 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { if (StringUtils.isNotEmpty(oaToken)) { HashMap updateStateMap = new HashMap<>(); - updateStateMap.put("oaToken",oaToken); - updateStateMap.put("taskId",taskId); - updateStateMap.put("state","1"); - updateStateMap.put("subState",subState); - updateStateMap.put("billNo",billNo); + updateStateMap.put("oaToken", oaToken); + updateStateMap.put("taskId", taskId); + updateStateMap.put("state", "1"); + updateStateMap.put("subState", subState); + updateStateMap.put("billNo", billNo); //推送OA待办变更接口 updatePendingState(updateStateMap); @@ -196,11 +198,11 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { if (StringUtils.isNotEmpty(oaToken)) { HashMap updateStateMap = new HashMap<>(); - updateStateMap.put("oaToken",oaToken); - updateStateMap.put("taskId",taskId); - updateStateMap.put("state","1"); - updateStateMap.put("subState",subState); - updateStateMap.put("billNo",billNo); + updateStateMap.put("oaToken", oaToken); + updateStateMap.put("taskId", taskId); + updateStateMap.put("state", "1"); + updateStateMap.put("subState", subState); + updateStateMap.put("billNo", billNo); //推送OA待办变更接口 updatePendingState(updateStateMap); @@ -211,9 +213,20 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { @Override public void sendMessage(MessageContext messageContext, MessageInfo message) { super.sendMessage(messageContext, message); - //获取单据编码 -// String billNo = messageContext.getBillNo(); - String billNo =message.getNestBillno(); + //https://developer.kingdee.com/article/195641480978054400?productLineId=29&lang=zh-CN + //JSONObject.parseObject(String.valueOf(message.getParams().get("messageContext"))); + + Map params = message.getParams(); + String billNo = ""; + Long taskId = 0L; + if (params != null) { + String messagContext = String.valueOf(params.get("messageContext")); + JSONObject jsonObject = JSONObject.parseObject(messagContext); + if (null != jsonObject) { + billNo = jsonObject.getString("billNo");//获取单据编码 + taskId = jsonObject.getLong("taskId");//获取当前任务ID + } + } //消息内容 String content = message.getContent(); //消息时间 @@ -222,9 +235,7 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { Date createDate = message.getSendTime(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String createDateStr = sdf.format(createDate); - //获取当前任务ID -// Long taskId = messageContext.getTaskId(); - Long taskId = message.getId(); + //获取审批人集合 List approvers = new ArrayList<>(); @@ -260,15 +271,15 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { if (StringUtils.isNotEmpty(oaToken)) { HashMap thirdPartyMap = new HashMap<>(); - thirdPartyMap.put("oaToken",oaToken); - thirdPartyMap.put("approversLists",approversLists); - thirdPartyMap.put("taskId",taskId); - thirdPartyMap.put("content",content); - thirdPartyMap.put("createDateStr",createDateStr); - thirdPartyMap.put("url",url); - thirdPartyMap.put("url1",url1); - thirdPartyMap.put("billNo",billNo); - thirdPartyMap.put("startNumber",startNumber);//发起人 + thirdPartyMap.put("oaToken", oaToken); + thirdPartyMap.put("approversLists", approversLists); + thirdPartyMap.put("taskId", taskId); + thirdPartyMap.put("content", content); + thirdPartyMap.put("createDateStr", createDateStr); + thirdPartyMap.put("url", url); + thirdPartyMap.put("url1", url1); + thirdPartyMap.put("billNo", billNo); + thirdPartyMap.put("startNumber", startNumber);//发起人 //推送OA消息新增接口 thirdpartyMessage(thirdPartyMap);