标记流程为事业部还是产品规划部

This commit is contained in:
zhaokaiyao@91isoft.com
2021-11-04 17:52:46 +08:00
parent 4cbb52d32a
commit 6d9cd8ffb4
@@ -36,31 +36,27 @@ public class DistributionAfter implements TaskListener {
delegateTask.setVariable("objectJson",object);
List<String> nextUserList = new ArrayList();
Map<String, String> departmentMap = new HashMap<>(); //用户--用户所属部门
if(StringUtils.isNotBlank(object.getString("responUserList"))){
nextUserList= Arrays.asList(object.getString("responUserList").split(","));
JSONArray mapArray = object.getJSONArray("responUserAndInstitutionNameMap");
for (Object jsonMap : mapArray) {
departmentMap.putAll(JSONObject.parseObject(jsonMap.toString(), Map.class));
}
// 配置多实例
delegateTask.setVariable("commentUserList",nextUserList);
delegateTask.addCandidateUsers(nextUserList);
}
JSONArray userListJson= JSON.parseArray(delegateTask.getVariable("responUserListInfo",String.class));
if(userListJson==null)userListJson=new JSONArray();
List<String> strings=new ArrayList<>();
Map<String,JSONObject> map=new HashMap<>();
for (int i = 0; i < nextUserList.size(); i++) {
JSONObject json=new JSONObject();
json.put("id",nextUserList.get(i));
json.put("name",nextUserList.get(i));
json.put("dockUser",delegateTask.getAssignee());
json.put("info",new JSONArray());
userListJson.add(json);
strings.add(nextUserList.get(i));
map.put(nextUserList.get(i),json);
}
JSONArray commentCollectionList=delegateTask.getVariable("commentCollectionList",JSONArray.class);
if (commentCollectionList==null) commentCollectionList=new JSONArray();
delegateTask.setVariable("commentCollectionList",commentCollectionList);
@@ -97,10 +93,14 @@ public class DistributionAfter implements TaskListener {
if(nextUserList != null && !nextUserList.isEmpty()){
for(String nextUser : nextUserList){
//标记此用户是事业部还是产品规划部
JSONObject repositoryObject =object;
repositoryObject.put("department",departmentMap.get(nextUser));
BusProcessNew busProcessNewNext = new BusProcessNew();
busProcessNewNext.setMsgType("clause");
busProcessNewNext.setPId(delegateTask.getProcessInstanceId());
busProcessNewNext.setMesg(object.toJSONString());
busProcessNewNext.setMesg(repositoryObject.toJSONString());
busProcessNewNext.setTaskInfo(delegateTask.getTaskDefinitionKey());
busProcessNewNext.setFinishFlag("0");
busProcessNewNext.setTaskInfo(delegateTask.getName());