标记流程为事业部还是产品规划部
This commit is contained in:
+15
-15
@@ -36,31 +36,27 @@ public class DistributionAfter implements TaskListener {
|
|||||||
delegateTask.setVariable("objectJson",object);
|
delegateTask.setVariable("objectJson",object);
|
||||||
|
|
||||||
List<String> nextUserList = new ArrayList();
|
List<String> nextUserList = new ArrayList();
|
||||||
|
Map<String, String> departmentMap = new HashMap<>(); //用户--用户所属部门
|
||||||
|
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(object.getString("responUserList"))){
|
if(StringUtils.isNotBlank(object.getString("responUserList"))){
|
||||||
nextUserList= Arrays.asList(object.getString("responUserList").split(","));
|
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.setVariable("commentUserList",nextUserList);
|
||||||
delegateTask.addCandidateUsers(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++) {
|
JSONArray commentCollectionList=delegateTask.getVariable("commentCollectionList",JSONArray.class);
|
||||||
JSONObject json=new JSONObject();
|
if (commentCollectionList==null) commentCollectionList=new JSONArray();
|
||||||
json.put("id",nextUserList.get(i));
|
delegateTask.setVariable("commentCollectionList",commentCollectionList);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -97,10 +93,14 @@ public class DistributionAfter implements TaskListener {
|
|||||||
|
|
||||||
if(nextUserList != null && !nextUserList.isEmpty()){
|
if(nextUserList != null && !nextUserList.isEmpty()){
|
||||||
for(String nextUser : nextUserList){
|
for(String nextUser : nextUserList){
|
||||||
|
//标记此用户是事业部还是产品规划部
|
||||||
|
JSONObject repositoryObject =object;
|
||||||
|
repositoryObject.put("department",departmentMap.get(nextUser));
|
||||||
|
|
||||||
BusProcessNew busProcessNewNext = new BusProcessNew();
|
BusProcessNew busProcessNewNext = new BusProcessNew();
|
||||||
busProcessNewNext.setMsgType("clause");
|
busProcessNewNext.setMsgType("clause");
|
||||||
busProcessNewNext.setPId(delegateTask.getProcessInstanceId());
|
busProcessNewNext.setPId(delegateTask.getProcessInstanceId());
|
||||||
busProcessNewNext.setMesg(object.toJSONString());
|
busProcessNewNext.setMesg(repositoryObject.toJSONString());
|
||||||
busProcessNewNext.setTaskInfo(delegateTask.getTaskDefinitionKey());
|
busProcessNewNext.setTaskInfo(delegateTask.getTaskDefinitionKey());
|
||||||
busProcessNewNext.setFinishFlag("0");
|
busProcessNewNext.setFinishFlag("0");
|
||||||
busProcessNewNext.setTaskInfo(delegateTask.getName());
|
busProcessNewNext.setTaskInfo(delegateTask.getName());
|
||||||
|
|||||||
Reference in New Issue
Block a user