Activiti获取批注信息
看图:主要用到的是Activiti的 taskService.getProcessInstanceComments(processInstanceId) APIaction层://查询批注List<Map<String, Object>> commentList = new ArrayList<>();List<Comment> comments=w
·
看图:
主要用到的是Activiti的 taskService.getProcessInstanceComments(processInstanceId) API
action层:
//查询批注
List<Map<String, Object>> commentList = new ArrayList<>();
List<Comment> comments=workFlowService.getComment(taskId); //查询批注信息
for (Comment comment : comments) {
Map<String, Object> dMap = new HashMap<>();
dMap.put("taskId", comment.getTaskId()); //任务id
dMap.put("fullMessage", comment.getFullMessage()); //审批意见
dMap.put("time", sdf.format(comment.getTime())); //审批时间
dMap.put("userId", comment.getUserId()); //审批人
commentList.add(dMap);
}
service层:
//查询批注信息
@Override
public List<Comment> getComment(String taskId) {
// 根据任务id查询流程实例id
String processInstanceId = taskService.createTaskQuery().taskId(taskId).singleResult().getProcessInstanceId();
List<Comment> commentList = taskService.getProcessInstanceComments(processInstanceId);
return commentList;
}
更多推荐
已为社区贡献1条内容
所有评论(0)