看图:

主要用到的是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;
	}

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