ソースを参照

待办中心 优化代码

tags/24080901
PoffyZhang 1年前
コミット
50b8911a3b
15個のファイルの変更271行の追加400行の削除
  1. +6
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java
  2. +3
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java
  3. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  4. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java
  5. +12
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java
  6. +35
    -28
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
  7. +50
    -37
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  8. +96
    -251
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResCcMeExportDTO.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResHandledExportDTO.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResMySubmittedExportDTO.java
  12. +0
    -52
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedExportDTO.java
  13. +27
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ToBeProcessedExportReq.java
  14. +18
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ToBeProcessedReq.java
  15. +7
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/vo/ResToBeProcessedVO.java

+ 6
- 6
pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java ファイルの表示

@@ -79,24 +79,24 @@ public class StateMachineUtils {
return false;
}

public ProjectStatusChangeEvent getProjectStatusPassEvent(Integer projectStatusSecond) {
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getPassValueByCode(projectStatusSecond);
public ProjectStatusChangeEvent getProjectStatusPassEvent(Integer status) {
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getPassValueByCode(status);
if (Objects.isNull(event)) {
throw new BizException("该状态下没有对应的通过操作!");
}
return event;
}

public ProjectStatusChangeEvent getProjectStatusRejectEvent(Integer projectStatusSecond) {
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getRejectValueByCode(projectStatusSecond);
public ProjectStatusChangeEvent getProjectStatusRejectEvent(Integer status) {
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getRejectValueByCode(status);
if (Objects.isNull(event)) {
throw new BizException("该状态下没有对应的驳回操作!");
}
return event;
}

public ProjectStatusChangeEvent getProjectStatusWithdrawEvent(Integer projectStatusSecond) {
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getWithdrawValueByCode(projectStatusSecond);
public ProjectStatusChangeEvent getProjectStatusWithdrawEvent(Integer status) {
ProjectStatusChangeEvent event = ProjectStatusChangeEvent.getWithdrawValueByCode(status);
if (Objects.isNull(event)) {
throw new BizException("该状态下没有对应的撤回操作!");
}


+ 3
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java ファイルの表示

@@ -47,7 +47,9 @@ public class ProjectHelper {
.eq(req.getIsTemporaryAugment() != null, Project::getIsTemporaryAugment, req.getIsTemporaryAugment())
//状态 阶段 list
.in(CollUtil.isNotEmpty(req.getStageList()),Project::getStage,req.getStageList())
.in(CollUtil.isNotEmpty(req.getStatusList()),Project::getStatus,req.getStatusList());
.in(CollUtil.isNotEmpty(req.getStatusList()),Project::getStatus,req.getStatusList())
//实例code
.in(CollUtil.isNotEmpty(req.getInstCodes()),Project::getInstCode,req.getInstCodes());
return query;
}



+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java ファイルの表示

@@ -64,11 +64,18 @@ public class ProjectLibManage {
item.setProjectYear(w.getProjectYear());
item.setBuildOrg(w.getBuildOrgName());
item.setBizDomain(w.getBizDomain());
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
return item;
});
return PageVo.of(records, total);
}

public List<Project> projectList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
return projectService.list(query);
}

/**
*
* @param projectId 项目详情


+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java ファイルの表示

@@ -3,8 +3,7 @@ package com.ningdatech.pmapi.projectlib.model.req;
import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
@@ -20,6 +19,9 @@ import java.util.List;
* @since 14:35 2023/2/1
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("项目列表查询")
@EqualsAndHashCode(callSuper = true)
public class ProjectListReq extends PagePo {
@@ -76,4 +78,7 @@ public class ProjectListReq extends PagePo {

@ApiModelProperty("项目状态 多个")
private List<Integer> statusList;

@ApiModelProperty("实例code 多个")
private List<String> instCodes;
}

+ 12
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java ファイルの表示

@@ -52,6 +52,18 @@ public class ProjectLibListItemVO {
@ApiModelProperty("业务领域")
private String bizDomain;

@ApiModelProperty("流程状态")
private Integer processStatus;

@ApiModelProperty("实例code")
private String instCode;

@ApiModelProperty("建设单位名称")
private String buildOrgName;

@ApiModelProperty("建设单位统一社会信用代码")
private String buildOrgCode;

private String projectTypeName;

public String getProjectTypeName(){


+ 35
- 28
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java ファイルの表示

@@ -2,7 +2,9 @@ package com.ningdatech.pmapi.scheduler.task;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.StopWatch;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Maps;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
import com.ningdatech.pmapi.scheduler.contants.TaskContant;
@@ -10,9 +12,11 @@ import com.ningdatech.pmapi.sys.contant.RegionConst;
import com.ningdatech.pmapi.sys.model.entity.Region;
import com.ningdatech.pmapi.sys.service.IRegionService;
import com.wflow.bean.dto.WflowModelHistorysDto;
import com.wflow.bean.entity.WflowForms;
import com.wflow.bean.entity.WflowModels;
import com.wflow.workflow.bean.process.ProcessNode;
import com.wflow.workflow.service.ProcessModelService;
import com.wflow.workflow.service.WflowFormsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -21,6 +25,7 @@ import org.springframework.stereotype.Component;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.LocalDateTime;
import java.util.*;

/**
@@ -37,6 +42,8 @@ public class InitProcessTask {

private final ProcessModelService processModelService;

private final WflowFormsService formsService;

@Scheduled(cron = "0 22 17 30 1 ?")
public void doTask() throws UnknownHostException {
if (TaskContant.Host.HOST_ZPF.equals(InetAddress.getLocalHost().getHostName())) {
@@ -52,34 +59,34 @@ public class InitProcessTask {
throw new BizException("丽水地区数据为空 任务结束!");
}

// Map<String,WflowForms> formsMap = Maps.newConcurrentMap();
// //2.首先插入表单默认配置
// for(Region region : regions){
// log.info("当前初始化的是 【{}】 表单信息",region.getName());
//
// WflowForms existsForm = formsService.getOne(Wrappers.lambdaQuery(WflowForms.class)
// .eq(WflowForms::getRegionCode, region.getRegionCode())
// .last("limit 1"));
// if(Objects.nonNull(existsForm)){
// log.info("当前区域 【{}】 已经有表单数据 不需要初始化",region.getName());
// formsMap.put(existsForm.getRegionCode(),existsForm);
// continue;
// }
//
// WflowForms wflowForms = new WflowForms();
// wflowForms.setFormId("fm" + IdUtil.objectId());
// wflowForms.setCreateOn(LocalDateTime.now());
// wflowForms.setUpdateOn(LocalDateTime.now());
// wflowForms.setFormName(TaskContant.Wflow.DEFAULT_FORM_NAME);
// wflowForms.setRegionCode(region.getRegionCode());
// wflowForms.setRegionName(region.getName());
// if(formsService.save(wflowForms)){
// log.info("当前区域 【{}】 表单数据已经保存成功",region.getName());
// formsMap.put(wflowForms.getRegionCode(),wflowForms);
// }else{
// log.info("当前区域 【{}】 表单数据已经保存失败",region.getName());
// }
// }
Map<String, WflowForms> formsMap = Maps.newConcurrentMap();
//2.首先插入表单默认配置
for(Region region : regions){
log.info("当前初始化的是 【{}】 表单信息",region.getName());
WflowForms existsForm = formsService.getOne(Wrappers.lambdaQuery(WflowForms.class)
.eq(WflowForms::getRegionCode, region.getRegionCode())
.last("limit 1"));
if(Objects.nonNull(existsForm)){
log.info("当前区域 【{}】 已经有表单数据 不需要初始化",region.getName());
formsMap.put(existsForm.getRegionCode(),existsForm);
continue;
}
WflowForms wflowForms = new WflowForms();
wflowForms.setFormId("fm" + IdUtil.objectId());
wflowForms.setCreateOn(LocalDateTime.now());
wflowForms.setUpdateOn(LocalDateTime.now());
wflowForms.setFormName(TaskContant.Wflow.DEFAULT_FORM_NAME);
wflowForms.setRegionCode(region.getRegionCode());
wflowForms.setRegionName(region.getName());
if(formsService.save(wflowForms)){
log.info("当前区域 【{}】 表单数据已经保存成功",region.getName());
formsMap.put(wflowForms.getRegionCode(),wflowForms);
}else{
log.info("当前区域 【{}】 表单数据已经保存失败",region.getName());
}
}

//3.接着插入流程默认配置
for(Region region : regions){


+ 50
- 37
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java ファイルの表示

@@ -4,17 +4,14 @@ package com.ningdatech.pmapi.todocenter.controller;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedExportDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedExportReq;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.ApiResponse;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedDTO;
import com.ningdatech.pmapi.todocenter.model.dto.res.ResToBeProcessedDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.dto.vo.ResToBeProcessedVO;

import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
@@ -40,10 +37,12 @@ public class TodoCenterController {
* @param param
* @return
*/
@GetMapping("/query-todo-list")
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryPendingProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryPendingProjectList(param);
return ApiResponse.ofSuccess(result);
@GetMapping("/todo-list/{isTemporaryAugment}")
public PageVo<ResToBeProcessedVO> todoList(@ModelAttribute ToBeProcessedReq param,
@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
PageVo<ResToBeProcessedVO> result = todoCenterManage.todoProjectList(param);
return result;
}

/**
@@ -53,9 +52,11 @@ public class TodoCenterController {
* @param response
* @return void
*/
@PostMapping("/exportPending")
public void exportPendingProjectList(@Valid @RequestBody ReqToBeProcessedExportDTO param, HttpServletResponse response){
todoCenterManage.exportPendingProjectList(response,param);
@PostMapping("/todo-list/export/{isTemporaryAugment}")
public void exportPendingProjectList(@Valid @RequestBody ToBeProcessedExportReq param,
HttpServletResponse response,@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
todoCenterManage.exportTodoList(response,param);
}

/**
@@ -64,9 +65,9 @@ public class TodoCenterController {
* @return 流程进度及表单详情
*/
@GetMapping("/progress/{instanceId}/{projectId}")
public ApiResponse<ProcessProgressDetailVo> getProcessDetail(@PathVariable String instanceId,
public ProcessProgressDetailVo getProcessDetail(@PathVariable String instanceId,
@PathVariable Long projectId) {
return ApiResponse.ofSuccess(todoCenterManage.getProcessDetail(instanceId, projectId));
return todoCenterManage.getProcessDetail(instanceId, projectId);
}

/**
@@ -75,9 +76,9 @@ public class TodoCenterController {
* @return 操作结果
*/
@PostMapping("/handler")
public ApiResponse<Object> handler(@Valid @RequestBody ReqProcessHandlerDTO param) {
public Object handler(@Valid @RequestBody ReqProcessHandlerDTO param) {
todoCenterManage.handler(param);
return ApiResponse.ofSuccess();
return "操作成功";
}

/**
@@ -85,10 +86,12 @@ public class TodoCenterController {
* @param param
* @return
*/
@GetMapping("/query-do-list")
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryHandledProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryHandledProjectList(param);
return ApiResponse.ofSuccess(result);
@GetMapping("/ido-list/{isTemporaryAugment}")
public PageVo<ResToBeProcessedVO> idoList(@ModelAttribute ToBeProcessedReq param,
@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
PageVo<ResToBeProcessedVO> result = todoCenterManage.idoList(param);
return result;
}
/**
* 待办中心-我已处理项目列表导出
@@ -97,9 +100,11 @@ public class TodoCenterController {
* @param response
* @return void
*/
@PostMapping("/exportHandled")
public void exportHandledProjectList(@Valid @RequestBody ReqToBeProcessedExportDTO param, HttpServletResponse response){
todoCenterManage.exportHandledProjectList(response,param);
@PostMapping("/ido-list/export/{isTemporaryAugment}")
public void exportHandledProjectList(@RequestBody ToBeProcessedExportReq param,
HttpServletResponse response,@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
todoCenterManage.idoExport(response,param);
}

/**
@@ -107,10 +112,12 @@ public class TodoCenterController {
* @param param
* @return
*/
@GetMapping("/query-mySubmitted-list")
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryMySubmittedProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryMySubmittedProjectList(param);
return ApiResponse.ofSuccess(result);
@GetMapping("/my-submitted-list/{isTemporaryAugment}")
public PageVo<ResToBeProcessedVO> mySubmittedList(@ModelAttribute ToBeProcessedReq param,
@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
PageVo<ResToBeProcessedVO> result = todoCenterManage.mySubmittedList(param);
return result;
}

/**
@@ -120,9 +127,11 @@ public class TodoCenterController {
* @param response
* @return void
*/
@PostMapping("/exportMySubmitted")
public void exportMySubmittedProjectList(@Valid @RequestBody ReqToBeProcessedExportDTO param, HttpServletResponse response){
todoCenterManage.exportMySubmittedProjectList(response,param);
@PostMapping("/my-submitted-list/export/{isTemporaryAugment}")
public void exportMySubmittedList(@RequestBody ToBeProcessedExportReq param,
HttpServletResponse response,@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
todoCenterManage.exportMySubmittedList(response,param);
}

/**
@@ -130,10 +139,12 @@ public class TodoCenterController {
* @param param
* @return
*/
@GetMapping("/query-CcMe-list")
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryCcMeProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryCcMeProjectList(param);
return ApiResponse.ofSuccess(result);
@GetMapping("/ccme-list/{isTemporaryAugment}")
public PageVo<ResToBeProcessedVO> ccmeList(@Valid @ModelAttribute ToBeProcessedReq param,
@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
PageVo<ResToBeProcessedVO> result = todoCenterManage.ccmeList(param);
return result;
}

/**
@@ -143,8 +154,10 @@ public class TodoCenterController {
* @param response
* @return void
*/
@PostMapping("/exportCcMe")
public void exportCcMeProjectList(@Valid @RequestBody ReqToBeProcessedExportDTO param, HttpServletResponse response){
@PostMapping("/ccme-list/export/{isTemporaryAugment}")
public void exportCcMeProjectList(@Valid @RequestBody ToBeProcessedExportReq param, HttpServletResponse response,
@PathVariable Integer isTemporaryAugment){
param.setIsTemporaryAugment(isTemporaryAugment);
todoCenterManage.exportCcMeProjectList(response,param);
}
}

+ 96
- 251
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java ファイルの表示

@@ -4,7 +4,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
@@ -20,7 +19,10 @@ 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.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment;
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode;
@@ -33,9 +35,9 @@ import com.ningdatech.pmapi.todocenter.enumeration.ProcessStatusEnum;
import com.ningdatech.pmapi.todocenter.extension.cmd.BackToHisApprovalNodeCmd;
import com.ningdatech.pmapi.todocenter.extension.cmd.SaveCommentCmd;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedDTO;
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqToBeProcessedExportDTO;
import com.ningdatech.pmapi.todocenter.model.dto.res.ResToBeProcessedDTO;
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;

import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.service.IUserInfoService;
@@ -46,7 +48,6 @@ import com.wflow.bean.entity.WflowModels;
import com.wflow.exception.BusinessException;
import com.wflow.mapper.WflowCcTasksMapper;
import com.wflow.mapper.WflowModelHistorysMapper;
import com.wflow.service.OrgRepositoryService;
import com.wflow.utils.CodeUtil;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.ProcessNode;
@@ -58,13 +59,12 @@ import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo;
import com.wflow.workflow.config.WflowGlobalVarDef;
import com.wflow.workflow.enums.ProcessHandlerEnum;
import com.wflow.workflow.service.*;
import com.wflow.workflow.service.FormService;
import com.wflow.workflow.service.ProcessModelService;
import com.wflow.workflow.service.ProcessNodeCatchService;
import com.wflow.workflow.service.UserDeptOrLeaderService;
import com.wflow.workflow.utils.Executor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists;
import org.assertj.core.util.Maps;
import org.flowable.bpmn.model.*;
import org.flowable.engine.*;
@@ -93,8 +93,8 @@ import static cn.hutool.core.collection.CollUtil.isNotEmpty;
import static com.ningdatech.pmapi.todocenter.constant.WorkNotice.*;

/**
* @author CMM
* @since 2023/01/12 16:09
* @author ZPF
* @since 2023/02/19 16:09
*/
@Component
@RequiredArgsConstructor
@@ -102,19 +102,21 @@ import static com.ningdatech.pmapi.todocenter.constant.WorkNotice.*;
public class TodoCenterManage {

private final TaskService taskService;

private final ProcessTaskService processTaskService;
private final RepositoryService repositoryService;
private final RuntimeService runtimeService;
private final UserDeptOrLeaderService userDeptOrLeaderService;
private final FormService formService;
private final ManagementService managementService;
private final HistoryService historyService;
private final WflowModelHistorysMapper modelHistorysMapper;
private final ProcessNodeCatchService nodeCatchService;
private final OrgRepositoryService orgRepositoryService;
private final WflowCcTasksMapper ccTasksMapper;
private final ProcessModelService processModelService;
private final IUserInfoService userInfoService;
private final IProjectService projectService;

private final ProjectLibManage projectLibManage;
private final StateMachineUtils stateMachineUtils;
private final ZwddClient zwddClient;
private final IDingEmployeeInfoService dingEmployeeInfoService;
@@ -124,92 +126,37 @@ public class TodoCenterManage {
* 待办中心待我处理项目列表查询
*
* @param param
* @return com.ningdatech.basic.model.PageVo<com.ningdatech.pmapi.todocenter.model.dto.res.ResToBeProcessedDTO>
* @author CMM
* @since 2023/02/01
* @author zpf
* @since 2023/02/18
*/
public PageVo<ResToBeProcessedDTO> queryPendingProjectList(ReqToBeProcessedDTO param) {
public PageVo<ResToBeProcessedVO> todoProjectList(ToBeProcessedReq param) {
// 获取登录用户ID
// long userId = LoginUserUtil.getUserId();
String userId = param.getUserId();
//因为要解耦 不能把项目和工作流一起查
//1.先查出用户工作流
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(param.getProcessDefId(),userId);
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList());

//2.再分页查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setInstCodes(instCodes);
BeanUtils.copyProperties(param,projectListReq);
PageVo<ProjectLibListItemVO> projectPage = projectLibManage.projectLibList(projectListReq);

if(0L == projectPage.getTotal()){
return PageVo.empty();
}

// Long userId = 381496L;
Long userId = 6418616L;
// Long userId = 61769799L;
TaskQuery taskQuery = taskService.createTaskQuery();
taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc();
List<Task> taskList = taskQuery.list();
List<Project> results = getToBeProcessedProjects(param, taskList);
// 总数
int total = results.size();
// 获取传入的分页参数
Integer pageNumber = param.getPageNumber();
Integer pageSize = param.getPageSize();
List<Project> records = results.stream()
.skip((long) (pageNumber - 1) * pageSize)
.limit(pageSize)
.collect(Collectors.toList());

Map<String, Task> taskMap = taskList.stream()
.collect(Collectors.toMap(Task::getProcessInstanceId, t -> t));
Set<String> processInsIds = results.stream()
.map(Project::getInstCode)
.collect(Collectors.toSet());

Set<String> staterUsers = new HashSet<>();
// 将申报项目待登录用户处理的流程实例一次性取出来,减少查询次数
Map<String, HistoricProcessInstance> instanceMap = isNotEmpty(taskList)
? historyService.createHistoricProcessInstanceQuery()
.processInstanceIds(processInsIds).list().stream()
.collect(Collectors.toMap(HistoricProcessInstance::getId, v -> v))
: new HashMap<>();

List<ResToBeProcessedDTO> resVos = records.stream().map(d -> {
ResToBeProcessedDTO res = new ResToBeProcessedDTO();
List<ResToBeProcessedVO> resVos = projectPage.getRecords().stream().map(d -> {
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
res.setProjectId(d.getId());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
LocalDateTime processLaunchTime = d.getCreateOn();
String format = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm");
LocalDateTime launchTime = LocalDateTime.parse(format, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
res.setProcessLaunchTime(launchTime);

// 从待办任务列表中取出当前登录用户及项目实例对应的任务
Task task = taskMap.get(d.getInstCode());
HistoricProcessInstance instance = instanceMap.get(task.getProcessInstanceId());

// 从缓存取
staterUsers.add(String.valueOf(instance.getStartUserId()));
ProcessTaskVo processTaskVo = ProcessTaskVo.builder()
.taskId(task.getId())
.taskName(task.getName())
.taskDefKey(task.getTaskDefinitionKey())
.processDefId(task.getProcessDefinitionId())
.executionId(task.getExecutionId())
.nodeId(task.getTaskDefinitionKey())
.deployId(instance.getDeploymentId())
.processDefName(instance.getProcessDefinitionName())
.version(instance.getProcessDefinitionVersion())
.instanceId(task.getProcessInstanceId())
.ownerId(instance.getStartUserId())
.createTime(instance.getStartTime())
.taskCreateTime(task.getCreateTime())
.build();
res.setProcessTaskInfo(processTaskVo);
res.setProcessLaunchTime(d.getCreateOn());
return res;
}).collect(Collectors.toList());
if (isEmpty(resVos)) {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
if (isNotEmpty(staterUsers)) {
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream()
// .peek(v -> v.getProcessTaskInfo().setStartUser(userMap.get(Long.valueOf(v.getProcessTaskInfo().getOwnerId()))))
// .collect(Collectors.toList());
}
// return PageVo.of(result, total);
return PageVo.of(resVos, total);
return PageVo.of(resVos, projectPage.getTotal());
}

/**
@@ -221,41 +168,39 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/01
*/
public void exportPendingProjectList(HttpServletResponse response, ReqToBeProcessedExportDTO param) {
param.setPageNumber(1);
param.setPageSize(10000);
public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) {
// 获取登录用户ID
// long userId = LoginUserUtil.getUserId();
String userId = param.getUserId();
//因为要解耦 不能把项目和工作流一起查
//1.先查出用户工作流
List<ProcessTaskVo> userTodoList = processTaskService.getUserTodoList(param.getProcessDefId(),userId);
List<String> instCodes = userTodoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList());

//2.再查询项目信息
ProjectListReq projectListReq = new ProjectListReq();
projectListReq.setInstCodes(instCodes);
BeanUtils.copyProperties(param,projectListReq);
List<Project> projects = projectLibManage.projectList(projectListReq);

Long userId = 381496L;
// Long userId = 6418616L;
TaskQuery taskQuery = taskService.createTaskQuery();
taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc();
List<Task> taskList = taskQuery.list();
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO();
BeanUtils.copyProperties(param, reqToBeProcessedDTO);
List<Project> records = getToBeProcessedProjects(reqToBeProcessedDTO, taskList);
ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_待我处理_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_待我处理_非增补项目列表";
}
excelExportWriter.setFileName(fileName);

List<String> sheetsNames = new ArrayList<>();
sheetsNames.add(fileName);
List<String> sheetsNames = Lists.newArrayList(fileName);

// 表体行数据集合
List<List<String>> rowList = new ArrayList<>();
List<List<String>> rowList = Lists.newArrayList();
// 表体列数据集合
List<ExportOptionEnum> columnList = param.getExportOptionList();
for (ExportOptionEnum column : columnList) {
List<String> columnValues = new ArrayList<>();
List<String> columnValues = Lists.newArrayList();
columnValues.add(column.getDesc());
records.stream().sorted(Comparator.comparing(Project::getId)).forEach(record -> {
projects.stream().sorted(Comparator.comparing(Project::getId)).forEach(record -> {
String s = JSON.toJSONString(record);
JSONObject jsonObject = JSON.parseObject(s);
String columnValue = String.valueOf(jsonObject.get(column.toString()));
@@ -264,7 +209,7 @@ public class TodoCenterManage {
rowList.add(columnValues);
}
// sheet列表集合
List<List<List<String>>> sheets = new ArrayList<>();
List<List<List<String>>> sheets = Lists.newArrayList();
sheets.add(rowList);
excelExportWriter.setHeads(sheets);
excelExportWriter.setDatas(rowList);
@@ -275,34 +220,6 @@ public class TodoCenterManage {
}

/**
* 获取申报项目列表中待登录用户处理的项目列表
*
* @param param
* @param taskList
* @return java.util.List<com.ningdatech.pmapi.projectlib.model.entity.Project>
* @author CMM
* @since 2023/02/11
*/
private List<Project> getToBeProcessedProjects(ReqToBeProcessedDTO param, List<Task> taskList) {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class);
wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName())
.like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName())
.eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear())
.eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement())
.ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime,
param.getProcessLaunchStartTime())
.le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime());
List<Project> results = projectService.list(wrapper);

List<String> taskProcessInsIds = taskList.stream().map(Task::getProcessInstanceId).collect(Collectors.toList());


// 过滤申报项目中待登录用户审核的项目
return results.stream().filter(w -> taskProcessInsIds.contains(w.getInstCode()))
.collect(Collectors.toList());
}

/**
* 流程处理相关操作
*
* @param param
@@ -411,9 +328,9 @@ public class TodoCenterManage {
*/
private void updateRejectProjectStatus(Long userId, Project declaredProject) {
// 获取当前流程项目状态
Integer projectStatusSecond = declaredProject.getStatus();
Integer status = declaredProject.getStatus();
// 根据当前状态获取对应的通过事件
ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusRejectEvent(projectStatusSecond);
ProjectStatusChangeEvent event = stateMachineUtils.getProjectStatusRejectEvent(status);
try {
stateMachineUtils.execute(declaredProject, event);
declaredProject.setUpdateOn(LocalDateTime.now());
@@ -1122,11 +1039,10 @@ public class TodoCenterManage {
* 待办中心我已处理项目列表查询
*
* @param param
* @return com.ningdatech.basic.model.PageVo<com.ningdatech.pmapi.todocenter.model.dto.res.ResToBeProcessedDTO>
* @author CMM
* @since 2023/02/03
*/
public PageVo<ResToBeProcessedDTO> queryHandledProjectList(ReqToBeProcessedDTO param) {
public PageVo<ResToBeProcessedVO> idoList(ToBeProcessedReq param) {
// 获取登录用户ID
// long userId = LoginUserUtil.getUserId();

@@ -1145,7 +1061,8 @@ public class TodoCenterManage {
Set<String> taskProcessInsIds = taskInstances.stream()
.map(HistoricTaskInstance::getProcessInstanceId)
.collect(Collectors.toSet());
List<Project> results = getHandledProjects(param, taskProcessInsIds);
// List<Project> results = getHandledProjects(param, taskProcessInsIds);
List<Project> results = Lists.newArrayList();

// 总数
int total = results.size();
@@ -1169,9 +1086,9 @@ public class TodoCenterManage {
: new HashMap<>();
Set<String> staterUsers = new HashSet<>();

List<ResToBeProcessedDTO> resVos = records.stream().map(d -> {
List<ResToBeProcessedVO> resVos = records.stream().map(d -> {

ResToBeProcessedDTO res = new ResToBeProcessedDTO();
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
res.setProjectId(d.getId());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
@@ -1213,7 +1130,7 @@ public class TodoCenterManage {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
List<ResToBeProcessedVO> result = null;
if (isNotEmpty(staterUsers)) {
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream().peek(v -> v.getProcessTaskInfo()
@@ -1225,32 +1142,6 @@ public class TodoCenterManage {
}

/**
* 获取申报项目列表中登录用户已处理项目列表
*
* @param param
* @param taskProcessInsIds
* @return java.util.List<com.ningdatech.pmapi.projectlib.model.entity.Project>
* @author CMM
* @since 2023/02/11
*/
private List<Project> getHandledProjects(ReqToBeProcessedDTO param, Set<String> taskProcessInsIds) {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class);
wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName())
.like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName())
.eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear())
.eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement())
.ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime,
param.getProcessLaunchStartTime())
.le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime());
List<Project> results = projectService.list(wrapper);

// 过滤申报项目中登录用户已审核的项目
return results.stream()
.filter(w -> taskProcessInsIds.contains(w.getInstCode()))
.collect(Collectors.toList());
}

/**
* 导出我已处理项目列表
*
* @param response 返回数据流
@@ -1259,7 +1150,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/06
*/
public void exportHandledProjectList(HttpServletResponse response, ReqToBeProcessedExportDTO param) {
public void idoExport(HttpServletResponse response, ToBeProcessedExportReq param) {
param.setPageNumber(1);
param.setPageSize(10000);
// 获取登录用户ID
@@ -1277,16 +1168,17 @@ public class TodoCenterManage {
Set<String> taskProcessInsIds = taskInstances.stream()
.map(HistoricTaskInstance::getProcessInstanceId)
.collect(Collectors.toSet());
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO();
BeanUtils.copyProperties(param, reqToBeProcessedDTO);
List<Project> records = getHandledProjects(reqToBeProcessedDTO, taskProcessInsIds);
ToBeProcessedReq toBeProcessedReq = new ToBeProcessedReq();
BeanUtils.copyProperties(param, toBeProcessedReq);
// List<Project> records = getHandledProjects(toBeProcessedReq, taskProcessInsIds);
List<Project> records = Lists.newArrayList();

ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_我已处理_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_我已处理_非增补项目列表";
}
excelExportWriter.setFileName(fileName);
@@ -1329,7 +1221,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/06
*/
public PageVo<ResToBeProcessedDTO> queryMySubmittedProjectList(ReqToBeProcessedDTO param) {
public PageVo<ResToBeProcessedVO> mySubmittedList(ToBeProcessedReq param) {

// Long startUserId = LoginUserUtil.getUserId();
Long startUserId = 381496L;
@@ -1340,7 +1232,8 @@ public class TodoCenterManage {
Set<String> historicProcessInstanceIds = historicProcessInstances.stream()
.map(HistoricProcessInstance::getId).collect(Collectors.toSet());

List<Project> results = getMySubmittedProjects(param, historicProcessInstanceIds);
// List<Project> results = getMySubmittedProjects(param, historicProcessInstanceIds);
List<Project> results = Lists.newArrayList();

// 总数
int total = results.size();
@@ -1363,9 +1256,9 @@ public class TodoCenterManage {

Set<String> staterUsers = new HashSet<>();

List<ResToBeProcessedDTO> resVos =
List<ResToBeProcessedVO> resVos =
records.stream().map(d -> {
ResToBeProcessedDTO res = new ResToBeProcessedDTO();
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
res.setProjectId(d.getId());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
@@ -1385,7 +1278,7 @@ public class TodoCenterManage {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
List<ResToBeProcessedVO> result = null;
if (isNotEmpty(staterUsers)) {
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream()
@@ -1397,32 +1290,6 @@ public class TodoCenterManage {
}

/**
* 获取申报项目列表中当前登录用户发起的项目列表
*
* @param param
* @param historicProcessInstanceIds
* @return java.util.List<com.ningdatech.pmapi.projectlib.model.entity.Project>
* @author CMM
* @since 2023/02/11
*/
private List<Project> getMySubmittedProjects(ReqToBeProcessedDTO param, Set<String> historicProcessInstanceIds) {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class);
wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName())
.like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName())
.eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear())
.eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement())
.ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime,
param.getProcessLaunchStartTime())
.le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime());
List<Project> results = projectService.list(wrapper);

// 筛选出申报项目中我发起的项目
return results.stream()
.filter(d -> historicProcessInstanceIds.contains(d.getInstCode()))
.collect(Collectors.toList());
}

/**
* 获取流程实例信息
*
* @param ist 流程实例
@@ -1489,7 +1356,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/11
*/
public void exportMySubmittedProjectList(HttpServletResponse response, ReqToBeProcessedExportDTO param) {
public void exportMySubmittedList(HttpServletResponse response, ToBeProcessedExportReq param) {

param.setPageNumber(1);
param.setPageSize(10000);
@@ -1504,16 +1371,17 @@ public class TodoCenterManage {
Set<String> historicProcessInstanceIds = historicProcessInstances.stream()
.map(h -> h.getId())
.collect(Collectors.toSet());
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO();
BeanUtils.copyProperties(param, reqToBeProcessedDTO);
List<Project> records = getMySubmittedProjects(reqToBeProcessedDTO, historicProcessInstanceIds);
ToBeProcessedReq toBeProcessedReq = new ToBeProcessedReq();
BeanUtils.copyProperties(param, toBeProcessedReq);
// List<Project> records = getMySubmittedProjects(toBeProcessedReq, historicProcessInstanceIds);
List<Project> records = Lists.newArrayList();

ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_我发起的_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_我发起的_非增补项目列表";
}
excelExportWriter.setFileName(fileName);
@@ -1556,7 +1424,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/11
*/
public PageVo<ResToBeProcessedDTO> queryCcMeProjectList(ReqToBeProcessedDTO param) {
public PageVo<ResToBeProcessedVO> ccmeList(ToBeProcessedReq param) {
// 获取当前登录用户ID
// Long userId = LoginUserUtil.getUserId();

@@ -1567,7 +1435,8 @@ public class TodoCenterManage {
.map(WflowCcTasks::getInstanceId)
.collect(Collectors.toList());

List<Project> results = getCcMeProjects(param, processInsIds);
// List<Project> results = getCcMeProjects(param, processInsIds);
List<Project> results = Lists.newArrayList();

// 总数
int total = results.size();
@@ -1586,9 +1455,9 @@ public class TodoCenterManage {
.processInstanceIds(ccTasks.stream().map(WflowCcTasks::getInstanceId).collect(Collectors.toSet()))
.list().stream().collect(Collectors.toMap(HistoricProcessInstance::getId, v -> v))
: new HashMap<>();
List<ResToBeProcessedDTO> resVos =
List<ResToBeProcessedVO> resVos =
records.stream().map(d -> {
ResToBeProcessedDTO res = new ResToBeProcessedDTO();
ResToBeProcessedVO res = new ResToBeProcessedVO();
BeanUtils.copyProperties(d, res);
res.setProjectId(d.getId());
res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus()));
@@ -1607,7 +1476,7 @@ public class TodoCenterManage {
return PageVo.empty();
}
// 取用户信息,减少数据库查询,一次构建
List<ResToBeProcessedDTO> result = null;
List<ResToBeProcessedVO> result = null;
if (isNotEmpty(staterUsers)) {
//Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(staterUsers);
//result = resVos.stream()
@@ -1619,31 +1488,6 @@ public class TodoCenterManage {
}

/**
* 获取申报项目表中抄送当前登录用户的项目列表
*
* @param param
* @param processInsIds
* @return java.util.List<com.ningdatech.pmapi.projectlib.model.entity.Project>
* @author CMM
* @since 2023/02/11
*/
private List<Project> getCcMeProjects(ReqToBeProcessedDTO param, List<String> processInsIds) {
LambdaQueryWrapper<Project> wrapper = Wrappers.lambdaQuery(Project.class);
wrapper.like(StrUtil.isNotBlank(param.getProjectName()), Project::getProjectName, param.getProjectName())
.like(StrUtil.isNotBlank(param.getBuildUnitName()), Project::getBuildOrgName, param.getBuildUnitName())
.eq(Objects.nonNull(param.getProjectYear()), Project::getProjectYear, param.getProjectYear())
.eq(Objects.nonNull(param.getIsSupplement()), Project::getIsTemporaryAugment, param.getIsSupplement())
.ge(Objects.nonNull(param.getProcessLaunchStartTime()), Project::getBeginTime,
param.getProcessLaunchStartTime())
.le(Objects.nonNull(param.getProcessLaunchEndTime()), Project::getEndTime, param.getProcessLaunchEndTime());
List<Project> results = projectService.list(wrapper);

return results.stream()
.filter(d -> processInsIds.contains(d.getInstCode()))
.collect(Collectors.toList());
}

/**
* 待办中心-抄送我的项目列表导出
*
* @param response
@@ -1652,7 +1496,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/11
*/
public void exportCcMeProjectList(HttpServletResponse response, ReqToBeProcessedExportDTO param) {
public void exportCcMeProjectList(HttpServletResponse response, ToBeProcessedExportReq param) {

param.setPageNumber(1);
param.setPageSize(10000);
@@ -1666,16 +1510,17 @@ public class TodoCenterManage {
.map(WflowCcTasks::getInstanceId)
.collect(Collectors.toList());

ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO();
BeanUtils.copyProperties(param, reqToBeProcessedDTO);
List<Project> records = getCcMeProjects(reqToBeProcessedDTO, processInsIds);
ToBeProcessedReq toBeProcessedReq = new ToBeProcessedReq();
BeanUtils.copyProperties(param, toBeProcessedReq);
// List<Project> records = getCcMeProjects(toBeProcessedReq, processInsIds);
List<Project> records = Lists.newArrayList();

ExcelExportWriter excelExportWriter = new ExcelExportWriter();

String fileName = null;
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_抄送我的_增补项目列表";
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())) {
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) {
fileName = "待办中心_抄送我的_非增补项目列表";
}
excelExportWriter.setFileName(fileName);


pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResCcMeExportDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResCcMeExportDTO.java ファイルの表示

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

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

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResHandledExportDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResHandledExportDTO.java ファイルの表示

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

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

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResMySubmittedExportDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/dto/ResMySubmittedExportDTO.java ファイルの表示

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

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

+ 0
- 52
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedExportDTO.java ファイルの表示

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

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

import javax.validation.constraints.NotNull;

import com.ningdatech.basic.model.PagePo;
import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum;

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

/**
* 待办中心-导出查询实体信息
*
* @author CMM
* @since 2023/01/12 16:01
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReqToBeProcessedExportDTO extends PagePo implements Serializable {
private static final long serialVersionUID = 1L;

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

@ApiModelProperty("申报单位名称")
private String buildUnitName;

@ApiModelProperty("预算年度")
private Integer projectYear;

@ApiModelProperty("流程发起开始时间")
private LocalDateTime processLaunchStartTime;

@ApiModelProperty("流程发起结束时间")
private LocalDateTime processLaunchEndTime;

@ApiModelProperty(value = "是否增补项目",allowableValues = "非增补项目 0,增补项目 1")
@NotNull(message = "是否增补字段不能为空!")
private Integer isSupplement;

@ApiModelProperty("导出选项")
@NotNull(message = "导出选项不能为空")
private List<ExportOptionEnum> exportOptionList;

}

+ 27
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ToBeProcessedExportReq.java ファイルの表示

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

import java.util.List;

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

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

/**
* 待办中心-导出查询实体信息
*
* @author zpf
* @since 2023/02/18 16:01
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ToBeProcessedExportReq extends ToBeProcessedReq {

@ApiModelProperty("导出选项")
private List<ExportOptionEnum> exportOptionList;

}

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ToBeProcessedReq.java ファイルの表示

@@ -2,46 +2,52 @@ package com.ningdatech.pmapi.todocenter.model.dto.req;

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

import com.ningdatech.basic.model.PagePo;

import com.ningdatech.pmapi.common.enumeration.ExportOptionEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;

/**
* 待办中心-列表查询实体信息
*
* @author CMM
* @since 2023/01/12 16:01
* @author zpf
* @since 2023/02/19 16:01
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReqToBeProcessedDTO extends PagePo implements Serializable {
public class ToBeProcessedReq extends PagePo implements Serializable {
private static final long serialVersionUID = 1L;

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

@ApiModelProperty("申报单位名称")
private String buildUnitName;
private String buildOrgName;

@ApiModelProperty("预算年度")
private Integer projectYear;

@ApiModelProperty("流程发起开始时间")
private LocalDateTime processLaunchStartTime;
@ApiModelProperty("创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createOnMin;

@ApiModelProperty("流程发起结束时间")
private LocalDateTime processLaunchEndTime;
@ApiModelProperty("创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createOnMax;

@ApiModelProperty(value = "是否增补项目",allowableValues = "非增补项目 0,增补项目 1")
@NotNull(message = "是否增补字段不能为空!")
private Integer isSupplement;
private Integer isTemporaryAugment;

//因为测试 暂时传参 传下userId
private String userId;

@ApiModelProperty("流程配置ID")
private String processDefId;
}

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/vo/ResToBeProcessedVO.java ファイルの表示

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

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.vo.ProcessInstanceVo;
import com.wflow.workflow.bean.vo.ProcessTaskVo;
import io.swagger.annotations.ApiModelProperty;
@@ -24,23 +23,23 @@ import java.time.LocalDateTime;
@NoArgsConstructor
@AllArgsConstructor
@ExcelIgnoreUnannotated
public class ResToBeProcessedDTO implements Serializable {
public class ResToBeProcessedVO implements Serializable {
private static final long serialVersionUID = 1L;

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

@ApiModelProperty("流程实例编号")
private String instanceCode;
private String instCode;

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

@ApiModelProperty("申报单位ID")
private String buildUnitId;
@ApiModelProperty("建设单位名称")
private String buildOrgName;

@ApiModelProperty("申报单位名称")
private String buildUnitName;
@ApiModelProperty("建设单位统一社会信用代码")
private String buildOrgCode;

@ApiModelProperty("申报金额")
private BigDecimal declareAmount;

読み込み中…
キャンセル
保存