diff --git a/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java b/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java index 376ea39..25b14e5 100644 --- a/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java @@ -192,9 +192,9 @@ public class TestFormPlugin extends AbstractFormPlugin { if (null != toTime) { supplier.set("qeug_end", new Date(toTime));//营业期限(终止) } - if (null != cancelDate) { - supplier.set("qeug_logoff", new Date(cancelDate));//注销日期 - } +// if (null != cancelDate) { +// supplier.set("qeug_logoff", new Date(cancelDate));//注销日期 +// } SaveServiceHelper.save(new DynamicObject[]{supplier}); } diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 1510587..391e3fa 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -161,24 +161,33 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { //获取流程实例ID Long processInstanceId = messageContext.getProcessInstanceId(); - //获取单据编码 - String billNo = messageContext.getBillNo(); + //获取审批人集合 + List approvers = new ArrayList<>(); + List userIds = toDoInfo.getUserIds(); // 审批人ID集合 + List approversLists = getApprovers(userIds, approvers); + for (DynamicObject approversList : approversLists) { + String number = approversList.getString("number"); + //获取单据编码 + String billNo = messageContext.getBillNo(); - //获取token - String oaToken = OAUtils.getOaToken(billNo); - if (StringUtils.isNotEmpty(oaToken)) { + //获取token + String oaToken = OAUtils.getOaToken(billNo); + 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); + HashMap updateStateMap = new HashMap<>(); + updateStateMap.put("oaToken", oaToken); + updateStateMap.put("taskId", taskId + number); + updateStateMap.put("state", "1"); + updateStateMap.put("subState", subState); + updateStateMap.put("billNo", billNo); - //推送OA待办变更接口 - updatePendingState(updateStateMap); + //推送OA待办变更接口 + updatePendingState(updateStateMap); + } } + + System.out.println("createToDo"); System.out.println("createToDo"); } @@ -204,24 +213,33 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { // subState = "3"; // } - //获取单据编码 - String billNo = messageContext.getBillNo(); + //获取审批人集合 + List approvers = new ArrayList<>(); + List userIds = toDoInfo.getUserIds(); // 审批人ID集合 + List approversLists = getApprovers(userIds, approvers); + for (DynamicObject approversList : approversLists) { + String number = approversList.getString("number"); + //获取单据编码 + String billNo = messageContext.getBillNo(); - //获取token - String oaToken = OAUtils.getOaToken(billNo); - if (StringUtils.isNotEmpty(oaToken)) { + //获取token + String oaToken = OAUtils.getOaToken(billNo); + 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); + HashMap updateStateMap = new HashMap<>(); + updateStateMap.put("oaToken", oaToken); + updateStateMap.put("taskId", taskId + number); + updateStateMap.put("state", "1"); + updateStateMap.put("subState", subState); + updateStateMap.put("billNo", billNo); - //推送OA待办变更接口 - updatePendingState(updateStateMap); + //推送OA待办变更接口 + updatePendingState(updateStateMap); + } } + + } @Override diff --git a/main/java/shkd/utils/OAUtils.java b/main/java/shkd/utils/OAUtils.java index cb38879..6436f5a 100644 --- a/main/java/shkd/utils/OAUtils.java +++ b/main/java/shkd/utils/OAUtils.java @@ -17,6 +17,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static kd.isc.iscb.platform.core.connector.self.Attachment.random; import static shkd.repc.resm.opplugin.PushOASupplierOPPlugin.RESM_OFFICIAL_SUPPLIER; import static shkd.repc.resm.opplugin.PushOASupplierOPPlugin.assembleBody; @@ -198,7 +199,10 @@ public class OAUtils { List approversLists = (List)thirdPartyMap.get("approversLists"); for (DynamicObject approver :approversLists ) { JSONObject jsonObject = new JSONObject(); - jsonObject.put("taskId", String.valueOf(thirdPartyMap.get("taskId")));//第三方待办主键(保证唯一) +// // 生成随机8位数 +// long taskId = 10000000L + (long) (random.nextDouble() * 90000000L); +// String taskid = String.valueOf(taskId); + jsonObject.put("taskId", String.valueOf(thirdPartyMap.get("taskId")) + approver.getString("number"));//第三方待办主键(保证唯一) jsonObject.put("registerCode", "3004");//系统注册编码 jsonObject.put("title", String.valueOf(thirdPartyMap.get("title")) );//待办标题 jsonObject.put("thirdSenderId", String.valueOf(thirdPartyMap.get("startNumber")));//第三方待办发起人主键 @@ -319,7 +323,7 @@ public class OAUtils { List approversLists = (List)thirdPartyMap.get("approversLists"); for (DynamicObject approver :approversLists ) { JSONObject jsonObject = new JSONObject(); - jsonObject.put("thirdpartyMessageId", String.valueOf(thirdPartyMap.get("taskId")));//待办主键(保证唯一) + jsonObject.put("thirdpartyMessageId", String.valueOf(thirdPartyMap.get("taskId")) + approver.getString("number"));//待办主键(保证唯一) jsonObject.put("thirdpartyRegisterCode", "3004");//系统注册编码 jsonObject.put("messageContent", String.valueOf(thirdPartyMap.get("content")) );//消息内容 jsonObject.put("thirdpartySenderId", String.valueOf(thirdPartyMap.get("startNumber")));//发起人主键