Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
WendyYang 1 year ago
parent
commit
3b2e876824
12 changed files with 160 additions and 24 deletions
  1. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java
  2. +16
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  3. +77
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  4. +59
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/AdjustHandleDTO.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ResCcMeExportDTO.java
  6. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ResHandledExportDTO.java
  7. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ResMySubmittedExportDTO.java
  8. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ProcessDetailReq.java
  9. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ProcessProgressDetailVo.java
  12. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java

+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java View File

@@ -12,13 +12,10 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum;
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq;
import com.wflow.workflow.enums.ProcessStatusEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.http.HttpStatus;


+ 16
- 5
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java View File

@@ -4,15 +4,19 @@ package com.ningdatech.pmapi.todocenter.controller;
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.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO;
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo;
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq;
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
@@ -158,4 +162,11 @@ public class TodoCenterController {
param.setIsTemporaryAugment(isTemporaryAugment);
todoCenterManage.exportCcMeProjectList(response,param);
}

@ApiOperation(value = "被退回项目内容调整并通过", notes = "被退回项目内容调整并通过")
@PostMapping
public String startTheProcess(@Validated @RequestBody AdjustHandleDTO dto) {
String instanceId = todoCenterManage.adjustment(dto);
return "退回项目内容调整并且重新通过 【" + instanceId + "】 成功";
}
}

+ 77
- 7
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -17,25 +17,32 @@ import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo;
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO;
import com.ningdatech.pmapi.todocenter.model.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.ToBeProcessedExportReq;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO;
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO;
import com.wflow.workflow.bean.process.ProgressNode;
@@ -43,6 +50,7 @@ import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import com.wflow.workflow.service.ProcessTaskService;
@@ -55,6 +63,7 @@ import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.runtime.ActivityInstance;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
@@ -85,6 +94,8 @@ public class TodoCenterManage {
private final IDingOrganizationService dingOrganizationService;
private final ProcessInstanceService processInstanceService;
private final INdWorkNoticeStagingService workNoticeStagingService;
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;
private final IProjectApplicationService projectApplicationService;


/**
@@ -617,7 +628,9 @@ public class TodoCenterManage {
return PageVo.empty();
}
List<String> instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList());

List<HistoricProcessInstance> instances = historyService.createHistoricProcessInstanceQuery()
.list();
Map<String, HistoricProcessInstance> instanceMap = CollUtils.listToMap(instances, HistoricProcessInstance::getId);

// 分页查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
@@ -632,7 +645,7 @@ public class TodoCenterManage {
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
res.setProjectId(d.getId());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
res.setProcessStatusName(processInstanceService.buildProcessStatusStr(instanceMap.get(d.getInstCode())));
res.setProcessLaunchTime(d.getCreateOn());
res.setProcessHandleTime(d.getUpdateOn());
return res;
@@ -886,4 +899,61 @@ public class TodoCenterManage {
ExcelDownUtil.excelExportFile(response, excelExportWriter);

}

/**
* 被退回项目内容调整并重新通过
* @param dto
* @return
*/
@Transactional(rollbackFor = Exception.class)
public String adjustment(AdjustHandleDTO dto) {
ProjectDTO projectDto = dto.getProjectInfo();
Project projectInfo = projectService.getById(projectDto.getId());

VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!");

//项目名称去重
defaultDeclaredProjectManage.checkDuplication(projectDto);

//修改项目内容
if(!modifyProject(projectDto)){
throw new BusinessException("调整项目失败!");
}

//最后去审批(通过)当前退回节点的审核任务
ReqProcessHandlerDTO handlerDTO = new ReqProcessHandlerDTO();
handlerDTO.setProjectId(dto.getProjectId());
handlerDTO.setInstanceId(dto.getInstanceId());
handlerDTO.setTaskId(dto.getTaskId());
handlerDTO.setAction(ProcessHandlerEnum.PASS);
handlerDTO.setAuditInfo(dto.getAuditInfo());
handler(handlerDTO);
return dto.getInstanceId();

}

private Boolean modifyProject(ProjectDTO projectDto) {
//先修改项目信息
Project project = new Project();
BeanUtils.copyProperties(projectDto,project);
project.setUpdateOn(LocalDateTime.now());
if(!projectService.updateById(project)){
throw new BusinessException("项目调整失败");
}
//再修改应用信息
if(CollUtil.isNotEmpty(projectDto.getApplicationList())){
//采取批量删除 批量添加的方式
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId,project.getId()));
//批量添加
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> {
ProjectApplication projectApplication = new ProjectApplication();
BeanUtils.copyProperties(application, projectApplication);
projectApplication.setProjectId(project.getId());
return projectApplication;
}).collect(Collectors.toList());
projectApplicationService.saveBatch(applications);
}
return Boolean.TRUE;
}
}

+ 59
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/AdjustHandleDTO.java View File

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

import java.io.Serializable;
import java.util.Map;

import javax.validation.constraints.NotNull;

import com.google.common.collect.Maps;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.wflow.workflow.bean.process.ProcessComment;
import com.wflow.workflow.enums.ProcessHandlerEnum;

import cn.hutool.core.collection.CollUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @Classname DefaultDeclaredDTO
* @Description
* @Date 2023/2/14 17:16
* @Author PoffyZhang
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdjustHandleDTO implements Serializable {

private static final long serialVersionUID = 1L;

@NotNull
@ApiModelProperty("项目信息")
private ProjectDTO projectInfo;

@ApiModelProperty("表单信息 新增模块")
private Map<String,Object> formData;

public Map<String,Object> getFormData(){
if(CollUtil.isEmpty(this.formData)){
this.formData = Maps.newHashMap();
return this.formData;
}
return this.formData;
}
@ApiModelProperty("项目ID")
@NotNull(message = "要处理的项目ID不能为空!")
private Long projectId;

@NotNull(message = "流程实例ID不能为空!")
private String instanceId;

@ApiModelProperty("任务ID")
@NotNull(message = "任务ID不能为空!")
private String taskId;

@ApiModelProperty("审核信息")
private ProcessComment auditInfo;
}

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResCcMeExportDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ResCcMeExportDTO.java View File

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.todocenter.model.dto.dto;
package com.ningdatech.pmapi.todocenter.model.dto;

import java.io.Serializable;
import java.time.LocalDateTime;

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResHandledExportDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ResHandledExportDTO.java View File

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.todocenter.model.dto.dto;
package com.ningdatech.pmapi.todocenter.model.dto;

import java.io.Serializable;
import java.time.LocalDateTime;

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResMySubmittedExportDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ResMySubmittedExportDTO.java View File

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.todocenter.model.dto.dto;
package com.ningdatech.pmapi.todocenter.model.dto;

import java.io.Serializable;
import java.time.LocalDateTime;

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ProcessDetailReq.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ProcessDetailReq.java View File

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

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

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ToBeProcessedExportReq.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedExportReq.java View File

@@ -1,8 +1,7 @@
package com.ningdatech.pmapi.todocenter.model.dto.req;
package com.ningdatech.pmapi.todocenter.model.req;

import java.util.List;

import javax.validation.constraints.NotNull;
import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum;

import io.swagger.annotations.ApiModelProperty;

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ToBeProcessedReq.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java View File

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

import java.io.Serializable;
import java.time.LocalDateTime;

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ProcessProgressDetailVo.java View File

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


import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/vo/ResToBeProcessedVO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java View File

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.todocenter.model.dto.vo;
package com.ningdatech.pmapi.todocenter.model.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.fasterxml.jackson.annotation.JsonFormat;

Loading…
Cancel
Save