@Override
public Object getListCommentsByBusinessKey(String businessKey) {
if (StringUtils.isBlank(businessKey)) {
return failure("businessKey不能为空,请检查!!!");
}
/**1:使用历史的流程实例查询,返回历史的流程实例对象,获取流程实例ID*/
HistoricProcessInstance hpi = historyService.createHistoricProcessInstanceQuery()//对应历史的流程实例表
.processInstanceBusinessKey(businessKey)//使用BusinessKey字段查询
.singleResult();
//流程实例ID
String processInstanceId = hpi.getId();
//List<Comment> list = taskService.getProcessInstanceComments(processInstanceId);
List<HistoricActivityInstance> haiList = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId)
.activityType("userTask")
.orderByHistoricActivityInstanceEndTime()
.asc()
.list();
List<CommentBean> commentBeans = new ArrayList<>();
for (HistoricActivityInstance hai : haiList) {
//根据任务id去历史意见表查询数据
List<CommentVo> commList = apiFlowableTaskService.getTaskCommentsByTaskId(hai.getTaskId());
for (int i = 0; i < commList.size(); i++) {
CommentBean commentBean = new CommentBean();
commentBean.setActivityName(hai.getActivityName());
commList.get(i).setMessage(commList.get(i).getMessage());
commentBean.setComment(commList.get(i));
commentBeans.add(commentBean);
}
}
HashMap var3 = new HashMap();
var3.put("statusCode", CommonConstants.SUCCESS_STATUS_CODE);
var3.put("title", CommonConstants.OPERATE_SUCCESS_MSG);
var3.put("message", "获取数据成功");
var3.put("commentBeans", commentBeans);
return var3;
}
flowable根据业务id查询审批意见以及步骤
猜你喜欢
转载自blog.csdn.net/qq_36213455/article/details/113947956
今日推荐
周排行