Bläddra i källkod

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

master
CMM 1 år sedan
förälder
incheckning
66e5c9d9cd
6 ändrade filer med 39 tillägg och 5 borttagningar
  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 Visa fil

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


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ProgressNode.java Visa fil

@@ -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 Visa fil

@@ -1,6 +1,6 @@
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.todocenter.bean.entity.ProgressNode;
import com.ningdatech.pmapi.user.entity.UserInfo;
@@ -11,7 +11,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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


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

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

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

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

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

private String commentType;

private OrgUser user;
private UserInfo user;

private Date createTime;
}

+ 30
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Visa fil

@@ -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());


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java Visa fil

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

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

private static final long serialVersionUID = 1L;


Laddar…
Avbryt
Spara