Explorar el Código

开启项目申报

master
WendyYang hace 1 año
padre
commit
d6e78e3f0a
Se han modificado 15 ficheros con 88 adiciones y 35 borrados
  1. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  6. +10
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java
  7. +24
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  8. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/StartProjectDeclareReq.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java
  12. +0
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  13. +8
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/IsAppendProjectEnum.java
  14. +12
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/ProcessStatusEnum.java
  15. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java Ver fichero

@@ -3,7 +3,6 @@ package com.ningdatech.pmapi.common.config;
import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient;
import com.ningdatech.pmapi.common.util.SpringContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;


pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java → pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java Ver fichero

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.common.enums;
package com.ningdatech.pmapi.common.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;

pmapi/src/main/java/com/ningdatech/pmapi/common/utils/BizUtils.java → pmapi/src/main/java/com/ningdatech/pmapi/common/util/BizUtils.java Ver fichero

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.common.utils;
package com.ningdatech.pmapi.common.util;

import cn.hutool.core.util.StrUtil;
import com.ningdatech.basic.util.StrPool;

pmapi/src/main/java/com/ningdatech/pmapi/common/utils/TreeUtil.java → pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java Ver fichero

@@ -1,4 +1,4 @@
package com.ningdatech.pmapi.common.utils;
package com.ningdatech.pmapi.common.util;


import cn.hutool.core.collection.CollUtil;

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Ver fichero

@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.common.enums.ProjectProessStageEnum;
import com.ningdatech.pmapi.common.enumeration.ProjectProessStageEnum;
import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft;
import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto;
import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto;


+ 10
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java Ver fichero

@@ -3,13 +3,14 @@ package com.ningdatech.pmapi.projectlib.controller;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;

/**
* <p>
@@ -33,4 +34,10 @@ public class AnnualPlanController {
return annualPlanLibManage.annulPlanLibList(req);
}

@PostMapping("/startProjectDeclared")
@ApiOperation("开启项目申报")
public void startProjectDeclared(@RequestBody @Valid StartProjectDeclareReq req) {
annualPlanLibManage.startProjectDeclared(req);
}

}

+ 24
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java Ver fichero

@@ -2,16 +2,21 @@ package com.ningdatech.pmapi.projectlib.manage;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Arrays;
@@ -32,6 +37,7 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;
public class AnnualPlanLibManage {

private final IProjectService projectService;
private final StateMachineUtils stateMachine;

/**
* 年度计划查询状态
@@ -57,6 +63,7 @@ public class AnnualPlanLibManage {

public PageVo<AnnualPlanListItemVO> annulPlanLibList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
query.eq(Project::getIsTemporaryAugment, 0);
query.orderByDesc(Project::getAnnualPlanAddTime);
query.in(Project::getStatus, CollUtils.fieldList(ANNUAL_PLAN_LIST_STATUS, ProjectStatusEnum::getCode));
Page<Project> page = projectService.page(req.page(), query);
@@ -82,4 +89,21 @@ public class AnnualPlanLibManage {
return result;
}

@Transactional(rollbackFor = Exception.class)
public void startProjectDeclared(StartProjectDeclareReq req) {
List<Project> projects = projectService.listByIds(req.getProjectIds());
projects.forEach(w -> {
if (!IN_THE_ANNUAL_PLAN.eq(w.getStatus())) {
throw BizException.wrap("开启方案申报失败");
}
});
projects.forEach(project -> {
try {
stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE);
} catch (Exception e) {
throw new BizException("开启方案申报失败");
}
});
}

}

+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/StartProjectDeclareReq.java Ver fichero

@@ -0,0 +1,25 @@
package com.ningdatech.pmapi.projectlib.model.req;

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

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
* <p>
* StartProjectDeclareReq
* </p>
*
* @author WendyYang
* @since 17:47 2023/2/11
*/
@Data
public class StartProjectDeclareReq {

@ApiModelProperty("项目ID")
@NotEmpty(message = "项目ID不能为空")
private List<Long> projectIds;


}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/MenuController.java Ver fichero

