|
|
@@ -28,6 +28,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; |
|
|
|
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; |
|
|
|
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; |
|
|
|
import com.ningdatech.pmapi.todocenter.bean.vo.ProgressNodeAuditInfoVo; |
|
|
|
import com.ningdatech.pmapi.todocenter.constant.HisProInsEndActId; |
|
|
|
import com.ningdatech.pmapi.todocenter.enums.IsAppendProjectEnum; |
|
|
|
import com.ningdatech.pmapi.todocenter.enums.ProcessStatusEnum; |
|
|
@@ -60,6 +61,7 @@ import com.wflow.workflow.bean.process.props.ApprovalProps; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessInstanceVo; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessTaskVo; |
|
|
|
import com.wflow.workflow.bean.vo.TaskCommentVo; |
|
|
|
import com.wflow.workflow.config.WflowGlobalVarDef; |
|
|
|
import com.wflow.workflow.enums.ProcessHandlerEnum; |
|
|
|
import com.wflow.workflow.service.FormService; |
|
|
@@ -822,6 +824,33 @@ public class TodoCenterManage { |
|
|
|
Map<String, ProcessHandlerEnum> varMap = historyService.createHistoricVariableInstanceQuery() |
|
|
|
.processInstanceId(instanceId).variableNameLike("approve_%").list().stream() |
|
|
|
.collect(Collectors.toMap(HistoricVariableInstance::getVariableName, v -> (ProcessHandlerEnum) v.getValue())); |
|
|
|
|
|
|
|
Map<String, List<ProgressNodeAuditInfoVo>> commentMap = new HashMap<>(); |
|
|
|
//统一处理所有评论数据,省的多次查询 |
|
|
|
List<ProgressNodeAuditInfoVo> cmvos = taskService.getProcessInstanceComments(instanceId).stream().map(comment -> { |
|
|
|
userSet.add(comment.getUserId()); |
|
|
|
ProgressNodeAuditInfoVo progressNodeAuditInfoVo = ProgressNodeAuditInfoVo.builder() |
|
|
|
.id(comment.getId()) |
|
|
|
.taskId(comment.getTaskId()) |
|
|
|
.commentType(comment.getType()) |
|
|
|
.type("COMMENT") |
|
|
|
.createTime(comment.getTime()) |
|
|
|
.user(UserInfo.builder().id(Long.valueOf(comment.getUserId())).build()) |
|
|
|
.build(); |
|
|
|
ProcessComment processComment = JSONObject.parseObject(comment.getFullMessage(), ProcessComment.class); |
|
|
|
progressNodeAuditInfoVo.setText(processComment.getText()); |
|
|
|
progressNodeAuditInfoVo.setAttachments(processComment.getAttachments()); |
|
|
|
return progressNodeAuditInfoVo; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
cmvos.forEach(cm -> { |
|
|
|
//把评论数据按照task进行归类 |
|
|
|
String taskId = Optional.ofNullable(cm.getTaskId()).orElse(instanceId); |
|
|
|
List<ProgressNodeAuditInfoVo> vos = commentMap.computeIfAbsent(taskId, k -> new ArrayList<>()); |
|
|
|
vos.add(cm); |
|
|
|
}); |
|
|
|
// 再将评论按照任务一次构建,方便取出 |
|
|
|
Map<String, ProgressNodeAuditInfoVo> commentsMap = cmvos.stream() |
|
|
|
.collect(Collectors.toMap(ProgressNodeAuditInfoVo::getTaskId, c -> c)); |
|
|
|
List<ProgressNode> progressNodes = list.stream().filter(his -> ObjectUtil.isNotNull(his.getTaskId())).map(his -> { |
|
|
|
Object props = nodeProps.get(his.getActivityId()); |
|
|
|
ApprovalModeEnum approvalMode = null; |
|
|
@@ -838,6 +867,7 @@ public class TodoCenterManage { |
|
|
|
.finishTime(his.getEndTime()) |
|
|
|
.taskId(his.getTaskId()) |
|
|
|
.approvalMode(approvalMode) |
|
|
|
.auditInfo(commentsMap.get(his.getTaskId())) |
|
|
|
.result(varMap.get("approve_" + his.getTaskId())) |
|
|
|
.build(); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|