diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java index 3562152..067ace3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java @@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.google.common.collect.Lists; import com.ningdatech.basic.model.GenericResult; import com.ningdatech.pmapi.ding.model.DingOrgInfoTreeDTO; -import com.ningdatech.pmapi.organization.entity.DingOrganization; +import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.ningdatech.zwdd.client.ZwddClient; import com.ningdatech.zwdd.model.dto.DingOrgInfoDTO; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingEmployeeInfoMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingEmployeeInfoMapper.java index d82ff5a..0a900bc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingEmployeeInfoMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingEmployeeInfoMapper.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.organization.mapper; -import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo; +import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingOrganizationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingOrganizationMapper.java index b3fee77..86cf9ab 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingOrganizationMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/mapper/DingOrganizationMapper.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.organization.mapper; -import com.ningdatech.pmapi.organization.entity.DingOrganization; +import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/entity/DingEmployeeInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java similarity index 95% rename from pmapi/src/main/java/com/ningdatech/pmapi/organization/entity/DingEmployeeInfo.java rename to pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java index f844808..a0e52ad 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/entity/DingEmployeeInfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingEmployeeInfo.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.organization.entity; +package com.ningdatech.pmapi.organization.model.entity; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/entity/DingOrganization.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingOrganization.java similarity index 94% rename from pmapi/src/main/java/com/ningdatech/pmapi/organization/entity/DingOrganization.java rename to pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingOrganization.java index 25296fd..72866e5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/entity/DingOrganization.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/entity/DingOrganization.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.organization.entity; +package com.ningdatech.pmapi.organization.model.entity; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingEmployeeInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingEmployeeInfoService.java index 13d78c9..ca28cdf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingEmployeeInfoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingEmployeeInfoService.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.organization.service; -import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo; +import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; import com.baomidou.mybatisplus.extension.service.IService; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingOrganizationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingOrganizationService.java index b1b5ce3..54794d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingOrganizationService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingOrganizationService.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.organization.service; -import com.ningdatech.pmapi.organization.entity.DingOrganization; +import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.baomidou.mybatisplus.extension.service.IService; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingEmployeeInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingEmployeeInfoServiceImpl.java index 14803e8..36c82a1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingEmployeeInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingEmployeeInfoServiceImpl.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.organization.service.impl; -import com.ningdatech.pmapi.organization.entity.DingEmployeeInfo; +import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; import com.ningdatech.pmapi.organization.mapper.DingEmployeeInfoMapper; import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java index 4c154cb..8ea2ec7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.organization.service.impl; -import com.ningdatech.pmapi.organization.entity.DingOrganization; +import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.mapper.DingOrganizationMapper; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java index 27ed0ee..d482301 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java @@ -14,4 +14,7 @@ public interface DeclaredProjectContant { public static final String PROJECT_STAGE_5 = "验收申报审批流程"; } + class Instance { + public static final String PROVINCE_INSTANCE_ID = "PROVINCE_AUDIT"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index d076821..2344739 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -1,7 +1,8 @@ package com.ningdatech.pmapi.projectdeclared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ConstructionPlanDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.req.ConstrctionPlanListReq; import com.ningdatech.pmapi.projectdeclared.manage.ConstructionPlanManage; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; @@ -11,6 +12,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -34,7 +36,10 @@ public class ConstructionPlanController { @ApiOperation(value = "可申报建设方案项目列表", notes = "可申报建设方案项目列表") @GetMapping("/list") - public PageVo list(@Validated @ModelAttribute ProjectListReq req) { + public PageVo list(@Validated @ModelAttribute ConstrctionPlanListReq planReq) { + //限定参数 复制bean + ProjectListReq req = new ProjectListReq(); + BeanUtils.copyProperties(planReq,req); //项目阶段 状态 已定 方案待申报 req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); @@ -43,7 +48,7 @@ public class ConstructionPlanController { @ApiOperation(value = "建设方案申报", notes = "建设方案申报") @PostMapping("/start") - public String startTheProcess(@Validated @RequestBody ConstructionPlanDTO dto) { + public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { String instanceId = constructionPlanManage.startTheProcess(dto); return "建设方案申报 【" + instanceId + "】 成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java index 4c269a7..3532f11 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java @@ -1,10 +1,10 @@ package com.ningdatech.pmapi.projectdeclared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDTO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DeclaredProjectListParamDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectDraftSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.vo.ProjectDraftVO; import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; @@ -59,7 +59,7 @@ public class DeclaredProjectController { @ApiOperation(value = "申报项目", notes = "申报项目") @PostMapping("/start") - public String startTheProcess(@Validated @RequestBody DeclaredProjectDTO dto) { + public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { String instanceId = declaredProjectManage.startTheProcess(dto); return "启动流程实例 【" + instanceId + "】 成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java index e31be9a..bdb2f49 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java @@ -1,7 +1,8 @@ package com.ningdatech.pmapi.projectdeclared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.req.PrequalificationDeclaredListReq; import com.ningdatech.pmapi.projectdeclared.manage.PrequalificationDeclaredProjectManage; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; @@ -11,6 +12,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -34,7 +36,10 @@ public class PrequalificationDeclaredController { @ApiOperation(value = "可预审申报项目列表", notes = "可预审申报项目列表") @GetMapping("/list") - public PageVo list(@Validated @ModelAttribute ProjectListReq req) { + public PageVo list(@Validated @ModelAttribute PrequalificationDeclaredListReq preReq) { + //限定参数 复制bean + ProjectListReq req = new ProjectListReq(); + BeanUtils.copyProperties(preReq,req); //项目阶段 状态 已定 待预审 req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); @@ -43,7 +48,7 @@ public class PrequalificationDeclaredController { @ApiOperation(value = "申报预审", notes = "申报预审") @PostMapping("/start") - public String startTheProcess(@Validated @RequestBody PreDeclaredProjectDTO dto) { + public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { String instanceId = prequalificationDeclaredProjectManage.startTheProcess(dto); return "提交预审 【" + instanceId + "】 成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ProjectAdjustmentController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ProjectAdjustmentController.java new file mode 100644 index 0000000..3fa4749 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ProjectAdjustmentController.java @@ -0,0 +1,61 @@ +package com.ningdatech.pmapi.projectdeclared.controller; + +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.req.AdjustmentListReq; +import com.ningdatech.pmapi.projectdeclared.manage.ProjectAdjustmentManage; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; + +/** + * @Classname ConstructionPlanController + * @Description 建设方案申报 + * @Date 2023/2/13 9:53 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/project/adjustment") +@Api(value = "ProjectAdjustment", tags = "申报管理-项目内容调整") +@RequiredArgsConstructor +public class ProjectAdjustmentController { + + private final ProjectAdjustmentManage projectAdjustmentManage; + + private final ProjectLibManage projectLibManage; + + @ApiOperation(value = "可做项目内容调整的列表", notes = "可做项目内容调整的列表") + @GetMapping("/list") + public PageVo list(@Validated @ModelAttribute AdjustmentListReq preReq) { + //限定参数 复制bean + ProjectListReq req = new ProjectListReq(); + BeanUtils.copyProperties(preReq,req); + //项目阶段 状态 已定 方案待申报 + req.setStageList(Arrays.asList(ProjectStatusEnum.NOT_APPROVED.getCode())); + //只有 单位内部审核不通过 省级联审不通过 预审不通过 建设方案不通过 4种状态 + req.setStatusList(Arrays.asList(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), + ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), + ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), + ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode())); + return projectLibManage.projectLibList(req); + } + + @ApiOperation(value = "项目内容调整", notes = "项目内容调整") + @PostMapping + public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) { + String instanceId = projectAdjustmentManage.adjustment(dto); + return "建设方案申报 【" + instanceId + "】 成功"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java deleted file mode 100644 index f9630b8..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.ningdatech.pmapi.projectdeclared.entity.dto; - -import cn.hutool.core.collection.CollUtil; -import com.google.common.collect.Maps; -import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Map; - -/** - * @Classname DeclaredProjectDto - * @Description 申报项目 - * @Date 2023/2/1 14:52 - * @Author PoffyZhang - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class ConstructionPlanDTO implements Serializable { - - @NotNull - private Long projectId; - - //建设方案文件 - private String constructionPlanFile; - - private Map formData; - - @NotNull - private ProcessInstanceUserDto user; - - public Map getFormData(){ - if(CollUtil.isEmpty(this.formData)){ - this.formData = Maps.newHashMap(); - return this.formData; - } - return this.formData; - } -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java deleted file mode 100644 index e6ae09e..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.ningdatech.pmapi.projectdeclared.entity.dto; - -import cn.hutool.core.collection.CollUtil; -import com.google.common.collect.Maps; -import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Map; - -/** - * @Classname DeclaredProjectDto - * @Description 申报项目 - * @Date 2023/2/1 14:52 - * @Author PoffyZhang - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class PreDeclaredProjectDTO implements Serializable { - - @NotNull - private Long projectId; - - private Map formData; - - @NotNull - private ProcessInstanceUserDto user; - - public Map getFormData(){ - if(CollUtil.isEmpty(this.formData)){ - this.formData = Maps.newHashMap(); - return this.formData; - } - return this.formData; - } -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index bf442cd..83cad76 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.function.VUtils; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ConstructionPlanDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; @@ -18,6 +21,7 @@ import com.wflow.workflow.service.ProcessInstanceService; import com.wflow.workflow.service.ProcessModelService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; @@ -35,7 +39,7 @@ import java.util.Objects; @Component @Slf4j @RequiredArgsConstructor -public class ConstructionPlanManage { +public class ConstructionPlanManage { private final IProjectService projectService; @@ -45,16 +49,20 @@ public class ConstructionPlanManage { private final StateMachineUtils stateMachineUtils; + private final IProjectInstService projectInstService; + /** * 提交预审 * * @param dto * @return */ - public String startTheProcess(ConstructionPlanDTO dto) { - Project projectInfo = projectService.getById(dto.getProjectId()); - + public String startTheProcess(DefaultDeclaredDTO dto) { + ProjectDTO projectDto = dto.getProjectInfo(); + VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); + Project projectInfo = projectService.getById(projectDto.getId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); + VUtils.isTrue(StringUtils.isBlank(projectInfo.getConstructionPlanFile())).throwMessage("提交失败 请提交建设方案!"); String regionCode = projectInfo.getAreaCode(); @@ -72,7 +80,7 @@ public class ConstructionPlanManage { VUtils.isTrue(!ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode().equals(projectInfo.getStatus()) || !ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage())) .throwMessage("提交失败 该项目不是 待预审状态或者未立项阶段"); - //TODO 再判断 该项目是否 真实走完 单位内部审批 + // TODO 再判断 该项目是否 真实走完 预审审批 ProcessStartParamsVo params = new ProcessStartParamsVo(); params.setUser(dto.getUser()); @@ -89,7 +97,7 @@ public class ConstructionPlanManage { log.info("建设方案项目申报成功 【{}】", instanceId); //保存建设项目 - modifyProject(projectInfo, instanceId, dto.getConstructionPlanFile()); + modifyProject(projectInfo, instanceId, projectInfo.getConstructionPlanFile()); return instanceId; } @@ -109,6 +117,14 @@ public class ConstructionPlanManage { //调用状态机 进入下一个通过状态 stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); projectService.updateById(project); + + //保存项目和实例的关系 + ProjectInst projectInst = new ProjectInst(); + projectInst.setProjectId(project.getId()); + projectInst.setInstCode(instanceId); + projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setUpdateOn(LocalDateTime.now()); + projectInstService.save(projectInst); } catch (Exception e) { log.error("提交建设方案 项目信息修改 错误 ", e); throw new BusinessException("提交建设方案 项目信息修改 错误 :" + e.getMessage()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 14de447..c720f05 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -6,20 +6,23 @@ import com.alibaba.fastjson.TypeReference; 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.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDTO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVO; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.model.dto.DeclaredProjectListParamDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectDraftSaveDTO; +import com.ningdatech.pmapi.projectdeclared.model.vo.ProjectDraftVO; import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; 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.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; @@ -60,6 +63,8 @@ public class DeclaredProjectManage { private final ProcessModelService processModelService; + private final IProjectInstService projectInstService; + public PageVo pageDraft(DeclaredProjectListParamDTO params) { Page page = params.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProjectDraft.class) @@ -98,12 +103,12 @@ public class DeclaredProjectManage { } /** - * 启动实例 + * 新项目 启动实例 * * @param dto * @return */ - public String startTheProcess(DeclaredProjectDTO dto) { + public String startTheProcess(DefaultDeclaredDTO dto) { ProjectDTO projectInfo = dto.getProjectInfo(); String regionCode = projectInfo.getAreaCode(); @@ -123,12 +128,10 @@ public class DeclaredProjectManage { //放入条件判断的项目字段 ProjectConditionDTO conditionDto = new ProjectConditionDTO(); BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); - if (Objects.nonNull(conditionDto)) { - dto.getFormData().putAll( - JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference>() { - }) - ); - } + dto.getFormData().putAll( + JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference>() { + }) + ); params.setFormData(dto.getFormData()); String instanceId = processService.startProcess(model.getProcessDefId(), params); log.info("申报项目成功 【{}】", instanceId); @@ -140,6 +143,70 @@ public class DeclaredProjectManage { } /** + * 重新提交 启动实例 + * + * @param dto + * @return + */ + public String reStartTheProcess(DefaultDeclaredDTO dto) { + ProjectDTO projectDto = dto.getProjectInfo(); + VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); + Project projectInfo = projectService.getById(projectDto.getId()); + VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); + + String regionCode = projectInfo.getAreaCode(); + WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) + .eq(WflowModels::getRegionCode, regionCode) + .eq(WflowModels::getProcessType, ProjectProcessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getCode()) + .last("limit 1")); + + if (Objects.isNull(model)) { + log.error("此 【{}】区域找不到单位流程配置", regionCode); + throw new BusinessException(String.format("此 【%s】区域找不到单位流程配置", regionCode)); + } + + ProcessStartParamsVo params = new ProcessStartParamsVo(); + params.setUser(dto.getUser()); + params.setProcessUsers(Collections.emptyMap()); + //放入条件判断的项目字段 + ProjectConditionDTO conditionDto = new ProjectConditionDTO(); + BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); + dto.getFormData().putAll( + JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference>() { + }) + ); + params.setFormData(dto.getFormData()); + String instanceId = processService.startProcess(model.getProcessDefId(), params); + log.info("重新申报项目成功 【{}】", instanceId); + + //保存项目 + modifyProject(projectInfo, instanceId); + + return instanceId; + } + + private void modifyProject(Project project, String instanceId) { + //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 + try { + project.setUpdateOn(LocalDateTime.now()); + project.setInstCode(instanceId); + project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); + projectService.updateById(project); + //保存项目和实例的关系 + ProjectInst projectInst = new ProjectInst(); + projectInst.setProjectId(project.getId()); + projectInst.setInstCode(instanceId); + projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setUpdateOn(LocalDateTime.now()); + projectInstService.save(projectInst); + } catch (Exception e) { + log.error("重新申报项目 项目信息修改 错误 ", e); + throw new BusinessException("重新申报项目 项目信息修改 错误 :" + e.getMessage()); + } + } + + /** * 申报项目 时 新增项目到项目库 * * @param projectDto @@ -168,6 +235,13 @@ public class DeclaredProjectManage { }).collect(Collectors.toList()); projectApplicationService.saveBatch(applications); } + //保存项目和实例的关系 + ProjectInst projectInst = new ProjectInst(); + projectInst.setProjectId(project.getId()); + projectInst.setInstCode(instanceId); + projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setUpdateOn(LocalDateTime.now()); + projectInstService.save(projectInst); } catch (Exception e) { log.error("项目信息入库错误 ", e); throw new BusinessException("项目信息入库错误 :" + e.getMessage()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java new file mode 100644 index 0000000..25ca31f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -0,0 +1,49 @@ +package com.ningdatech.pmapi.projectdeclared.manage; + +import com.google.common.collect.Maps; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; +import java.util.Map; +import java.util.function.Function; + +/** + * @Classname DefaultDeclaredProjectManage + * + * @Description + * @Date 2023/2/14 17:12 + * @Author PoffyZhang + */ +@Component +@Slf4j +@RequiredArgsConstructor +public class DefaultDeclaredProjectManage { + + private final DeclaredProjectManage declaredProjectManage; + + private final ConstructionPlanManage constructionPlanManage; + + private final PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage; + public Map> startProcessMap = Maps.newHashMap(); + + /** + * 初始化业务分派逻辑,代替了if-else部分 + * key: 枚举 状态值 + * value: lambda表达式,最终会获取发起实例的函数 + */ + @PostConstruct + public void startProcessInit(){ + startProcessMap.put(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode(), + dto->declaredProjectManage.reStartTheProcess(dto)); + startProcessMap.put(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode(), + dto->constructionPlanManage.startTheProcess(dto)); + startProcessMap.put(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode(), + dto->prequalificationDeclaredProjectManage.startTheProcess(dto)); + startProcessMap.put(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode(), + dto->null); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index c7991bd..27546d1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -6,10 +6,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.function.VUtils; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; -import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDTO; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDTO; +import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectConditionDTO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; @@ -45,15 +49,18 @@ public class PrequalificationDeclaredProjectManage { private final ProcessModelService processModelService; + private final IProjectInstService projectInstService; + /** * 提交预审 * * @param dto * @return */ - public String startTheProcess(PreDeclaredProjectDTO dto) { - Project projectInfo = projectService.getById(dto.getProjectId()); - + public String startTheProcess(DefaultDeclaredDTO dto) { + ProjectDTO projectDto = dto.getProjectInfo(); + VUtils.isTrue(Objects.isNull(projectDto.getId())).throwMessage("提交失败 缺少项目ID!"); + Project projectInfo = projectService.getById(projectDto.getId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); String regionCode = projectInfo.getAreaCode(); @@ -74,24 +81,44 @@ public class PrequalificationDeclaredProjectManage { .throwMessage("提交失败 该项目不是 待预审状态或者未立项阶段"); //TODO 再判断 该项目是否 真实走完 单位内部审批 - ProcessStartParamsVo params = new ProcessStartParamsVo(); - params.setUser(dto.getUser()); - params.setProcessUsers(Collections.emptyMap()); - //放入条件判断的项目字段 - ProjectConditionDTO conditionDto = new ProjectConditionDTO(); - BeanUtils.copyProperties(projectInfo, conditionDto); - if (Objects.nonNull(conditionDto)) { + //使用状态机 进入下一步 看看需不需要走省级审批 + try { + stateMachineUtils.execute(projectInfo,stateMachineUtils.getProjectStatusPassEvent(projectInfo.getStatus())); + } catch (Exception e) { + log.error("项目 调用状态机出错:",e); + throw new BusinessException(projectInfo.getId() + "项目 调用状态机出错 :" + e.getMessage()); + } + + String instanceId = null; + //如果是省级部门 需要联审的(申报金额大于1000万 并且是市级项目) + if(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS + .getCode().equals(projectInfo.getStatus())){ + //TODO 对接外部 省级 + instanceId = DeclaredProjectContant.Instance.PROVINCE_INSTANCE_ID; + }else if(ProjectStatusEnum.PRE_APPLYING + .getCode().equals(projectInfo.getStatus())){ + //如果是非省级联审的项目 直接提交 预审 + ProcessStartParamsVo params = new ProcessStartParamsVo(); + params.setUser(dto.getUser()); + params.setProcessUsers(Collections.emptyMap()); + //放入条件判断的项目字段 + ProjectConditionDTO conditionDto = new ProjectConditionDTO(); + BeanUtils.copyProperties(projectInfo, conditionDto); dto.getFormData().putAll( JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference>() { }) ); + params.setFormData(dto.getFormData()); + instanceId = processService.startProcess(model.getProcessDefId(), params); + log.info("提交预审项目成功 【{}】", instanceId); + + //保存预审项目 + if(Objects.nonNull(instanceId)){ + modifyProject(projectInfo, instanceId); + } + }else{ + throw new BusinessException("项目状态 错误 project :" + JSON.toJSONString(projectInfo)); } - params.setFormData(dto.getFormData()); - String instanceId = processService.startProcess(model.getProcessDefId(), params); - log.info("提交预审项目成功 【{}】", instanceId); - - //保存预审项目 - modifyProject(projectInfo, instanceId); return instanceId; } @@ -110,6 +137,14 @@ public class PrequalificationDeclaredProjectManage { //调用状态机 进入下一个通过状态 stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); projectService.updateById(project); + + //保存项目和实例的关系 + ProjectInst projectInst = new ProjectInst(); + projectInst.setProjectId(project.getId()); + projectInst.setInstCode(instanceId); + projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setUpdateOn(LocalDateTime.now()); + projectInstService.save(projectInst); } catch (Exception e) { log.error("提交预审 项目信息修改 错误 ", e); throw new BusinessException("提交预审 项目信息修改 错误 :" + e.getMessage()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java new file mode 100644 index 0000000..d04702e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ProjectAdjustmentManage.java @@ -0,0 +1,79 @@ +package com.ningdatech.pmapi.projectdeclared.manage; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.basic.function.VUtils; +import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; +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.service.IProjectApplicationService; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.wflow.exception.BusinessException; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Classname ProjectAdjustmentManage + * @Description 项目内容调整 + * @Date 2023/2/1 14:48 + * @Author PoffyZhang + */ +@Component +@Slf4j +@RequiredArgsConstructor +public class ProjectAdjustmentManage { + + private final IProjectService projectService; + + private final IProjectApplicationService projectApplicationService; + + private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; + + /** + * 项目内容调整 + * @param dto + * @return + */ + public String adjustment(DefaultDeclaredDTO dto) { + ProjectDTO projectDto = dto.getProjectInfo(); + Project projectInfo = projectService.getById(projectDto.getId()); + + VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("调整失败 此项目不存在!"); + + //先修改项目信息 + 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 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); + } + + //最后去重新 提交项目流程 不同的状态 提交到不同的工作流去 + Function declaredFunction = + defaultDeclaredProjectManage.startProcessMap.get(project.getStatus()); + VUtils.isTrue(Objects.isNull(declaredFunction)).throwMessage("状态不正常 没有找到对应申报函数!"); + return declaredFunction.apply(dto); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ProjectDraftMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ProjectDraftMapper.java index 82c0ec2..56749c1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ProjectDraftMapper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/ProjectDraftMapper.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.projectdeclared.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectListParamDTO.java similarity index 93% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectListParamDTO.java index 6f4b327..3c0b86c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DeclaredProjectListParamDTO.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity.dto; +package com.ningdatech.pmapi.projectdeclared.model.dto; import com.ningdatech.basic.model.PagePo; import lombok.AllArgsConstructor; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DefaultDeclaredDTO.java similarity index 78% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DefaultDeclaredDTO.java index 233b5d4..71a81f1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/DefaultDeclaredDTO.java @@ -1,11 +1,10 @@ -package com.ningdatech.pmapi.projectdeclared.entity.dto; +package com.ningdatech.pmapi.projectdeclared.model.dto; import cn.hutool.core.collection.CollUtil; import com.google.common.collect.Maps; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @@ -14,16 +13,15 @@ import java.io.Serializable; import java.util.Map; /** - * @Classname DeclaredProjectDto - * @Description 申报项目 - * @Date 2023/2/1 14:52 + * @Classname DefaultDeclaredDTO + * @Description + * @Date 2023/2/14 17:16 * @Author PoffyZhang */ @Data -@Builder @NoArgsConstructor @AllArgsConstructor -public class DeclaredProjectDTO implements Serializable { +public class DefaultDeclaredDTO implements Serializable { @NotNull private ProjectDTO projectInfo; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectConditionDTO.java similarity index 93% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectConditionDTO.java index b74c2a0..24f89c2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectConditionDTO.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity.dto; +package com.ningdatech.pmapi.projectdeclared.model.dto; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectDraftSaveDTO.java similarity index 92% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectDraftSaveDTO.java index 78ab8f3..ec7c809 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectDraftSaveDTO.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity.dto; +package com.ningdatech.pmapi.projectdeclared.model.dto; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectDraft.java similarity index 99% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectDraft.java index d43c88b..cd3f80a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/ProjectDraft.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity; +package com.ningdatech.pmapi.projectdeclared.model.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/AdjustmentListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/AdjustmentListReq.java new file mode 100644 index 0000000..87823f0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/AdjustmentListReq.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.projectdeclared.model.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * @Classname AdjustmentListReq + * @Description + * @Date 2023/2/14 11:42 + * @Author PoffyZhang + */ +@Data +public class AdjustmentListReq { + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrg; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createOnMin; + + @ApiModelProperty("创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createOnMax; + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/ConstrctionPlanListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/ConstrctionPlanListReq.java new file mode 100644 index 0000000..70b9323 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/ConstrctionPlanListReq.java @@ -0,0 +1,38 @@ +package com.ningdatech.pmapi.projectdeclared.model.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * @Classname PrequalificationDeclaredReq + * @Description + * @Date 2023/2/14 11:42 + * @Author PoffyZhang + */ +@Data +public class ConstrctionPlanListReq { + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrg; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createOnMin; + + @ApiModelProperty("创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createOnMax; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/PrequalificationDeclaredListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/PrequalificationDeclaredListReq.java new file mode 100644 index 0000000..e4e4457 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/req/PrequalificationDeclaredListReq.java @@ -0,0 +1,38 @@ +package com.ningdatech.pmapi.projectdeclared.model.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * @Classname PrequalificationDeclaredReq + * @Description + * @Date 2023/2/14 11:42 + * @Author PoffyZhang + */ +@Data +public class PrequalificationDeclaredListReq { + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrg; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createOnMin; + + @ApiModelProperty("创建时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createOnMax; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDeclaredDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredDetailVO.java similarity index 99% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDeclaredDetailVO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredDetailVO.java index 9416621..d9667b8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDeclaredDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredDetailVO.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity.vo; +package com.ningdatech.pmapi.projectdeclared.model.vo; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import io.swagger.annotations.ApiModel; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDeclaredListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredListItemVO.java similarity index 96% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDeclaredListItemVO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredListItemVO.java index 11e7db6..329ce94 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDeclaredListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDeclaredListItemVO.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity.vo; +package com.ningdatech.pmapi.projectdeclared.model.vo; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import io.swagger.annotations.ApiModel; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDraftVO.java similarity index 99% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDraftVO.java index a822fd0..7712ef6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/ProjectDraftVO.java @@ -1,4 +1,4 @@ -package com.ningdatech.pmapi.projectdeclared.entity.vo; +package com.ningdatech.pmapi.projectdeclared.model.vo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IProjectDraftService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IProjectDraftService.java index 5ef9d25..db798fd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IProjectDraftService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IProjectDraftService.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.projectdeclared.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft; /** *

diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ProjectDraftServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ProjectDraftServiceImpl.java index e88f158..d53f0a4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ProjectDraftServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/ProjectDraftServiceImpl.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.projectdeclared.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft; import com.ningdatech.pmapi.projectdeclared.mapper.ProjectDraftMapper; import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; import org.springframework.stereotype.Service; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java index 51971af..ad3203c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.projectlib.helper; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; @@ -22,25 +23,28 @@ public class ProjectHelper { **/ public static LambdaQueryWrapper projectQuery(ProjectListReq req) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode()); - query.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId()); - query.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName()); - query.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType()); - query.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()); - query.eq(req.getStage() != null, Project::getStage, req.getStage()); - query.eq(req.getStatus() != null, Project::getStatus, req.getStatus()); - // 申报金额 - query.ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin()); - query.le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax()); - // 申报时间 - query.ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin()); - query.le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax()); - // 批复金额 - query.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin()); - query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()); + query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode()) + .eq(req.getUserId() != null, Project::getCreateBy, req.getUserId()) + .like(req.getProjectName() != null, Project::getProjectName, req.getProjectName()) + .eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType()) + .eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()) + .eq(req.getStage() != null, Project::getStage, req.getStage()) + .eq(req.getStatus() != null, Project::getStatus, req.getStatus()) + // 申报金额 + .ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin()) + .le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax()) + // 申报时间 + .ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin()) + .le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax()) + // 批复金额 + .ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin()) + .le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()) - query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()); - query.eq(req.getIsTemporaryAugment() != null, Project::getIsTemporaryAugment, req.getIsTemporaryAugment()); + .like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()) + .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()); return query; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java index 4266829..efd785c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java @@ -1,9 +1,13 @@ package com.ningdatech.pmapi.projectlib.model.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.time.LocalDateTime; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; /** *

