Browse Source

项目审核详情评论信息添加

tags/24080901
CMM 1 year ago
parent
commit
66e5c9d9cd
6 changed files with 39 additions and 5 deletions
  1. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProcessComment.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProgressNode.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java
  4. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProgressNodeAuditInfoVo.java
  5. +30
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  6. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProcessComment.java View File

@@ -17,7 +17,6 @@ import java.util.List;
* @since 2023/02/01 16:25 * @since 2023/02/01 16:25
*/ */
@Data @Data
@Builder
@NoArgsConstructor @NoArgsConstructor
public class ProcessComment { public class ProcessComment {
/** /**


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProgressNode.java View File

@@ -55,7 +55,7 @@ public class ProgressNode {
/** /**
* 审核信息 * 审核信息
*/ */
private List<ProgressNodeAuditInfoVo> auditInfos;
private ProgressNodeAuditInfoVo auditInfo;
/** /**
* 处理结果 * 处理结果
*/ */


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.todocenter.bean.vo; package com.ningdatech.pmapi.todocenter.bean.vo;


import com.ningdatech.pmapi.common.model.FileBasicInfo;
import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode;
import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.entity.UserInfo;
@@ -11,7 +11,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;


import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProgressNodeAuditInfoVo.java View File

@@ -1,8 +1,10 @@
package com.ningdatech.pmapi.todocenter.bean.vo; package com.ningdatech.pmapi.todocenter.bean.vo;


import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.wflow.workflow.bean.process.OrgUser; import com.wflow.workflow.bean.process.OrgUser;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;


@@ -17,6 +19,7 @@ import java.util.Date;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder
public class ProgressNodeAuditInfoVo extends ProcessComment { public class ProgressNodeAuditInfoVo extends ProcessComment {
private String id; private String id;


@@ -26,7 +29,7 @@ public class ProgressNodeAuditInfoVo extends ProcessComment {


private String commentType; private String commentType;


private OrgUser user;
private UserInfo user;


private Date createTime; private Date createTime;
} }

+ 30
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -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.ProcessComment;
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode;
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; 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.constant.HisProInsEndActId;
import com.ningdatech.pmapi.todocenter.enums.IsAppendProjectEnum; import com.ningdatech.pmapi.todocenter.enums.IsAppendProjectEnum;
import com.ningdatech.pmapi.todocenter.enums.ProcessStatusEnum; 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.ProcessHandlerParamsVo;
import com.wflow.workflow.bean.vo.ProcessInstanceVo; import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo; import com.wflow.workflow.bean.vo.ProcessTaskVo;
import com.wflow.workflow.bean.vo.TaskCommentVo;
import com.wflow.workflow.config.WflowGlobalVarDef; import com.wflow.workflow.config.WflowGlobalVarDef;
import com.wflow.workflow.enums.ProcessHandlerEnum; import com.wflow.workflow.enums.ProcessHandlerEnum;
import com.wflow.workflow.service.FormService; import com.wflow.workflow.service.FormService;
@@ -822,6 +824,33 @@ public class TodoCenterManage {
Map<String, ProcessHandlerEnum> varMap = historyService.createHistoricVariableInstanceQuery() Map<String, ProcessHandlerEnum> varMap = historyService.createHistoricVariableInstanceQuery()
.processInstanceId(instanceId).variableNameLike("approve_%").list().stream() .processInstanceId(instanceId).variableNameLike("approve_%").list().stream()
.collect(Collectors.toMap(HistoricVariableInstance::getVariableName, v -> (ProcessHandlerEnum) v.getValue())); .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 -> { List<ProgressNode> progressNodes = list.stream().filter(his -> ObjectUtil.isNotNull(his.getTaskId())).map(his -> {
Object props = nodeProps.get(his.getActivityId()); Object props = nodeProps.get(his.getActivityId());
ApprovalModeEnum approvalMode = null; ApprovalModeEnum approvalMode = null;
@@ -838,6 +867,7 @@ public class TodoCenterManage {
.finishTime(his.getEndTime()) .finishTime(his.getEndTime())
.taskId(his.getTaskId()) .taskId(his.getTaskId())
.approvalMode(approvalMode) .approvalMode(approvalMode)
.auditInfo(commentsMap.get(his.getTaskId()))
.result(varMap.get("approve_" + his.getTaskId())) .result(varMap.get("approve_" + his.getTaskId()))
.build(); .build();
}).collect(Collectors.toList()); }).collect(Collectors.toList());


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data; import lombok.Data;


import java.io.Serializable; import java.io.Serializable;
@@ -21,6 +22,7 @@ import java.time.LocalDateTime;
@Data @Data
@TableName("nd_user_info") @TableName("nd_user_info")
@ApiModel(value = "UserInfo对象", description = "用户信息表") @ApiModel(value = "UserInfo对象", description = "用户信息表")
@Builder
public class UserInfo implements Serializable { public class UserInfo implements Serializable {


private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;


Loading…
Cancel
Save