if(nodeStatusSet.contains(template.getId() + "|" + data.getStatusId()))
continue;
nodeStatusSet.add(template.getId() + "|" + data.getStatusId());
Flow flow = das.queryFlow(template.getFlowId());
if(flow == null)
continue;
boolean isEditAllow = flow.isEditActionAllow(das.getUsername(), template.getId(), data.getAssignUsername(), data.getActionUser());
if(isEditAllow)
{
String[] assignUserArray = flow.queryNodeStatAssignUsers(template.getId(), data.getStatusId());
if(assignUserArray != null)
{
if(!actionUserMap.containsKey("编辑"))
actionUserMap.put("编辑", new LinkedHashSet<String>());
actionUserMap.get("编辑").addAll(Arrays.asList(assignUserArray));
}
}
Set<Action> actionSet = new LinkedHashSet<Action>();
Action[] statActionArray = flow.queryStatActions(data.getStatusId());
if(statActionArray == null || statActionArray.length == 0)
{
Action[] userNodeBeginActionArray = flow.queryUserNodeBeginActions(das.getUsername(), template.getId());
for(int i = 0; userNodeBeginActionArray != null && i < userNodeBeginActionArray.length; i++)
actionSet.add(userNodeBeginActionArray[i]);
}
else
{
Action[] userNodeStatActionArray = flow.queryUserNodeStatActions(das.getUsername(), template.getId(), data.getStatusId());
for(int i = 0; userNodeStatActionArray != null && i < userNodeStatActionArray.length; i++)
actionSet.add(userNodeStatActionArray[i]);
}
for(Action action : actionSet)
{
String actionName = action.getName();
if(action.getBeginStatId() == null)
actionName = "激活--" + actionName;
actionUserMap.put(actionName, new LinkedHashSet<String>());
String[] userArray = flow.queryNodeStatAssignUsers(template.getId(), action.getEndStatId());
if(userArray != null)
actionUserMap.get(actionName).addAll(Arrays.asList(userArray));
}
}