소스 검색

流程处理进度详情修改

master
CMM 1 년 전
부모
커밋
575b0ebc0b
7개의 변경된 파일69개의 추가작업 그리고 19개의 파일을 삭제
  1. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConstant.java
  2. +2
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java
  3. +5
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  4. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/extension/cmd/SaveCommentCmd.java
  5. +22
    -10
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  6. +30
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ProcessDetailReq.java
  7. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/vo/ResToBeProcessedVO.java

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConstant.java 파일 보기

@@ -14,4 +14,8 @@ public class CommonConstant {
public static final String CALL_STATUS = "status";
public static final String CALL_STATUS_OK_VALUE = "ok";

public static final Integer COMMENT_MAX_SIZE = 163;
public static final Integer SUB_COMMENT_SIZE_MIN = 0;
public static final Integer SUB_COMMENT_SIZE_MAX = 160;

}

+ 2
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java 파일 보기

@@ -24,14 +24,13 @@ public class ProcessProgressDetailVo {
* 流程处理详情
*/
private ProcessProgressVo processProgressVo;

/**
* 流程状态
*/
private String status;
/**
* 发起人
* 项目ID
*/
private ProcessInstanceUserDto startUser;
private Long projectId;

}

+ 5
- 4
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java 파일 보기

@@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo;
import com.ningdatech.pmapi.todocenter.model.dto.req.ProcessDetailReq;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq;
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO;
import org.springframework.web.bind.annotation.*;
@@ -60,12 +61,12 @@ public class TodoCenterController {

/**
* 查询流程表单数据及审批的进度步骤
* @param instanceId 流程实例ID
* @param request 请求参数
* @return 流程进度及表单详情
*/
@GetMapping("/progress/{instanceId}")
public ProcessProgressDetailVo getProcessDetail(@PathVariable String instanceId) {
return todoCenterManage.getProcessDetail(instanceId);
@GetMapping("/progress/detail")
public ProcessProgressDetailVo getProcessDetail(@Valid @ModelAttribute ProcessDetailReq request) {
return todoCenterManage.getProcessDetail(request);
}

/**


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/extension/cmd/SaveCommentCmd.java 파일 보기

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.todocenter.extension.cmd;

import com.ningdatech.pmapi.common.constant.CommonConstant;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.common.engine.impl.identity.Authentication;
@@ -85,8 +86,8 @@ public class SaveCommentCmd implements Command<Comment> {
comment.setProcessInstanceId(this.processInstanceId);
comment.setAction("AddComment");
String eventMessage = this.message.replaceAll("\\s+", " ");
if (eventMessage.length() > 163) {
eventMessage = eventMessage.substring(0, 160) + "...";
if (eventMessage.length() > CommonConstant.COMMENT_MAX_SIZE) {
eventMessage = eventMessage.substring(CommonConstant.SUB_COMMENT_SIZE_MIN, CommonConstant.SUB_COMMENT_SIZE_MAX) + "...";
}

comment.setMessage(eventMessage);


+ 22
- 10
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java 파일 보기

@@ -5,14 +5,12 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Sets;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.GenericResult;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.constant.CommonConstant;
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.SendWorkNoticeUtil;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
@@ -26,6 +24,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo;
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum;
import com.ningdatech.pmapi.todocenter.model.dto.req.ProcessDetailReq;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq;
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO;
@@ -56,10 +55,6 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;

import static cn.hutool.core.collection.CollUtil.isEmpty;
@@ -105,7 +100,7 @@ public class TodoCenterManage {
return PageVo.empty();
}
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList());
Map<String, ProcessTaskVo> taskVoMap = userTodoList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v));
//2.再分页查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setInstCodes(instCodes);
@@ -120,6 +115,8 @@ public class TodoCenterManage {
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
res.setProjectId(d.getId());
ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode());
res.setNodeId(taskVo.getTaskDefKey());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
res.setProcessLaunchTime(d.getCreateOn());
return res;
@@ -555,11 +552,21 @@ public class TodoCenterManage {

/**
* 查询流程表单数据及审批的进度步骤
* @param instanceId 流程实例ID
*
* @param request 请求参数
* @return 流程进度及表单详情
*/
public ProcessProgressDetailVo getProcessDetail(String instanceId) {
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(null, instanceId);
public ProcessProgressDetailVo getProcessDetail(ProcessDetailReq request) {
String instanceId = request.getInstanceId();
String nodeId = request.getNodeId();
Long projectId = request.getProjectId();
ProcessProgressVo progressInstanceDetail = null;
if (Objects.isNull(nodeId)) {
progressInstanceDetail = processInstanceService.getProgressInstanceDetail(null, instanceId);
}else {
progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId);
}

List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo();

Set<String> userSet = Sets.newHashSet();
@@ -580,6 +587,7 @@ public class TodoCenterManage {
ProcessProgressDetailVo res = new ProcessProgressDetailVo();
res.setProcessProgressVo(progressInstanceDetail);
res.setStatus(progressInstanceDetail.getStatus());
res.setProjectId(projectId);
return res;
}

@@ -796,6 +804,8 @@ public class TodoCenterManage {
return PageVo.empty();
}
List<String> instCodes = ccMeList.stream().map(ProcessInstanceVo::getInstanceId).collect(Collectors.toList());
Map<String, ProcessInstanceVo> instanceVoMap = ccMeList.stream()
.collect(Collectors.toMap(ProcessInstanceVo::getInstanceId, v -> v));

// 分页查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
@@ -810,6 +820,8 @@ public class TodoCenterManage {
List<ResToBeProcessedVO> resVos = projectPage.getRecords().stream().map(d -> {
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
ProcessInstanceVo instanceVo = instanceVoMap.get(d.getInstCode());
res.setNodeId(instanceVo.getNodeId());
res.setProjectId(d.getId());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
res.setProcessLaunchTime(d.getCreateOn());


+ 30
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ProcessDetailReq.java 파일 보기

@@ -0,0 +1,30 @@
package com.ningdatech.pmapi.todocenter.model.dto.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

/**
* 流程处理进度详情请求参数
*
* @author CMM
* @since 2023/02/24 10:15
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProcessDetailReq {

@ApiModelProperty("流程实例ID")
@NotNull
private String instanceId;

@ApiModelProperty("流程节点ID")
private String nodeId;

@ApiModelProperty("项目ID")
private Long projectId;
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/vo/ResToBeProcessedVO.java 파일 보기

@@ -32,6 +32,9 @@ public class ResToBeProcessedVO implements Serializable {
@ApiModelProperty("流程实例编号")
private String instCode;

@ApiModelProperty("待处理节点ID")
private String nodeId;

@ApiModelProperty("项目名称")
private String projectName;



불러오는 중...
취소
저장