List<Map<String,Object>> instanceMaps = new ArrayList<Map<String,Object>>();
for(TaskInstance tmp:instances){
Map<String,Object> instanceMap = tmp.getPersistentState();
String assigneeUserId = tmp.getAssignee();
if(StringUtil.isNotEmpty(assigneeUserId)){
UserTo tmpUser = identityService.getUserTo(assigneeUserId);
if(tmpUser!=null){
instanceMap.put("assgneeUserName", tmpUser.getUserName());
}
}else{
instanceMap.put("assgneeUserName", "(空用户名)");
}
instanceMaps.add(instanceMap);
}
tq.taskNotEnd().orderByTaskCreateTime().asc();
List<TaskInstance> instancesNotEnd = tq.list();
List<Map<String,Object>> notEndInstanceMaps = new ArrayList<Map<String,Object>>();
for(TaskInstance tmp:instancesNotEnd){
Map<String,Object> instanceMap = tmp.getPersistentState();
String assigneeUserId = tmp.getAssignee();
if(StringUtil.isNotEmpty(assigneeUserId)){
UserTo tmpUser = identityService.getUserTo(assigneeUserId);
if(tmpUser!=null){
instanceMap.put("assgneeUserName", tmpUser.getUserName());
}
}else{
instanceMap.put("assgneeUserName", "(空用户名)");
}
notEndInstanceMaps.add(instanceMap);