@@ -14,65 +18,25 @@ import io.swagger.annotations.ApiModel; * @since 2023-02-13 */ @TableName("nd_project_inst") +@Data @ApiModel(value = "NdProjectInst对象", description = "") public class ProjectInst implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("主键") + @TableId(type = IdType.AUTO) private Long id; + @ApiModelProperty("项目ID") private Long projectId; + @ApiModelProperty("实例ID") private String instCode; + @ApiModelProperty("创建时间") private LocalDateTime creatOn; + @ApiModelProperty("修改时间") private LocalDateTime updateOn; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - public String getInstCode() { - return instCode; - } - - public void setInstCode(String instCode) { - this.instCode = instCode; - } - public LocalDateTime getCreatOn() { - return creatOn; - } - - public void setCreatOn(LocalDateTime creatOn) { - this.creatOn = creatOn; - } - public LocalDateTime getUpdateOn() { - return updateOn; - } - - public void setUpdateOn(LocalDateTime updateOn) { - this.updateOn = updateOn; - } - - @Override - public String toString() { - return "NdProjectInst{" + - "id=" + id + - ", projectId=" + projectId + - ", instCode=" + instCode + - ", creatOn=" + creatOn + - ", updateOn=" + updateOn + - "}"; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java index aeac65c..12f40ba 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java @@ -9,6 +9,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; /** *

@@ -70,4 +71,9 @@ public class ProjectListReq extends PagePo { @ApiModelProperty("是否临时增补 0:否 1:是") private Integer isTemporaryAugment; + @ApiModelProperty("项目阶段 多个") + private List stageList; + + @ApiModelProperty("项目状态 多个") + private List statusList; } diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/DraftTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/DraftTest.java index a2bc8e1..f1b3fa2 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/DraftTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/DraftTest.java @@ -2,7 +2,7 @@ package com.ningdatech.pmapi.sys.project; import com.alibaba.fastjson.JSON; import com.ningdatech.pmapi.AppTests; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft; import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; import org.junit.Test;