@@ -7,7 +7,7 @@ import com.ningdatech.basic.auth.AbstractLoginUserUtil;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.common.model.entity.MenuTreeEntity;
import com.ningdatech.pmapi.common.utils.TreeUtil;
import com.ningdatech.pmapi.common.util.TreeUtil;
import com.ningdatech.pmapi.sys.entity.Menu;
import com.ningdatech.pmapi.sys.entity.dto.MenuQueryDTO;
import com.ningdatech.pmapi.sys.entity.dto.MenuSaveDTO;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/MenuManage.java Ver fichero

@@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.utils.TreeUtil;
import com.ningdatech.pmapi.common.util.TreeUtil;
import com.ningdatech.pmapi.sys.entity.Menu;
import com.ningdatech.pmapi.sys.entity.RoleMenu;
import com.ningdatech.pmapi.sys.entity.vo.MenuRoleVO;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java Ver fichero

@@ -10,7 +10,7 @@ import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.common.utils.BizUtils;
import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.sys.entity.Notice;
import com.ningdatech.pmapi.sys.entity.req.NoticeListReq;
import com.ningdatech.pmapi.sys.entity.req.NoticeSaveReq;


+ 0
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java Ver fichero

@@ -7,8 +7,6 @@ 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.wflow.utils.R;
import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.ApiResponse;


pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/IsAppendProjectEnum.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/IsAppendProjectEnum.java Ver fichero

@@ -1,16 +1,16 @@
package com.ningdatech.pmapi.todocenter.enums;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
package com.ningdatech.pmapi.todocenter.enumeration;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
* 是否增补项目枚举
*
* @author CMM
*/
@Getter
@@ -24,7 +24,7 @@ public enum IsAppendProjectEnum {
NOT_APPEND_PROJECT(0, "非增补项目"),

/**
*增补项目
* 增补项目
*/
APPEND_PROJECT(1, "增补项目");

@@ -41,7 +41,7 @@ public enum IsAppendProjectEnum {
}

public static String getDescByCode(Integer code) {
if(Objects.isNull(code)){
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) {
@@ -53,7 +53,7 @@ public enum IsAppendProjectEnum {
}

public static IsAppendProjectEnum getEnumByValue(Integer code) {
if(Objects.isNull(code)){
if (Objects.isNull(code)) {
return null;
}
for (IsAppendProjectEnum t : IsAppendProjectEnum.values()) {

pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enums/ProcessStatusEnum.java → pmapi/src/main/java/com/ningdatech/pmapi/todocenter/enumeration/ProcessStatusEnum.java Ver fichero

@@ -1,16 +1,16 @@
package com.ningdatech.pmapi.todocenter.enums;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
package com.ningdatech.pmapi.todocenter.enumeration;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
* 待办中心-流程状态枚举
*
* @author CMM
*/
@Getter
@@ -32,16 +32,16 @@ public enum ProcessStatusEnum {
/**
* 被驳回
*/
BE_REJECTED(3,"被驳回"),
BE_REJECTED(3, "被驳回"),

/**
* 审核通过
*/
APPROVED(4,"审核通过"),
APPROVED(4, "审核通过"),
/**
* 被撤回
*/
WITHDRAW(5,"被撤回");
WITHDRAW(5, "被撤回");


private Integer code;
@@ -56,7 +56,7 @@ public enum ProcessStatusEnum {
}

public static String getDescByCode(Integer code) {
if(Objects.isNull(code)){
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (ProcessStatusEnum t : ProcessStatusEnum.values()) {
@@ -68,11 +68,11 @@ public enum ProcessStatusEnum {
}

public static Integer getCodeByDesc(String desc) {
if(Objects.isNull(desc)){
if (Objects.isNull(desc)) {
return null;
}
for (ProcessStatusEnum t : ProcessStatusEnum.values()) {
if (desc.equals(t.getCode())) {
if (desc.equals(t.getDesc())) {
return t.code;
}
}
@@ -80,7 +80,7 @@ public enum ProcessStatusEnum {
}

public static ProcessStatusEnum getEnumByValue(Integer code) {
if(Objects.isNull(code)){
if (Objects.isNull(code)) {
return null;
}
for (ProcessStatusEnum t : ProcessStatusEnum.values()) {

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Ver fichero

@@ -33,8 +33,8 @@ 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;
import com.ningdatech.pmapi.todocenter.enumeration.IsAppendProjectEnum;
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;


Cargando…
Cancelar
Guardar