From 99b3994968ef1e719c9a675b0307efc14b597439 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 09:38:32 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=9A=82=E7=BC=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 8 ++++++++ .../projectlib/manage/AnnualPlanLibManage.java | 8 +++++++- .../projectlib/model/req/ProjectApprovedReq.java | 2 +- .../pmapi/projectlib/model/req/ProjectIdReq.java | 23 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 43a252a..2d1bc26 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -4,6 +4,7 @@ import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; @@ -50,4 +51,11 @@ public class AnnualPlanController { annualPlanLibManage.projectApproved(req); } + @PostMapping("/suspendAnnualPlan") + @ApiOperation("暂缓年度计划") + @WebLog("暂缓年度计划") + public void suspendAnnualPlan(@RequestBody @Valid ProjectIdReq req) throws Exception { + annualPlanLibManage.suspendAnnualPlan(req); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index fe3c113..9da7bd6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -13,6 +13,7 @@ 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.ProjectApprovedReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; @@ -47,7 +48,6 @@ public class AnnualPlanLibManage { */ private static final List ANNUAL_PLAN_LIST_STATUS = Arrays.asList( IN_THE_ANNUAL_PLAN, - BE_SUSPENDED, SCHEME_UNDER_REVIEW, SCHEME_REVIEW_FAILED, TO_BE_APPROVED, @@ -123,4 +123,10 @@ public class AnnualPlanLibManage { projectService.update(update); } + @Transactional(rollbackFor = Exception.class) + public void suspendAnnualPlan(ProjectIdReq req) throws Exception { + Project project = projectService.getById(req.getProjectId()); + stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java index d98645f..64708c3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectApprovedReq.java @@ -40,7 +40,7 @@ public class ProjectApprovedReq { @ApiModelProperty("建设周期") @NotNull(message = "建设周期不能为空") @Range(min = 1, max = 99999, message = "建设周期无效") - private LocalDate buildCycle; + private Integer buildCycle; @ApiModelProperty("批复文件ID") @NotNull(message = "批复文件不能为空") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java new file mode 100644 index 0000000..82278b1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectIdReq.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + *

+ * ProjectIdReq + *

+ * + * @author WendyYang + * @since 09:32 2023/2/13 + */ +@Data +public class ProjectIdReq { + + @ApiModelProperty("项目ID") + @NotNull(message = "项目ID不能为空") + private Long projectId; + +} From 5a122b10f23196276ab1e116715d42c7a7c08370 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 10:15:33 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E8=A1=A8=E9=80=86=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/GeneratorCodeKingbaseConfig.java | 2 +- .../pmapi/projectlib/mapper/ProjectInstMapper.java | 16 +++++ .../pmapi/projectlib/mapper/ProjectInstMapper.xml | 5 ++ .../pmapi/projectlib/model/entity/ProjectInst.java | 78 ++++++++++++++++++++++ .../projectlib/service/IProjectInstService.java | 16 +++++ .../service/impl/ProjectInstServiceImpl.java | 20 ++++++ 6 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index e326099..c4453af 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { } public static void main(String[] args) { - generate("Lierbao", "organization", PATH_LXX, "ding_employee_info"); + generate("Poffy", "projectlib", PATH_YYD, "nd_project_inst"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java new file mode 100644 index 0000000..3af978f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectlib.mapper; + +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +public interface ProjectInstMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml new file mode 100644 index 0000000..96bb279 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectInstMapper.xml @@ -0,0 +1,5 @@ + + + + + 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 new file mode 100644 index 0000000..4266829 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectInst.java @@ -0,0 +1,78 @@ +package com.ningdatech.pmapi.projectlib.model.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; + +/** + *

+ * + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +@TableName("nd_project_inst") +@ApiModel(value = "NdProjectInst对象", description = "") +public class ProjectInst implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + private Long projectId; + + private String instCode; + + private LocalDateTime creatOn; + + 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/service/IProjectInstService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java new file mode 100644 index 0000000..8f80015 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectInstService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectlib.service; + +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +public interface IProjectInstService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java new file mode 100644 index 0000000..58650e9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectInstServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.projectlib.service.impl; + +import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; +import com.ningdatech.pmapi.projectlib.mapper.ProjectInstMapper; +import com.ningdatech.pmapi.projectlib.service.IProjectInstService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Poffy + * @since 2023-02-13 + */ +@Service +public class ProjectInstServiceImpl extends ServiceImpl implements IProjectInstService { + +} From d20d78afe592f6228d1c7a64bf58e9feb44ca769 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 13 Feb 2023 10:23:18 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9C=BA=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=88=86=E6=94=AF=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/ProjectDeclareStateMachineBuilder.java | 6 +++--- .../pmapi/projectlib/controller/ProjectLibController.java | 6 ------ .../pmapi/projectlib/manage/ProjectLibManage.java | 13 ------------- .../pmapi/todocenter/manage/TodoCenterManage.java | 4 ++++ .../pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java | 3 +++ .../com/ningdatech/pmapi/statemachine/StateMachineTest.java | 8 ++++++-- 6 files changed, 16 insertions(+), 24 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java index 4283c0c..117c2af 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java @@ -91,7 +91,7 @@ public class ProjectDeclareStateMachineBuilder { .withChoice() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING).and() + .last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and() // 待预审撤回,从待预审到单位内部审核中 .withExternal() .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) @@ -127,11 +127,11 @@ public class ProjectDeclareStateMachineBuilder { .source(ProjectStatusEnum.PRE_APPLYING) .target(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .event(ProjectStatusChangeEvent.PRE_APPLYING_WITHDRAW).and() - // 预审中撤回,从待预审选择->省级部门联审中,预审中,完成其中一种状态 + // 预审中撤回,从待预审选择->省级部门联审中,待预审,完成其中一种状态 .withChoice() .source(ProjectStatusEnum.PRE_APPLYING) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),new ProjectDeclareChoiceAction()) - .last(ProjectStatusEnum.PRE_APPLYING).and() + .last(ProjectStatusEnum.PENDING_PREQUALIFICATION,projectDeclareAction.new ProjectDeclareChoiceAction()).and() // 部门联审通过,从部门联审中到年度计划中 .withExternal() .source(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java index a929f2e..0f9a893 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java @@ -40,10 +40,4 @@ public class ProjectLibController { return projectLibManage.getProjectDetail(id); } - @GetMapping("/getProjectInfo") - @ApiOperation("获取申报项目信息") - private Project getProjectInfo (@RequestParam String processInstanceId){ - return projectLibManage.getProjectInfo(processInstanceId); - } - } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 2e809cd..c3cbd08 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -95,17 +95,4 @@ public class ProjectLibManage { return vo; } - /** - * - * @param instanceCode 申报项目流程实例编号 - * @return com.ningdatech.pmapi.projectlib.model.entity.Project - * @author CMM - * @since 2023/02/11 11:15 - */ - public Project getProjectInfo(String instanceCode) { - // 查询项目申报信息 - Project projectInfo = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getInstCode, instanceCode)); - return projectInfo; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 1060fc6..cbb2d69 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -161,6 +161,7 @@ public class TodoCenterManage { List resVos = results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); 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"); @@ -952,6 +953,7 @@ public class TodoCenterManage { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -1124,6 +1126,7 @@ public class TodoCenterManage { results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); @@ -1330,6 +1333,7 @@ public class TodoCenterManage { results.stream().map(d -> { ResToBeProcessedDTO res = new ResToBeProcessedDTO(); BeanUtils.copyProperties(d, res); + res.setProjectId(d.getId()); res.setProcessStatusName(ProcessStatusEnum.getDescByCode(d.getProcessStatus())); LocalDateTime processLaunchTime = d.getCreateOn(); String launchTimeFormat = NdDateUtils.format(processLaunchTime, "yyyy-MM-dd HH:mm"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java index 88725c1..f03e734 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeProcessedDTO.java @@ -29,6 +29,9 @@ import org.springframework.format.annotation.DateTimeFormat; public class ResToBeProcessedDTO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty("项目ID") + private Long projectId; + @ApiModelProperty("流程实例编号") private String instanceCode; diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java index d9ed6e6..1819a47 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/statemachine/StateMachineTest.java @@ -8,6 +8,8 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.math.BigDecimal; + /** * 状态机测试 * @@ -22,7 +24,9 @@ public class StateMachineTest extends AppTests { @Test public void stateMachineTest() throws Exception { Project project = new Project(); - project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); - stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + project.setDeclareAmount(BigDecimal.valueOf(2000)); + // stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); } } From 6def1d850b70922ee6fd41f0760102ba5aafbfd0 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 14:35:34 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 8 ++ .../projectlib/manage/AnnualPlanLibManage.java | 16 +++ .../projectlib/model/dto/AnnualLibImportDTO.java | 108 +++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 2d1bc26..d50be49 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -12,6 +12,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; @@ -58,4 +59,11 @@ public class AnnualPlanController { annualPlanLibManage.suspendAnnualPlan(req); } + @PostMapping("/importAnnualPlan") + @ApiOperation("导入年度计划") + @WebLog("导入年度计划") + public void importAnnualPlan(MultipartFile file) { + annualPlanLibManage.importAnnualPlan(file); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 9da7bd6..fb83502 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -1,5 +1,8 @@ package com.ningdatech.pmapi.projectlib.manage; +import cn.hutool.poi.excel.ExcelUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -21,10 +24,14 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; @@ -129,4 +136,13 @@ public class AnnualPlanLibManage { stateMachine.execute(project, ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND); } + @Transactional(rollbackFor = Exception.class) + public void importAnnualPlan(MultipartFile file) { + try (InputStream inputStream = file.getInputStream()) { + EasyExcel.read(inputStream).sheet(0); + } catch (IOException e) { + throw BizException.wrap("导入年度计划失败"); + } + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java new file mode 100644 index 0000000..6b40bed --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java @@ -0,0 +1,108 @@ +package com.ningdatech.pmapi.projectlib.model.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +/** + *

+ * AnnualLibImportDTO + *

+ * + * @author WendyYang + * @since 13:46 2023/2/13 + */ +@Data +public class AnnualLibImportDTO { + + @ExcelProperty("序号") + @NotNull(message = "序号不能为空") + private Integer serialNumber; + + @ExcelProperty("项目id") + @NotNull(message = "项目ID不能为空") + private Long projectId; + + @ExcelProperty("项目名称") + @NotBlank(message = "项目名称不能为空") + private String projectName; + + @NotBlank(message = "建设内容不能为空") + @ExcelProperty("建设内容") + private String projectIntroduction; + + @NotBlank(message = "建设依据不能为空") + @ExcelProperty("建设依据") + private String buildBasis; + + @ExcelProperty("建设性质") + @NotBlank(message = "建设性质不能为空") + private String isFirst; + + @ExcelProperty("建设起止年限") + @NotBlank(message = "建设起止年限不能为空") + private String buildCycle; + + @NotBlank(message = "总投资不能为空") + @ExcelProperty("总投资") + private BigDecimal declaredAmount; + + @NotNull(message = "年度投资额不能为空") + @ExcelProperty("年度投资额") + private BigDecimal annualPlanAMount; + + @ExcelProperty("自有资金") + @NotNull(message = "自由资金不能为空") + private BigDecimal declareHaveAmount; + + @ExcelProperty("政府投资-本级财政") + @NotNull(message = "政府投资-本级财政不能为空") + private BigDecimal declareGovOwnFinanceAmount; + + @ExcelProperty("政府投资-上级补") + @NotNull(message = "政府投资-上级补不能为空") + private BigDecimal declareGovSuperiorFinanceAmount; + + @ExcelProperty("银行贷款") + @NotNull(message = "银行贷款不能为空") + private BigDecimal declareBankLendingAmount; + + @ExcelProperty("其他") + @NotNull(message = "其他不能为空") + private BigDecimal declareOtherAmount; + + @ExcelProperty("一季度") + @NotBlank(message = "一季度不能为空") + private String engineeringSpeedOne; + + @ExcelProperty("二季度") + @NotBlank(message = "二季度不能为空") + private String engineeringSpeedTwo; + + @ExcelProperty("三季度") + @NotBlank(message = "三季度不能为空") + private String engineeringSpeedThree; + + @ExcelProperty("四季度") + @NotBlank(message = "四季度不能为空") + private String engineeringSpeedFour; + + @ExcelProperty("建设单位") + @NotBlank(message = "建设单位不能为空") + private String buildUnitName; + + @ExcelProperty("项目联系人") + @NotBlank(message = "项目联系人不能为空") + private String contactName; + + @ExcelProperty("项目分管领导") + @NotBlank(message = "项目分管领导不能为空") + private String responsibleMan; + + @ExcelProperty("备注") + private String projectRemarks; + +} From 2b4a70e743b4485620163766fa6ac706a6fb64d5 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 13 Feb 2023 15:10:31 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E9=A2=84=E5=AE=A1=E9=A1=B9=E7=9B=AE=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ConstructionPlanController.java | 50 +++ .../controller/DeclaredProjectController.java | 6 +- .../PrequalificationDeclaredController.java | 2 +- .../pmapi/projectdeclared/entity/ProjectDraft.java | 3 + .../entity/dto/ConstructionPlanDto.java | 45 +++ .../entity/dto/DeclaredProjectListParamDto.java | 2 + .../entity/dto/ProjectDraftSaveDto.java | 378 +-------------------- .../manage/ConstructionPlanManage.java | 132 +++++++ .../manage/DeclaredProjectManage.java | 5 +- .../pmapi/sys/project/ProjectStateTest.java | 5 +- 10 files changed, 248 insertions(+), 380 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDto.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java 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 new file mode 100644 index 0000000..8c3dbda --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -0,0 +1,50 @@ +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.manage.ConstructionPlanManage; +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.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname ConstructionPlanController + * @Description 建设方案申报 + * @Date 2023/2/13 9:53 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/construction") +@Api(value = "ConstructionPlan", tags = "申报管理-建设方案申报") +@RequiredArgsConstructor +public class ConstructionPlanController { + + private final ConstructionPlanManage constructionPlanManage; + + private final ProjectLibManage projectLibManage; + + @ApiOperation(value = "可申报建设方案项目列表", notes = "可申报建设方案项目列表") + @GetMapping("/list") + public PageVo list(@Validated @ModelAttribute ProjectListReq req) { + //项目阶段 状态 已定 待预审 + req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); + req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + return projectLibManage.projectLibList(req); + } + + @ApiOperation(value = "建设方案申报", notes = "建设方案申报") + @PostMapping("/start") + public String startTheProcess(@Validated @RequestBody ConstructionPlanDto 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 21c631f..67bfd0a 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,17 +1,13 @@ package com.ningdatech.pmapi.projectdeclared.controller; -import com.ningdatech.basic.model.ApiResponse; 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.ProjectDeclaredDetailVO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredListItemVO; import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -65,6 +61,6 @@ public class DeclaredProjectController { @PostMapping("/start") public String startTheProcess(@Validated @RequestBody DeclaredProjectDto dto) { String instanceId = declaredProjectManage.startTheProcess(dto); - return "启动流程实例 " + instanceId + " 成功"; + 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 8d6d249..c05225f 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 @@ -45,6 +45,6 @@ public class PrequalificationDeclaredController { @PostMapping("/start") public String startTheProcess(@Validated @RequestBody PreDeclaredProjectDto dto) { String instanceId = prequalificationDeclaredProjectManage.startTheProcess(dto); - return "提交预审 " + instanceId + " 成功"; + return "提交预审 【" + instanceId + "】 成功"; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java index a1c17b2..ea2815b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java @@ -410,6 +410,9 @@ public class ProjectDraft implements Serializable { @ApiModelProperty("新增form内容") private String dynamicForm; + @ApiModelProperty("用户id") + private String userId; + private Long createBy; private Long updateBy; } 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 new file mode 100644 index 0000000..86ba27c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDto.java @@ -0,0 +1,45 @@ +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/DeclaredProjectListParamDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java index 53178e7..32b1868 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java @@ -19,6 +19,8 @@ import org.springframework.format.annotation.DateTimeFormat; @AllArgsConstructor public class DeclaredProjectListParamDto extends PagePo { + private String userId; + private String projectName; private Integer projectType; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java index 28f1785..0fdf995 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java @@ -1,15 +1,11 @@ package com.ningdatech.pmapi.projectdeclared.entity.dto; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; +import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.*; - +import javax.validation.constraints.NotNull; import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; /** *

@@ -29,370 +25,10 @@ public class ProjectDraftSaveDto implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("应用ID 新增为空") - private Long id; - - @ApiModelProperty("所属地区编号") - private String areaCode; - - @ApiModelProperty("所属地区名称") - private String area; - - @ApiModelProperty("项目阶段") - private Integer stage; - - @ApiModelProperty("项目状态") - private Integer status; - - @ApiModelProperty("项目名称") - private String projectName; - - @ApiModelProperty("是否临时增补 0:否 1:是") - private Integer isTemporaryAugment; - - @ApiModelProperty("项目负责人") - private String responsibleMan; - - @ApiModelProperty("负责人手机号码") - private String responsibleManMobile; - - @ApiModelProperty("项目联系人") - private String contactName; - - @ApiModelProperty("项目联系人手机号码") - private String contactPhone; - - @ApiModelProperty("建设单位名称") - private String buildUnitName; - - @ApiModelProperty("建设单位统一社会信用代码") - private String buildUnitCode; - - @ApiModelProperty("建设单位浙政钉ID") - private String buildUnitZheJiangGovernmentDingId; - - @ApiModelProperty("项目类型 1:建设 2:运维") - private Integer projectType; - - @ApiModelProperty("是否首次新建 0:否 1:是") - private Integer isFirst; - - @ApiModelProperty("项目预算年度") - private Integer projectYear; - - @ApiModelProperty("项目建设起始时间") - private String beginTime; - - @ApiModelProperty("项目建设终止时间") - private String endTime; - - @ApiModelProperty("四大体系 1:业务应用 2:应用支撑 3:数据资源 4:基础设施") - private Integer fourSystems; - - @ApiModelProperty("是否数字化改革项目 0:否 1:是") - private Integer isDigitalReform; - - @ApiModelProperty("综合业务领域") - private String bizDomain; - - @ApiModelProperty("建设层级 1:国家级 2:省级 3:省本级 4:市级 5:市本级 6:区县 7乡镇") - private Integer buildLevel; - - @ApiModelProperty("立项依据") - private String buildBasis; - - @ApiModelProperty("发改编码") - private String developCode; - - @ApiModelProperty("财政编码") - private String financialCode; - - @ApiModelProperty("是否上云 0:否 1:是") - private Integer isCloud; - - private String cloudType; - - @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer protectionLevel; - - @ApiModelProperty("是否密评 0:否 1:是") - private Integer isSecretComments; - - @ApiModelProperty("项目简介") - private String projectIntroduction; - - @ApiModelProperty("资金申报情况-申报金额(万元)") - private BigDecimal declareAmount; - - @ApiModelProperty("资金申报情况-自有金额(万元)") - private BigDecimal declareHaveAmount; - - @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") - private BigDecimal declareGovernmentOwnFinanceAmount; - - @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") - private BigDecimal declareGovernmentSuperiorFinanceAmount; - - @ApiModelProperty("银行贷款(万元)") - private BigDecimal declareBankLendingAmount; - - @ApiModelProperty("其它资金(万元)") - private BigDecimal declareOtherAmount; - - @ApiModelProperty("资金分配情况-软件开发(万元)") - private BigDecimal softwareDevelopmentAmount; - - @ApiModelProperty("资金分配情况-云资源、硬件购置(万元)") - private BigDecimal cloudHardwarePurchaseAmount; - - @ApiModelProperty("资金分配情况-第三方服务(万元)") - private BigDecimal thirdPartyAmount; - - @ApiModelProperty("年度支付计划-年度支付计划(万元)") - private BigDecimal annualPlanAmount; - - @ApiModelProperty("年度支付计划-自有金额(万元)") - private BigDecimal annualPlanHaveAmount; - - @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") - private BigDecimal annualPlanGovernmentOwnFinanceAmount; - - @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") - private BigDecimal annualPlanGovernmentSuperiorFinanceAmount; - - @ApiModelProperty("年度支付计划-银行贷款(万元)") - private BigDecimal annualPlanBankLendingAmount; - - @ApiModelProperty("年度支付计划-其它资金(万元)") - private BigDecimal annualPlanOtherAmount; - - @ApiModelProperty("立项批复资金(万元)") - private BigDecimal approvalAmount; - - private LocalDateTime annualPlanAddTime; - - @ApiModelProperty("核心业务-核心业务模块") - private String coreBusiness; - - @ApiModelProperty("安全投入-投入项") - private String safetyInputTitle; - - @ApiModelProperty("安全投入-内容描述") - private String safetyInputDescribe; - - @ApiModelProperty("安全投入-金额(万元)") - private BigDecimal safetyInputAmount; - - @ApiModelProperty("附件-初步方案") - private String preliminaryPlanFile; - - @ApiModelProperty("附件-佐证材料") - private String supportingMaterialsFile; - - @ApiModelProperty("附件-项目总投资测算明细") - private String calculationTotalInvestmentFile; - - @ApiModelProperty("附件-申报单位主要职责(单位三定方案)") - private String mainResponsibilitiesApplicantFile; - - @ApiModelProperty("备注") - private String projectRemarks; - - @ApiModelProperty("是否包含应用 0:否 1:是") - private Integer includeApplication; - - @ApiModelProperty("工程形象进度-第一季度") - private String engineeringSpeedOne; - - @ApiModelProperty("工程形象进度-第二季度") - private String engineeringSpeedTwo; - - @ApiModelProperty("工程形象进度-第三季度") - private String engineeringSpeedThree; - - @ApiModelProperty("工程形象进度-第四季度") - private String engineeringSpeedFour; - - @ApiModelProperty("核心业务-是否开启核心业务模块 false:关闭 true:开启") - private Boolean isOpenCoreBusiness; - - @ApiModelProperty("安全投入-是否开启安全投入模块 false:关闭 true:开启") - private Boolean isOpenSafetyInput; - - @ApiModelProperty("工程形象进度-是否开启 false:关闭 true:开启") - private Boolean isEngineeringSpeed; - - @ApiModelProperty("附件-是否开启 false:关闭 true:开启") - private Boolean isAccessories; - - @ApiModelProperty("备注-是否开启 false:关闭 true:开启") - private Boolean isRemarks; - - @ApiModelProperty("年度支付计划-是否开启 false:关闭 true:开启") - private Boolean isAnnualPlanAmount; - - @ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启") - private Boolean isInnovateWholeProvinceShare; - - @ApiModelProperty("安全投入-模块信息") - private String safetyInputModular; - - @ApiModelProperty("项目申报pdf") - private String projectPdf; - - @ApiModelProperty("立项申报pdf") - private String declarationPdf; - - @ApiModelProperty("建设周期(月)") - private String buildCycle; - - @ApiModelProperty("建设方案文件") - private String constructionPlanFile; - - @ApiModelProperty("立项批复文件") - private String approvedFile; - - @ApiModelProperty("批复金额") - private BigDecimal approvedTotalInvestmentIncrease; - - @ApiModelProperty("上级主管部门") - private String higherSuperUnit; - - @ApiModelProperty("上级主管部门Code") - private String higherSuperUnitCode; - - @ApiModelProperty("主管部门名称") - private String superUnit; - - @ApiModelProperty("主管部门Code") - private String superUnitCode; - - @ApiModelProperty("前端所需验证字段") - private Integer allApplicationsDone; - - @ApiModelProperty("项目一级状态 10000 20000 30000") - private Integer projectStatusFirst; - - @ApiModelProperty("项目二级状态") - private Integer projectStatusSecond; - - @ApiModelProperty("应用名称") - private String applicationName; - - @ApiModelProperty("关联IRS现有应用") - private String relatedExistsApplication; - - @ApiModelProperty("关联IRS现有应用-IRS应用编码") - private String relatedExistsApplicationCode; - - @ApiModelProperty("应用类型") - private String applicationType; - - @ApiModelProperty("是否统建应用 0:否 1:是") - private Integer isUniteBuild; - - @ApiModelProperty("统建类型 1:全省统建 2:全市统建") - private Integer unionBuildKind; - - @ApiModelProperty("是否数改系统 0:否 1:是") - private Integer isDigitalModification; - - @ApiModelProperty("数改系统") - private String digitalModification; - - @ApiModelProperty("发布端") - private String publishSide; - - @ApiModelProperty("是否一本账场景应用名称 0:否 1:是") - private Integer isAccountAppName; - - @ApiModelProperty("一本账应用名称") - private String accountAppName; - - @ApiModelProperty("领域大脑一本账") - private String domainBrainAccount; - - @ApiModelProperty("是否业务协同 0:否 1:是") - private Integer isBizCooperate; - - @ApiModelProperty("业务协同描述") - private String bizCooperateInfo; - - @ApiModelProperty("使用范围") - private String usesRangeRemark; - - @ApiModelProperty("应用简介") - private String applicationSummary; - - @ApiModelProperty("应用备注") - private String applicationRemark; - - @ApiModelProperty("应用总投资测算明细-文件") - private String applicationEstimateFile; - - @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer secrecyGrade; - - @ApiModelProperty("密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer passwordGrade; - - @ApiModelProperty("是否符合国家信息技术应用创新相关规范 0:否 1:是") - private Integer nationalItSpec; - - @ApiModelProperty("是否使用政务云资源 0否 1是") - private Integer useGovCloud; - - @ApiModelProperty("云资源类型") - private String cloudsType; - - @ApiModelProperty("云资源基础规格") - private String cloudsFoundationSpecifications; - - @ApiModelProperty("云资源台数") - private Integer cloudsNumber; - - @ApiModelProperty("云资源用户描述") - private String cloudsDescription; - - @ApiModelProperty("网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机") - private Integer netEnv; - - @ApiModelProperty("是否使用公共数据 0否 1是") - private Integer useCommonData; - - @ApiModelProperty("数据名称") - private String dataName; - - @ApiModelProperty("是否使用公共组件 0否 1是") - private Integer useCommonComponent; - - @ApiModelProperty("使用的公共组件名称") - private String commonComponents; - - @ApiModelProperty("是否产生公共组件 0否 1是") - private Integer produceCommonComponent; - - @ApiModelProperty("预计产生组件名称") - private String produceCommonComponents; - - @ApiModelProperty("试点任务名称") - private String pilotTasksName; - - @ApiModelProperty("试点任务编号") - private String pilotTasksCode; - - @ApiModelProperty("所属重大应用名称") - private String importantTaskName; - - @ApiModelProperty("所属重大应用编号") - private String importantTaskCode; - - @ApiModelProperty("所属子场景应用名称") - private String subSceneApplicationName; + @NotNull + private ProjectDto projectInfo; - @ApiModelProperty("试点文件") - private String experimentsFile; + @NotNull + private ProcessInstanceUserDto user; - @ApiModelProperty("新增form内容") - private String 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 new file mode 100644 index 0000000..b5e9ff9 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -0,0 +1,132 @@ +package com.ningdatech.pmapi.projectdeclared.manage; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; +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.enums.ProjectProessStageEnum; +import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; +import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; +import com.ningdatech.pmapi.projectdeclared.entity.dto.*; +import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; +import com.ningdatech.pmapi.projectdeclared.entity.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.vo.ProjectLibListItemVO; +import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.wflow.bean.entity.WflowModels; +import com.wflow.exception.BusinessException; +import com.wflow.workflow.bean.vo.ProcessStartParamsVo; +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; + +import java.time.LocalDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @Classname DeclaredProjectManage + * @Description + * @Date 2023/2/1 14:48 + * @Author PoffyZhang + */ +@Component +@Slf4j +@RequiredArgsConstructor +public class ConstructionPlanManage { + + private final IProjectService projectService; + + private final ProcessInstanceService processService; + + private final ProcessModelService processModelService; + + private final StateMachineUtils stateMachineUtils; + + /** + * 提交预审 + * @param dto + * @return + */ + public String startTheProcess(ConstructionPlanDto dto) { + Project projectInfo = projectService.getById(dto.getProjectId()); + + VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); + + String regionCode = projectInfo.getAreaCode(); + + WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) + .eq(WflowModels::getRegionCode, regionCode) + .eq(WflowModels::getFormName, ProjectProessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getDesc()) + .last("limit 1")); + + if (Objects.isNull(model)) { + log.error("此 【{}】区域找不到 建设申报流程配置", regionCode); + throw new BusinessException(String.format("此 【%s】区域找不到 建设申报流程配置", regionCode)); + } + + //首先要判断 项目当前状态 是不是 待预审 + VUtils.isTrue(!ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(projectInfo.getStatus()) || + !ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage())) + .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)) { + 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,dto.getConstructionPlanFile()); + + return instanceId; + } + + /** + * 提交预审项目 时 更新信息 + * + * @param project + * @param instanceId + */ + private void modifyProject(Project project, String instanceId,String constructionPlanFile) { + //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 + try { + project.setUpdateOn(LocalDateTime.now()); + project.setInstCode(instanceId); + project.setConstructionPlanFile(constructionPlanFile); + //调用状态机 进入下一个通过状态 + stateMachineUtils.execute(project,stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); + projectService.updateById(project); + } 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 810e69d..fc9d2ed 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 @@ -99,6 +99,7 @@ public class DeclaredProjectManage { public PageVo pageDraft(DeclaredProjectListParamDto params) { Page page = params.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProjectDraft.class) + .eq(ProjectDraft::getUserId,params.getUserId()) .ge(Objects.nonNull(params.getStartTime()), ProjectDraft::getCreateOn, params.getStartTime()) .le(Objects.nonNull(params.getEndTime()), ProjectDraft::getCreateOn, params.getEndTime()) .eq(Objects.nonNull(params.getProjectType()), ProjectDraft::getProjectType, params.getProjectType()) @@ -210,8 +211,10 @@ public class DeclaredProjectManage { * @return */ public Long saveToDraft(ProjectDraftSaveDto dto) { + ProjectDto projectInfo = dto.getProjectInfo(); ProjectDraft draft = new ProjectDraft(); - BeanUtils.copyProperties(dto, draft); + BeanUtils.copyProperties(projectInfo, draft); + draft.setUserId(dto.getUser().getUserId()); if (Objects.isNull(draft.getId())) { draft.setCreateOn(LocalDateTime.now()); } diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java index 6ff2647..4970683 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/project/ProjectStateTest.java @@ -36,8 +36,9 @@ public class ProjectStateTest extends AppTests { project.setInstCode("1"); project.setId(1L); project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); - project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); - stateMachineUtils.execute(project, ProjectStatusChangeEvent.UNDER_INTERNAL_PASS); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + //调用状态机 进入下一个通过状态 + stateMachineUtils.execute(project,stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); stopWatch.stop(); System.out.println("调用状态机结束 :" + stopWatch.getTotalTimeSeconds()); From 09da683c5f62e07e358b6e661b8333631c7f3859 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 13 Feb 2023 16:15:30 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E7=AE=B1=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectdeclared/entity/ProjectDraft.java | 145 ++----------------- .../projectdeclared/entity/vo/ProjectDraftVo.java | 154 +++------------------ .../manage/ConstructionPlanManage.java | 18 +-- .../manage/DeclaredProjectManage.java | 14 +- .../pmapi/projectlib/model/dto/ProjectDto.java | 3 +- 5 files changed, 45 insertions(+), 289 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java index ea2815b..d43c88b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/ProjectDraft.java @@ -67,13 +67,13 @@ public class ProjectDraft implements Serializable { private String contactPhone; @ApiModelProperty("建设单位名称") - private String buildUnitName; + private String buildOrgName; @ApiModelProperty("建设单位统一社会信用代码") - private String buildUnitCode; + private String buildOrgCode; @ApiModelProperty("建设单位浙政钉ID") - private String buildUnitZheJiangGovernmentDingId; + private String buildOrgZheJiangGovDingId; @ApiModelProperty("项目类型 1:建设 2:运维") private Integer projectType; @@ -132,10 +132,10 @@ public class ProjectDraft implements Serializable { private BigDecimal declareHaveAmount; @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") - private BigDecimal declareGovernmentOwnFinanceAmount; + private BigDecimal declareGovOwnFinanceAmount; @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") - private BigDecimal declareGovernmentSuperiorFinanceAmount; + private BigDecimal declareGovSuperiorFinanceAmount; @ApiModelProperty("银行贷款(万元)") private BigDecimal declareBankLendingAmount; @@ -159,10 +159,10 @@ public class ProjectDraft implements Serializable { private BigDecimal annualPlanHaveAmount; @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") - private BigDecimal annualPlanGovernmentOwnFinanceAmount; + private BigDecimal annualPlanGovOwnFinanceAmount; @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") - private BigDecimal annualPlanGovernmentSuperiorFinanceAmount; + private BigDecimal annualPlanGovSuperiorFinanceAmount; @ApiModelProperty("年度支付计划-银行贷款(万元)") private BigDecimal annualPlanBankLendingAmount; @@ -267,143 +267,20 @@ public class ProjectDraft implements Serializable { private BigDecimal approvedTotalInvestmentIncrease; @ApiModelProperty("上级主管部门") - private String higherSuperUnit; + private String higherSuperOrg; @ApiModelProperty("上级主管部门Code") - private String higherSuperUnitCode; + private String higherSuperOrgCode; @ApiModelProperty("主管部门名称") - private String superUnit; + private String superOrg; @ApiModelProperty("主管部门Code") - private String superUnitCode; + private String superOrgCode; @ApiModelProperty("前端所需验证字段") private Integer allApplicationsDone; - @ApiModelProperty("项目一级状态 10000 20000 30000") - private Integer projectStatusFirst; - - @ApiModelProperty("项目二级状态") - private Integer projectStatusSecond; - - @ApiModelProperty("应用名称") - private String applicationName; - - @ApiModelProperty("关联IRS现有应用") - private String relatedExistsApplication; - - @ApiModelProperty("关联IRS现有应用-IRS应用编码") - private String relatedExistsApplicationCode; - - @ApiModelProperty("应用类型") - private String applicationType; - - @ApiModelProperty("是否统建应用 0:否 1:是") - private Integer isUniteBuild; - - @ApiModelProperty("统建类型 1:全省统建 2:全市统建") - private Integer unionBuildKind; - - @ApiModelProperty("是否数改系统 0:否 1:是") - private Integer isDigitalModification; - - @ApiModelProperty("数改系统") - private String digitalModification; - - @ApiModelProperty("发布端") - private String publishSide; - - @ApiModelProperty("是否一本账场景应用名称 0:否 1:是") - private Integer isAccountAppName; - - @ApiModelProperty("一本账应用名称") - private String accountAppName; - - @ApiModelProperty("领域大脑一本账") - private String domainBrainAccount; - - @ApiModelProperty("是否业务协同 0:否 1:是") - private Integer isBizCooperate; - - @ApiModelProperty("业务协同描述") - private String bizCooperateInfo; - - @ApiModelProperty("使用范围") - private String usesRangeRemark; - - @ApiModelProperty("应用简介") - private String applicationSummary; - - @ApiModelProperty("应用备注") - private String applicationRemark; - - @ApiModelProperty("应用总投资测算明细-文件") - private String applicationEstimateFile; - - @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer secrecyGrade; - - @ApiModelProperty("密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer passwordGrade; - - @ApiModelProperty("是否符合国家信息技术应用创新相关规范 0:否 1:是") - private Integer nationalItSpec; - - @ApiModelProperty("是否使用政务云资源 0否 1是") - private Integer useGovCloud; - - @ApiModelProperty("云资源类型") - private String cloudsType; - - @ApiModelProperty("云资源基础规格") - private String cloudsFoundationSpecifications; - - @ApiModelProperty("云资源台数") - private Integer cloudsNumber; - - @ApiModelProperty("云资源用户描述") - private String cloudsDescription; - - @ApiModelProperty("网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机") - private Integer netEnv; - - @ApiModelProperty("是否使用公共数据 0否 1是") - private Integer useCommonData; - - @ApiModelProperty("数据名称") - private String dataName; - - @ApiModelProperty("是否使用公共组件 0否 1是") - private Integer useCommonComponent; - - @ApiModelProperty("使用的公共组件名称") - private String commonComponents; - - @ApiModelProperty("是否产生公共组件 0否 1是") - private Integer produceCommonComponent; - - @ApiModelProperty("预计产生组件名称") - private String produceCommonComponents; - - @ApiModelProperty("试点任务名称") - private String pilotTasksName; - - @ApiModelProperty("试点任务编号") - private String pilotTasksCode; - - @ApiModelProperty("所属重大应用名称") - private String importantTaskName; - - @ApiModelProperty("所属重大应用编号") - private String importantTaskCode; - - @ApiModelProperty("所属子场景应用名称") - private String subSceneApplicationName; - - @ApiModelProperty("试点文件") - private String experimentsFile; - @ApiModelProperty("项目应用") private String projectApplicationList; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java index 348df7a..5cb5c4e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java @@ -2,6 +2,7 @@ package com.ningdatech.pmapi.projectdeclared.entity.vo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -12,6 +13,8 @@ import lombok.NoArgsConstructor; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; /** *

@@ -65,13 +68,13 @@ public class ProjectDraftVo implements Serializable { private String contactPhone; @ApiModelProperty("建设单位名称") - private String buildUnitName; + private String buildOrgName; @ApiModelProperty("建设单位统一社会信用代码") - private String buildUnitCode; + private String buildOrgCode; @ApiModelProperty("建设单位浙政钉ID") - private String buildUnitZheJiangGovernmentDingId; + private String buildOrgZheJiangGovDingId; @ApiModelProperty("项目类型 1:建设 2:运维") private Integer projectType; @@ -130,10 +133,10 @@ public class ProjectDraftVo implements Serializable { private BigDecimal declareHaveAmount; @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") - private BigDecimal declareGovernmentOwnFinanceAmount; + private BigDecimal declareGovOwnFinanceAmount; @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") - private BigDecimal declareGovernmentSuperiorFinanceAmount; + private BigDecimal declareGovSuperiorFinanceAmount; @ApiModelProperty("银行贷款(万元)") private BigDecimal declareBankLendingAmount; @@ -157,10 +160,10 @@ public class ProjectDraftVo implements Serializable { private BigDecimal annualPlanHaveAmount; @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") - private BigDecimal annualPlanGovernmentOwnFinanceAmount; + private BigDecimal annualPlanGovOwnFinanceAmount; @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") - private BigDecimal annualPlanGovernmentSuperiorFinanceAmount; + private BigDecimal annualPlanGovSuperiorFinanceAmount; @ApiModelProperty("年度支付计划-银行贷款(万元)") private BigDecimal annualPlanBankLendingAmount; @@ -265,145 +268,28 @@ public class ProjectDraftVo implements Serializable { private BigDecimal approvedTotalInvestmentIncrease; @ApiModelProperty("上级主管部门") - private String higherSuperUnit; + private String higherSuperOrg; @ApiModelProperty("上级主管部门Code") - private String higherSuperUnitCode; + private String higherSuperOrgCode; @ApiModelProperty("主管部门名称") - private String superUnit; + private String superOrg; @ApiModelProperty("主管部门Code") - private String superUnitCode; + private String superOrgCode; @ApiModelProperty("前端所需验证字段") private Integer allApplicationsDone; - @ApiModelProperty("项目一级状态 10000 20000 30000") - private Integer projectStatusFirst; - - @ApiModelProperty("项目二级状态") - private Integer projectStatusSecond; - - @ApiModelProperty("应用名称") - private String applicationName; - - @ApiModelProperty("关联IRS现有应用") - private String relatedExistsApplication; - - @ApiModelProperty("关联IRS现有应用-IRS应用编码") - private String relatedExistsApplicationCode; - - @ApiModelProperty("应用类型") - private String applicationType; - - @ApiModelProperty("是否统建应用 0:否 1:是") - private Integer isUniteBuild; - - @ApiModelProperty("统建类型 1:全省统建 2:全市统建") - private Integer unionBuildKind; - - @ApiModelProperty("是否数改系统 0:否 1:是") - private Integer isDigitalModification; - - @ApiModelProperty("数改系统") - private String digitalModification; - - @ApiModelProperty("发布端") - private String publishSide; - - @ApiModelProperty("是否一本账场景应用名称 0:否 1:是") - private Integer isAccountAppName; - - @ApiModelProperty("一本账应用名称") - private String accountAppName; - - @ApiModelProperty("领域大脑一本账") - private String domainBrainAccount; - - @ApiModelProperty("是否业务协同 0:否 1:是") - private Integer isBizCooperate; - - @ApiModelProperty("业务协同描述") - private String bizCooperateInfo; - - @ApiModelProperty("使用范围") - private String usesRangeRemark; - - @ApiModelProperty("应用简介") - private String applicationSummary; - - @ApiModelProperty("应用备注") - private String applicationRemark; - - @ApiModelProperty("应用总投资测算明细-文件") - private String applicationEstimateFile; - - @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer secrecyGrade; - - @ApiModelProperty("密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer passwordGrade; - - @ApiModelProperty("是否符合国家信息技术应用创新相关规范 0:否 1:是") - private Integer nationalItSpec; - - @ApiModelProperty("是否使用政务云资源 0否 1是") - private Integer useGovCloud; - - @ApiModelProperty("云资源类型") - private String cloudsType; - - @ApiModelProperty("云资源基础规格") - private String cloudsFoundationSpecifications; - - @ApiModelProperty("云资源台数") - private Integer cloudsNumber; - - @ApiModelProperty("云资源用户描述") - private String cloudsDescription; - - @ApiModelProperty("网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机") - private Integer netEnv; - - @ApiModelProperty("是否使用公共数据 0否 1是") - private Integer useCommonData; - - @ApiModelProperty("数据名称") - private String dataName; - - @ApiModelProperty("是否使用公共组件 0否 1是") - private Integer useCommonComponent; - - @ApiModelProperty("使用的公共组件名称") - private String commonComponents; - - @ApiModelProperty("是否产生公共组件 0否 1是") - private Integer produceCommonComponent; - - @ApiModelProperty("预计产生组件名称") - private String produceCommonComponents; - - @ApiModelProperty("试点任务名称") - private String pilotTasksName; - - @ApiModelProperty("试点任务编号") - private String pilotTasksCode; - - @ApiModelProperty("所属重大应用名称") - private String importantTaskName; - - @ApiModelProperty("所属重大应用编号") - private String importantTaskCode; - - @ApiModelProperty("所属子场景应用名称") - private String subSceneApplicationName; - - @ApiModelProperty("试点文件") - private String experimentsFile; + @ApiModelProperty("项目应用") + private List applicationList; @ApiModelProperty("新增form内容") - private String formData; + private Map dynamicForm; + + @ApiModelProperty("用户id") + private String userId; private Long createBy; 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 b5e9ff9..0dcbbd9 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 @@ -1,26 +1,14 @@ package com.ningdatech.pmapi.projectdeclared.manage; -import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; 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.enums.ProjectProessStageEnum; +import com.ningdatech.pmapi.common.enumeration.ProjectProessStageEnum; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; import com.ningdatech.pmapi.projectdeclared.entity.dto.*; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; -import com.ningdatech.pmapi.projectdeclared.entity.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.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; @@ -29,16 +17,12 @@ 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; - import java.time.LocalDateTime; import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; /** * @Classname DeclaredProjectManage 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 26b88c6..6e4caf4 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 @@ -2,6 +2,7 @@ package com.ningdatech.pmapi.projectdeclared.manage; import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -14,7 +15,6 @@ import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamD import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredListItemVO; import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; @@ -104,8 +104,8 @@ public class DeclaredProjectManage { .le(Objects.nonNull(params.getEndTime()), ProjectDraft::getCreateOn, params.getEndTime()) .eq(Objects.nonNull(params.getProjectType()), ProjectDraft::getProjectType, params.getProjectType()) .eq(Objects.nonNull(params.getProjectYear()), ProjectDraft::getProjectYear, params.getProjectYear()) - .eq(Objects.nonNull(params.getProjectStage()), ProjectDraft::getProjectStatusFirst, params.getProjectStage()) - .eq(Objects.nonNull(params.getProjectStatus()), ProjectDraft::getProjectStatusSecond, params.getProjectStatus()) + .eq(Objects.nonNull(params.getProjectStage()), ProjectDraft::getStage, params.getProjectStage()) + .eq(Objects.nonNull(params.getProjectStatus()), ProjectDraft::getStatus, params.getProjectStatus()) .like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) .orderByDesc(ProjectDraft::getUpdateOn); projectDraftService.page(page, wrapper); @@ -124,6 +124,12 @@ public class DeclaredProjectManage { ProjectDraft draft = projectDraftService.getById(id); ProjectDraftVo vo = new ProjectDraftVo(); BeanUtils.copyProperties(draft, vo); + if(StringUtils.isNotBlank(draft.getProjectApplicationList())){ + vo.setApplicationList(JSONArray.parseArray(draft.getProjectApplicationList(),ProjectApplication.class)); + } + if(StringUtils.isNotBlank(draft.getDynamicForm())){ + vo.setDynamicForm(JSON.parseObject(draft.getProjectApplicationList(),Map.class)); + } return vo; } @@ -215,6 +221,8 @@ public class DeclaredProjectManage { ProjectDraft draft = new ProjectDraft(); BeanUtils.copyProperties(projectInfo, draft); draft.setUserId(dto.getUser().getUserId()); + draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm())); + draft.setProjectApplicationList(JSON.toJSONString(projectInfo.getApplicationList())); if (Objects.isNull(draft.getId())) { draft.setCreateOn(LocalDateTime.now()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java index 03c465c..5a78d68 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java @@ -9,6 +9,7 @@ import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; /** *

@@ -286,7 +287,7 @@ public class ProjectDto implements Serializable { private Integer processStatus; @ApiModelProperty("动态表单 json") - private String dynamicForm; + private Map dynamicForm; private Long createBy; From 1d440ff5bf7445e21ea879b74c66f101d6a2e69d Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 17:14:42 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=AF=BC=E5=85=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectlib/manage/AnnualPlanLibManage.java | 62 ++++++++++++++++++++-- .../projectlib/model/dto/AnnualLibImportDTO.java | 2 +- .../pmapi/sys/service/IMenuServiceTest.java | 47 ++++++++++++++++ 3 files changed, 106 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index fb83502..0391c86 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -1,8 +1,8 @@ package com.ningdatech.pmapi.projectlib.manage; -import cn.hutool.poi.excel.ExcelUtil; import com.alibaba.excel.EasyExcel; -import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -10,10 +10,12 @@ 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.basic.util.ValidUtil; 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.dto.AnnualLibImportDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; @@ -31,7 +33,6 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Map; import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; @@ -139,7 +140,60 @@ public class AnnualPlanLibManage { @Transactional(rollbackFor = Exception.class) public void importAnnualPlan(MultipartFile file) { try (InputStream inputStream = file.getInputStream()) { - EasyExcel.read(inputStream).sheet(0); + EasyExcel.read(inputStream, new AnalysisEventListener() { + + private List records = new ArrayList<>(); + + @Override + public void onException(Exception exception, AnalysisContext context) throws Exception { + super.onException(exception, context); + throw BizException.wrap("导入年度计划解析失败"); + } + + @Override + public void invoke(AnnualLibImportDTO data, AnalysisContext context) { + ValidUtil.valid(data); + Project project = new Project(); + project.setId(data.getProjectId()); + project.setProjectName(data.getProjectName()); + project.setProjectRemarks(data.getProjectRemarks()); + project.setEngineeringSpeedOne(data.getEngineeringSpeedOne()); + project.setEngineeringSpeedTwo(data.getEngineeringSpeedTwo()); + project.setEngineeringSpeedThree(data.getEngineeringSpeedThree()); + project.setEngineeringSpeedFour(data.getEngineeringSpeedFour()); + project.setAnnualPlanAmount(data.getAnnualPlanAmount()); + project.setDeclareOtherAmount(data.getDeclareOtherAmount()); + project.setBuildBasis(data.getBuildBasis()); + project.setBuildOrgName(data.getBuildUnitName()); + project.setDeclareBankLendingAmount(data.getDeclareBankLendingAmount()); + project.setDeclareGovOwnFinanceAmount(data.getDeclareGovOwnFinanceAmount()); + project.setDeclareGovSuperiorFinanceAmount(data.getDeclareGovSuperiorFinanceAmount()); + project.setDeclareHaveAmount(data.getDeclareHaveAmount()); + project.setDeclareOtherAmount(data.getDeclareOtherAmount()); + project.setContactName(data.getContactName()); + project.setResponsibleMan(data.getResponsibleMan()); + String[] dataArr = data.getBuildCycle().split("至"); + project.setBeginTime(dataArr[0].trim()); + project.setEndTime(dataArr[1].trim()); + project.setProjectIntroduction(data.getProjectIntroduction()); + project.setIsFirst(data.getIsFirst().equals("新建") ? 1 : 0); + records.add(project); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + if (records.isEmpty()) { + throw BizException.wrap("导入年度计划为空"); + } + List projectIds = CollUtils.fieldList(records, Project::getId); + long count = projectService.count(Wrappers.lambdaQuery(Project.class) + .in(Project::getId, projectIds)); + if (count != records.size()) { + throw BizException.wrap("请确保所有项目都存在"); + } + projectService.updateBatchById(records); + } + }).sheet(0).doReadSync(); } catch (IOException e) { throw BizException.wrap("导入年度计划失败"); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java index 6b40bed..fbfa348 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/AnnualLibImportDTO.java @@ -52,7 +52,7 @@ public class AnnualLibImportDTO { @NotNull(message = "年度投资额不能为空") @ExcelProperty("年度投资额") - private BigDecimal annualPlanAMount; + private BigDecimal annualPlanAmount; @ExcelProperty("自有资金") @NotNull(message = "自由资金不能为空") diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java index 4ed9825..78af962 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/service/IMenuServiceTest.java @@ -1,9 +1,15 @@ package com.ningdatech.pmapi.sys.service; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.FileUtil; import cn.hutool.db.Db; import cn.hutool.db.Entity; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; import com.ningdatech.pmapi.AppTests; import com.ningdatech.pmapi.sys.model.entity.Menu; +import com.ningdatech.pmapi.sys.model.entity.RoleMenu; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -34,4 +40,45 @@ class IMenuServiceTest extends AppTests { }); } + + @Autowired + private IRoleMenuService roleMenuService; + + @Test + public void initMenu() { + /*String str = FileUtil.readString("/Users/wendy/Desktop/long_text_2023-02-13-15-28-42.txt", "UTF-8"); + List obj = JSONUtil.toList(str, JSONObject.class); + save(obj, 0);*/ + menuService.list().forEach(w -> { + roleMenuService.save(new RoleMenu(){{ + setRoleId(1L); + setMenuId(w.getId()); + }}); + }); + } + + public void save(List objs, long parentId) { + objs.forEach(w -> { + Menu menu = new Menu(); + menu.setActiveMenu(w.getStr("activeMenu")); + menu.setComponent(w.getStr("component")); + menu.setIcon(w.getStr("icon")); + menu.setPath(w.getStr("path")); + menu.setName(w.getStr("path").replace("/", "")); + menu.setTopMenu(w.getStr("topMenu")); + menu.setTitle(w.getStr("title")); + menu.setHidden(w.getBool("hidden")); + menu.setPid(parentId); + menu.setRedirect(w.getStr("redirect")); + menu.setSort(w.getInt("sort")); + menu.setDataScopeOption(""); + menu.setHasDataScope(false); + menuService.save(menu); + List children = w.getBeanList("children", JSONObject.class); + if (CollUtil.isNotEmpty(children)) { + save(children, menu.getId()); + } + }); + } + } \ No newline at end of file From f29f6f0220bd2f0d4b8b42698fd54d740a9dbd29 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 17:21:43 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=BC=96=E8=BE=91=E8=A1=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ConstructionPlanManage.java | 27 ++++++---------------- .../controller/AnnualPlanController.java | 7 ++++++ .../projectlib/manage/AnnualPlanLibManage.java | 5 ++++ 3 files changed, 19 insertions(+), 20 deletions(-) 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 b5e9ff9..3d528d3 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 @@ -1,26 +1,15 @@ package com.ningdatech.pmapi.projectdeclared.manage; -import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; 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.enums.ProjectProessStageEnum; +import com.ningdatech.pmapi.common.enumeration.ProjectProessStageEnum; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; -import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; -import com.ningdatech.pmapi.projectdeclared.entity.dto.*; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; -import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ConstructionPlanDto; +import com.ningdatech.pmapi.projectdeclared.entity.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.ProjectApplication; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; -import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; import com.wflow.exception.BusinessException; @@ -29,16 +18,13 @@ 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; import java.time.LocalDateTime; import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; /** * @Classname DeclaredProjectManage @@ -61,6 +47,7 @@ public class ConstructionPlanManage { /** * 提交预审 + * * @param dto * @return */ @@ -104,7 +91,7 @@ public class ConstructionPlanManage { log.info("提交预审项目成功 【{}】", instanceId); //保存建设项目 - modifyProject(projectInfo, instanceId,dto.getConstructionPlanFile()); + modifyProject(projectInfo, instanceId, dto.getConstructionPlanFile()); return instanceId; } @@ -115,14 +102,14 @@ public class ConstructionPlanManage { * @param project * @param instanceId */ - private void modifyProject(Project project, String instanceId,String constructionPlanFile) { + private void modifyProject(Project project, String instanceId, String constructionPlanFile) { //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 try { project.setUpdateOn(LocalDateTime.now()); project.setInstCode(instanceId); project.setConstructionPlanFile(constructionPlanFile); //调用状态机 进入下一个通过状态 - stateMachineUtils.execute(project,stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); + stateMachineUtils.execute(project, stateMachineUtils.getProjectStatusPassEvent(project.getStatus())); projectService.updateById(project); } catch (Exception e) { log.error("提交建设方案 项目信息修改 错误 ", e); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index d50be49..7098b1d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -14,6 +14,7 @@ import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; /** @@ -66,4 +67,10 @@ public class AnnualPlanController { annualPlanLibManage.importAnnualPlan(file); } + @GetMapping("/exportAnnualPlanEditTable") + @ApiOperation("导出年度计划编辑表") + public void exportAnnualPlanEditTable(HttpServletResponse response) { + annualPlanLibManage.exportAnnualPlanEditTable(response); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 0391c86..7b0ceba 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -28,6 +28,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -199,4 +200,8 @@ public class AnnualPlanLibManage { } } + public void exportAnnualPlanEditTable(HttpServletResponse response) { + // TODO + } + } From 9d442d98f197517a7726691461f6e2091bb469ad Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 13 Feb 2023 17:35:39 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=BB=BA=E8=AE=BE=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E7=94=B3=E6=8A=A5=20=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ConstructionPlanController.java | 4 ++-- .../manage/ConstructionPlanManage.java | 6 +++--- .../manage/DeclaredProjectManage.java | 22 ++++++++-------------- 3 files changed, 13 insertions(+), 19 deletions(-) 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 8c3dbda..c64adaf 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 @@ -35,9 +35,9 @@ public class ConstructionPlanController { @ApiOperation(value = "可申报建设方案项目列表", notes = "可申报建设方案项目列表") @GetMapping("/list") public PageVo list(@Validated @ModelAttribute ProjectListReq req) { - //项目阶段 状态 已定 待预审 + //项目阶段 状态 已定 方案待申报 req.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); - req.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + req.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); return projectLibManage.projectLibList(req); } 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 0dcbbd9..bb6a190 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 @@ -65,8 +65,8 @@ public class ConstructionPlanManage { throw new BusinessException(String.format("此 【%s】区域找不到 建设申报流程配置", regionCode)); } - //首先要判断 项目当前状态 是不是 待预审 - VUtils.isTrue(!ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(projectInfo.getStatus()) || + //首先要判断 项目当前状态 是不是 方案待申报 + VUtils.isTrue(!ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode().equals(projectInfo.getStatus()) || !ProjectStatusEnum.NOT_APPROVED.getCode().equals(projectInfo.getStage())) .throwMessage("提交失败 该项目不是 待预审状态或者未立项阶段"); //TODO 再判断 该项目是否 真实走完 单位内部审批 @@ -85,7 +85,7 @@ public class ConstructionPlanManage { } params.setFormData(dto.getFormData()); String instanceId = processService.startProcess(model.getProcessDefId(), params); - log.info("提交预审项目成功 【{}】", instanceId); + log.info("建设方案项目申报成功 【{}】", instanceId); //保存建设项目 modifyProject(projectInfo, instanceId,dto.getConstructionPlanFile()); 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 6e4caf4..b594e00 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 @@ -86,16 +86,6 @@ public class DeclaredProjectManage { return PageVo.of(res, page.getTotal()); } - public ProjectDeclaredDetailVO detail(Long id) { - Project project = projectService.getById(id); - ProjectDeclaredDetailVO vo = new ProjectDeclaredDetailVO(); - BeanUtils.copyProperties(project, vo); - List projectApptions = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectId, id)); - vo.setProjectApplications(projectApptions); - return vo; - } - public PageVo pageDraft(DeclaredProjectListParamDto params) { Page page = params.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProjectDraft.class) @@ -125,10 +115,10 @@ public class DeclaredProjectManage { ProjectDraftVo vo = new ProjectDraftVo(); BeanUtils.copyProperties(draft, vo); if(StringUtils.isNotBlank(draft.getProjectApplicationList())){ - vo.setApplicationList(JSONArray.parseArray(draft.getProjectApplicationList(),ProjectApplication.class)); + vo.setApplicationList(JSON.parseArray(draft.getProjectApplicationList(),ProjectApplication.class)); } if(StringUtils.isNotBlank(draft.getDynamicForm())){ - vo.setDynamicForm(JSON.parseObject(draft.getProjectApplicationList(),Map.class)); + vo.setDynamicForm(JSON.parseObject(draft.getDynamicForm(),Map.class)); } return vo; } @@ -221,8 +211,12 @@ public class DeclaredProjectManage { ProjectDraft draft = new ProjectDraft(); BeanUtils.copyProperties(projectInfo, draft); draft.setUserId(dto.getUser().getUserId()); - draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm())); - draft.setProjectApplicationList(JSON.toJSONString(projectInfo.getApplicationList())); + if(CollUtil.isNotEmpty(projectInfo.getDynamicForm())){ + draft.setDynamicForm(JSON.toJSONString(projectInfo.getDynamicForm())); + } + if(CollUtil.isNotEmpty(projectInfo.getApplicationList())){ + draft.setProjectApplicationList(JSON.toJSONString(projectInfo.getApplicationList())); + } if (Objects.isNull(draft.getId())) { draft.setCreateOn(LocalDateTime.now()); } From 7029c920698d1a60caa368e15c7ba2f7d8f620b5 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 17:37:15 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/dto/DeclaredProjectDto.java | 6 +- .../entity/dto/PreDeclaredProjectDto.java | 1 - .../entity/dto/ProjectDraftSaveDto.java | 4 +- .../manage/DeclaredProjectManage.java | 9 +- .../controller/AnnualPlanController.java | 8 + .../projectlib/manage/AnnualPlanLibManage.java | 7 + .../model/dto/ProjectApplicationDTO.java | 169 ++++++++++++ .../model/dto/ProjectApplicationDto.java | 169 ------------ .../pmapi/projectlib/model/dto/ProjectDTO.java | 295 +++++++++++++++++++++ .../pmapi/projectlib/model/dto/ProjectDto.java | 295 --------------------- 10 files changed, 487 insertions(+), 476 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java index 31e2e9d..f88bd05 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java @@ -2,15 +2,13 @@ package com.ningdatech.pmapi.projectdeclared.entity.dto; import cn.hutool.core.collection.CollUtil; import com.google.common.collect.Maps; -import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; -import com.ningdatech.pmapi.projectlib.model.entity.Project; +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; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Map; @@ -28,7 +26,7 @@ import java.util.Map; public class DeclaredProjectDto implements Serializable { @NotNull - private ProjectDto projectInfo; + private ProjectDTO projectInfo; private Map 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 index fae8f58..92d2e62 100644 --- 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 @@ -2,7 +2,6 @@ package com.ningdatech.pmapi.projectdeclared.entity.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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java index 0fdf995..62070a3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java @@ -1,6 +1,6 @@ package com.ningdatech.pmapi.projectdeclared.entity.dto; -import com.ningdatech.pmapi.projectlib.model.dto.ProjectDto; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import io.swagger.annotations.ApiModel; import lombok.*; @@ -26,7 +26,7 @@ public class ProjectDraftSaveDto implements Serializable { private static final long serialVersionUID = 1L; @NotNull - private ProjectDto projectInfo; + private ProjectDTO projectInfo; @NotNull private ProcessInstanceUserDto user; 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 26b88c6..a1d78b3 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 @@ -14,11 +14,10 @@ import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamD import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredListItemVO; import com.ningdatech.pmapi.projectdeclared.entity.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.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; @@ -134,7 +133,7 @@ public class DeclaredProjectManage { * @return */ public String startTheProcess(DeclaredProjectDto dto) { - ProjectDto projectInfo = dto.getProjectInfo(); + ProjectDTO projectInfo = dto.getProjectInfo(); String regionCode = projectInfo.getAreaCode(); WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) @@ -175,7 +174,7 @@ public class DeclaredProjectManage { * @param projectDto * @param instanceId */ - private void saveProject(ProjectDto projectDto, String instanceId, String regionCode) { + private void saveProject(ProjectDTO projectDto, String instanceId, String regionCode) { //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 try { //保存项目表信息 @@ -211,7 +210,7 @@ public class DeclaredProjectManage { * @return */ public Long saveToDraft(ProjectDraftSaveDto dto) { - ProjectDto projectInfo = dto.getProjectInfo(); + ProjectDTO projectInfo = dto.getProjectInfo(); ProjectDraft draft = new ProjectDraft(); BeanUtils.copyProperties(projectInfo, draft); draft.setUserId(dto.getUser().getUserId()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java index 7098b1d..2eeb57a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; @@ -73,4 +74,11 @@ public class AnnualPlanController { annualPlanLibManage.exportAnnualPlanEditTable(response); } + @GetMapping("/modify") + @ApiOperation("年度计划编辑") + @WebLog("年度计划编辑") + public void modify(@RequestBody ProjectDTO req) { + annualPlanLibManage.updateAnnualPlan(req); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java index 7b0ceba..2a5f18b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.projectlib.manage; +import cn.hutool.core.bean.BeanUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; @@ -16,6 +17,7 @@ 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.dto.AnnualLibImportDTO; +import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectApprovedReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; @@ -204,4 +206,9 @@ public class AnnualPlanLibManage { // TODO } + public void updateAnnualPlan(ProjectDTO req) { + Project project = BeanUtil.copyProperties(req, Project.class); + projectService.updateById(project); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java new file mode 100644 index 0000000..a256131 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDTO.java @@ -0,0 +1,169 @@ +package com.ningdatech.pmapi.projectlib.model.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 项目应用表 + *

+ * + * @author WendyYang + * @since 2023-02-05 + */ +@ApiModel(value = "NdProjectApplication对象", description = "") +@Data +public class ProjectApplicationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("应用ID") + private Long id; + + @ApiModelProperty("项目ID") + private Long projectId; + + @ApiModelProperty("是否初次建设 0否 1是") + private Integer isFirst; + + @ApiModelProperty("应用名称") + private String applicationName; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; + + @ApiModelProperty("删除时间") + private LocalDateTime deleteOn; + + @ApiModelProperty("关联IRS现有应用") + private String relatedExistsApplication; + + @ApiModelProperty("关联IRS现有应用-IRS应用编码") + private String relatedExistsApplicationCode; + + @ApiModelProperty("应用类型") + private String applicationType; + + @ApiModelProperty("建设层级 1:国家 2:省级 3:市级 4:县(市、区)") + private Integer buildLevel; + + @ApiModelProperty("是否统建应用 0:否 1:是") + private Integer isUniteBuild; + + @ApiModelProperty("统建类型 1:全省统建 2:全市统建") + private Integer unionBuildKind; + + @ApiModelProperty("是否数改系统 0:否 1:是") + private Integer isDigitalModification; + + @ApiModelProperty("数改系统") + private String digitalModification; + + @ApiModelProperty("业务领域") + private String bizDomain; + + @ApiModelProperty("发布端") + private String publishSide; + + @ApiModelProperty("是否一本账场景应用名称 0:否 1:是") + private Integer isAccountAppName; + + @ApiModelProperty("一本账应用名称") + private String accountAppName; + + @ApiModelProperty("领域大脑一本账") + private String domainBrainAccount; + + @ApiModelProperty("是否业务协同 0:否 1:是") + private Integer isBizCooperate; + + @ApiModelProperty("业务协同描述") + private String bizCooperateInfo; + + @ApiModelProperty("使用范围") + private String usesRangeRemark; + + @ApiModelProperty("应用简介") + private String applicationSummary; + + @ApiModelProperty("应用备注") + private String applicationRemark; + + @ApiModelProperty("应用总投资测算明细-文件") + private String applicationEstimateFile; + + @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") + private Integer secrecyGrade; + + @ApiModelProperty("密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级") + private Integer passwordGrade; + + @ApiModelProperty("是否符合国家信息技术应用创新相关规范 0:否 1:是") + private Integer nationalItSpec; + + @ApiModelProperty("是否使用政务云资源 0否 1是") + private Integer useGovCloud; + + @ApiModelProperty("云资源类型") + private String cloudsType; + + @ApiModelProperty("云资源基础规格") + private String cloudsFoundationSpecifications; + + @ApiModelProperty("云资源台数") + private Integer cloudsNumber; + + @ApiModelProperty("云资源用户描述") + private String cloudsDescription; + + @ApiModelProperty("网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机") + private Integer netEnv; + + @ApiModelProperty("是否使用公共数据 0否 1是") + private Integer useCommonData; + + @ApiModelProperty("数据名称") + private String dataName; + + @ApiModelProperty("是否使用公共组件 0否 1是") + private Integer useCommonComponent; + + @ApiModelProperty("使用的公共组件名称") + private String commonComponents; + + @ApiModelProperty("是否产生公共组件 0否 1是") + private Integer produceCommonComponent; + + @ApiModelProperty("预计产生组件名称") + private String produceCommonComponents; + + @ApiModelProperty("试点任务名称") + private String pilotTasksName; + + @ApiModelProperty("试点任务编号") + private String pilotTasksCode; + + @ApiModelProperty("所属重大应用名称") + private String importantTaskName; + + @ApiModelProperty("所属重大应用编号") + private String importantTaskCode; + + @ApiModelProperty("所属子场景应用名称") + private String subSceneApplicationName; + + @ApiModelProperty("试点文件") + private String experimentsFile; + + private Long createBy; + + private Long updateBy; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java deleted file mode 100644 index e55d4c8..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectApplicationDto.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.ningdatech.pmapi.projectlib.model.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - *

- * 项目应用表 - *

- * - * @author WendyYang - * @since 2023-02-05 - */ -@ApiModel(value = "NdProjectApplication对象", description = "") -@Data -public class ProjectApplicationDto implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty("应用ID") - private Long id; - - @ApiModelProperty("项目ID") - private Long projectId; - - @ApiModelProperty("是否初次建设 0否 1是") - private Integer isFirst; - - @ApiModelProperty("应用名称") - private String applicationName; - - @ApiModelProperty("创建时间") - private LocalDateTime createOn; - - @ApiModelProperty("更新时间") - private LocalDateTime updateOn; - - @ApiModelProperty("删除时间") - private LocalDateTime deleteOn; - - @ApiModelProperty("关联IRS现有应用") - private String relatedExistsApplication; - - @ApiModelProperty("关联IRS现有应用-IRS应用编码") - private String relatedExistsApplicationCode; - - @ApiModelProperty("应用类型") - private String applicationType; - - @ApiModelProperty("建设层级 1:国家 2:省级 3:市级 4:县(市、区)") - private Integer buildLevel; - - @ApiModelProperty("是否统建应用 0:否 1:是") - private Integer isUniteBuild; - - @ApiModelProperty("统建类型 1:全省统建 2:全市统建") - private Integer unionBuildKind; - - @ApiModelProperty("是否数改系统 0:否 1:是") - private Integer isDigitalModification; - - @ApiModelProperty("数改系统") - private String digitalModification; - - @ApiModelProperty("业务领域") - private String bizDomain; - - @ApiModelProperty("发布端") - private String publishSide; - - @ApiModelProperty("是否一本账场景应用名称 0:否 1:是") - private Integer isAccountAppName; - - @ApiModelProperty("一本账应用名称") - private String accountAppName; - - @ApiModelProperty("领域大脑一本账") - private String domainBrainAccount; - - @ApiModelProperty("是否业务协同 0:否 1:是") - private Integer isBizCooperate; - - @ApiModelProperty("业务协同描述") - private String bizCooperateInfo; - - @ApiModelProperty("使用范围") - private String usesRangeRemark; - - @ApiModelProperty("应用简介") - private String applicationSummary; - - @ApiModelProperty("应用备注") - private String applicationRemark; - - @ApiModelProperty("应用总投资测算明细-文件") - private String applicationEstimateFile; - - @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer secrecyGrade; - - @ApiModelProperty("密码测评级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer passwordGrade; - - @ApiModelProperty("是否符合国家信息技术应用创新相关规范 0:否 1:是") - private Integer nationalItSpec; - - @ApiModelProperty("是否使用政务云资源 0否 1是") - private Integer useGovCloud; - - @ApiModelProperty("云资源类型") - private String cloudsType; - - @ApiModelProperty("云资源基础规格") - private String cloudsFoundationSpecifications; - - @ApiModelProperty("云资源台数") - private Integer cloudsNumber; - - @ApiModelProperty("云资源用户描述") - private String cloudsDescription; - - @ApiModelProperty("网络环境 1:政务内网 2:政务外网 3:互联网 4:业务专网 5:单机") - private Integer netEnv; - - @ApiModelProperty("是否使用公共数据 0否 1是") - private Integer useCommonData; - - @ApiModelProperty("数据名称") - private String dataName; - - @ApiModelProperty("是否使用公共组件 0否 1是") - private Integer useCommonComponent; - - @ApiModelProperty("使用的公共组件名称") - private String commonComponents; - - @ApiModelProperty("是否产生公共组件 0否 1是") - private Integer produceCommonComponent; - - @ApiModelProperty("预计产生组件名称") - private String produceCommonComponents; - - @ApiModelProperty("试点任务名称") - private String pilotTasksName; - - @ApiModelProperty("试点任务编号") - private String pilotTasksCode; - - @ApiModelProperty("所属重大应用名称") - private String importantTaskName; - - @ApiModelProperty("所属重大应用编号") - private String importantTaskCode; - - @ApiModelProperty("所属子场景应用名称") - private String subSceneApplicationName; - - @ApiModelProperty("试点文件") - private String experimentsFile; - - private Long createBy; - - private Long updateBy; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java new file mode 100644 index 0000000..c0d68aa --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java @@ -0,0 +1,295 @@ +package com.ningdatech.pmapi.projectlib.model.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +/** + *

+ * + *

+ * + * @author zpf + * @since 2023-02-03 + */ +@Data +@ApiModel(value = "NdProjectDto", description = "") +public class ProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + @ApiModelProperty("所属地区编号") + private String areaCode; + + @ApiModelProperty("所属地区名称") + private String area; + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("是否临时增补 0:否 1:是") + private Integer isTemporaryAugment; + + @ApiModelProperty("项目负责人") + private String responsibleMan; + + @ApiModelProperty("负责人手机号码") + private String responsibleManMobile; + + @ApiModelProperty("项目联系人") + private String contactName; + + @ApiModelProperty("项目联系人手机号码") + private String contactPhone; + + @ApiModelProperty("建设单位名称") + private String buildOrgName; + + @ApiModelProperty("建设单位统一社会信用代码") + private String buildOrgCode; + + @ApiModelProperty("建设单位浙政钉ID") + private String buildOrgZheJiangGovDingId; + + @ApiModelProperty("项目类型 1:建设 2:运维") + private Integer projectType; + + @ApiModelProperty("是否首次新建 0:否 1:是") + private Integer isFirst; + + @ApiModelProperty("项目预算年度") + private Integer projectYear; + + @ApiModelProperty("项目建设起始时间") + private String beginTime; + + @ApiModelProperty("项目建设终止时间") + private String endTime; + + @ApiModelProperty("四大体系 1:业务应用 2:应用支撑 3:数据资源 4:基础设施") + private Integer fourSystems; + + @ApiModelProperty("是否数字化改革项目 0:否 1:是") + private Integer isDigitalReform; + + @ApiModelProperty("综合业务领域") + private String bizDomain; + + @ApiModelProperty("建设层级 1:国家级 2:省级 3:省本级 4:市级 5:市本级 6:区县 7乡镇") + private Integer buildLevel; + + @ApiModelProperty("立项依据") + private String buildBasis; + + @ApiModelProperty("发改编码") + private String developCode; + + @ApiModelProperty("财政编码") + private String financialCode; + + @ApiModelProperty("是否上云 0:否 1:是") + private Integer isCloud; + + private String cloudType; + + @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") + private Integer protectionLevel; + + @ApiModelProperty("是否密评 0:否 1:是") + private Integer isSecretComments; + + @ApiModelProperty("项目简介") + private String projectIntroduction; + + @ApiModelProperty("资金申报情况-申报金额(万元)") + private BigDecimal declareAmount; + + @ApiModelProperty("资金申报情况-自有金额(万元)") + private BigDecimal declareHaveAmount; + + @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") + private BigDecimal declareGovOwnFinanceAmount; + + @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") + private BigDecimal declareGovSuperiorFinanceAmount; + + @ApiModelProperty("银行贷款(万元)") + private BigDecimal declareBankLendingAmount; + + @ApiModelProperty("其它资金(万元)") + private BigDecimal declareOtherAmount; + + @ApiModelProperty("资金分配情况-软件开发(万元)") + private BigDecimal softwareDevelopmentAmount; + + @ApiModelProperty("资金分配情况-云资源、硬件购置(万元)") + private BigDecimal cloudHardwarePurchaseAmount; + + @ApiModelProperty("资金分配情况-第三方服务(万元)") + private BigDecimal thirdPartyAmount; + + @ApiModelProperty("年度支付计划-年度支付计划(万元)") + private BigDecimal annualPlanAmount; + + @ApiModelProperty("年度支付计划-自有金额(万元)") + private BigDecimal annualPlanHaveAmount; + + @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") + private BigDecimal annualPlanGovOwnFinanceAmount; + + @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") + private BigDecimal annualPlanGovSuperiorFinanceAmount; + + @ApiModelProperty("年度支付计划-银行贷款(万元)") + private BigDecimal annualPlanBankLendingAmount; + + @ApiModelProperty("年度支付计划-其它资金(万元)") + private BigDecimal annualPlanOtherAmount; + + @ApiModelProperty("立项批复资金(万元)") + private BigDecimal approvalAmount; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") + private LocalDateTime annualPlanAddTime; + + @ApiModelProperty("核心业务-核心业务模块") + private String coreBusiness; + + @ApiModelProperty("安全投入-投入项") + private String safetyInputTitle; + + @ApiModelProperty("安全投入-内容描述") + private String safetyInputDescribe; + + @ApiModelProperty("安全投入-金额(万元)") + private BigDecimal safetyInputAmount; + + @ApiModelProperty("附件-初步方案") + private String preliminaryPlanFile; + + @ApiModelProperty("附件-佐证材料") + private String supportingMaterialsFile; + + @ApiModelProperty("附件-项目总投资测算明细") + private String calculationTotalInvestmentFile; + + @ApiModelProperty("附件-申报单位主要职责(单位三定方案)") + private String mainResponsibilitiesApplicantFile; + + @ApiModelProperty("备注") + private String projectRemarks; + + @ApiModelProperty("是否包含应用 0:否 1:是") + private Integer includeApplication; + + @ApiModelProperty("工程形象进度-第一季度") + private String engineeringSpeedOne; + + @ApiModelProperty("工程形象进度-第二季度") + private String engineeringSpeedTwo; + + @ApiModelProperty("工程形象进度-第三季度") + private String engineeringSpeedThree; + + @ApiModelProperty("工程形象进度-第四季度") + private String engineeringSpeedFour; + + @ApiModelProperty("核心业务-是否开启核心业务模块 false:关闭 true:开启") + private Boolean isOpenCoreBusiness; + + @ApiModelProperty("安全投入-是否开启安全投入模块 false:关闭 true:开启") + private Boolean isOpenSafetyInput; + + @ApiModelProperty("工程形象进度-是否开启 false:关闭 true:开启") + private Boolean isEngineeringSpeed; + + @ApiModelProperty("附件-是否开启 false:关闭 true:开启") + private Boolean isAccessories; + + @ApiModelProperty("备注-是否开启 false:关闭 true:开启") + private Boolean isRemarks; + + @ApiModelProperty("年度支付计划-是否开启 false:关闭 true:开启") + private Boolean isAnnualPlanAmount; + + @ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启") + private Boolean isInnovateWholeProvinceShare; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + @ApiModelProperty("流程实例编号") + private String instCode; + + @ApiModelProperty("安全投入-模块信息") + private String safetyInputModular; + + @ApiModelProperty("项目申报pdf") + private String projectPdf; + + @ApiModelProperty("立项申报pdf") + private String declarationPdf; + + @ApiModelProperty("建设周期(月)") + private String buildCycle; + + @ApiModelProperty("建设方案文件") + private String constructionPlanFile; + + @ApiModelProperty("立项批复文件") + private String approvedFile; + + @ApiModelProperty("批复金额") + private BigDecimal approvedTotalInvestmentIncrease; + + @ApiModelProperty("上级主管部门") + private String higherSuperOrg; + + @ApiModelProperty("上级主管部门Code") + private String higherSuperOrgCode; + + @ApiModelProperty("主管部门名称") + private String superOrg; + + @ApiModelProperty("主管部门Code") + private String superOrgCode; + + @ApiModelProperty("前端所需验证字段") + private Integer allApplicationsDone; + + @ApiModelProperty("流程实例id") + private String processInsId; + + @ApiModelProperty("流程实例 formId") + private String formId; + + @ApiModelProperty("项目应用实例") + private List applicationList; + + @ApiModelProperty("流程状态") + private Integer processStatus; + + @ApiModelProperty("动态表单 json") + private String dynamicForm; + + private Long createBy; + + private Long updateBy; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java deleted file mode 100644 index 03c465c..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.ningdatech.pmapi.projectlib.model.dto; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - *

- * - *

- * - * @author zpf - * @since 2023-02-03 - */ -@Data -@ApiModel(value = "NdProjectDto", description = "") -public class ProjectDto implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty("主键") - private Long id; - - @ApiModelProperty("所属地区编号") - private String areaCode; - - @ApiModelProperty("所属地区名称") - private String area; - - @ApiModelProperty("项目阶段") - private Integer stage; - - @ApiModelProperty("项目状态") - private Integer status; - - @ApiModelProperty("项目名称") - private String projectName; - - @ApiModelProperty("是否临时增补 0:否 1:是") - private Integer isTemporaryAugment; - - @ApiModelProperty("项目负责人") - private String responsibleMan; - - @ApiModelProperty("负责人手机号码") - private String responsibleManMobile; - - @ApiModelProperty("项目联系人") - private String contactName; - - @ApiModelProperty("项目联系人手机号码") - private String contactPhone; - - @ApiModelProperty("建设单位名称") - private String buildOrgName; - - @ApiModelProperty("建设单位统一社会信用代码") - private String buildOrgCode; - - @ApiModelProperty("建设单位浙政钉ID") - private String buildOrgZheJiangGovDingId; - - @ApiModelProperty("项目类型 1:建设 2:运维") - private Integer projectType; - - @ApiModelProperty("是否首次新建 0:否 1:是") - private Integer isFirst; - - @ApiModelProperty("项目预算年度") - private Integer projectYear; - - @ApiModelProperty("项目建设起始时间") - private String beginTime; - - @ApiModelProperty("项目建设终止时间") - private String endTime; - - @ApiModelProperty("四大体系 1:业务应用 2:应用支撑 3:数据资源 4:基础设施") - private Integer fourSystems; - - @ApiModelProperty("是否数字化改革项目 0:否 1:是") - private Integer isDigitalReform; - - @ApiModelProperty("综合业务领域") - private String bizDomain; - - @ApiModelProperty("建设层级 1:国家级 2:省级 3:省本级 4:市级 5:市本级 6:区县 7乡镇") - private Integer buildLevel; - - @ApiModelProperty("立项依据") - private String buildBasis; - - @ApiModelProperty("发改编码") - private String developCode; - - @ApiModelProperty("财政编码") - private String financialCode; - - @ApiModelProperty("是否上云 0:否 1:是") - private Integer isCloud; - - private String cloudType; - - @ApiModelProperty("等保级别 1:一级 2:二级 3:三级 4:四级 5:五级") - private Integer protectionLevel; - - @ApiModelProperty("是否密评 0:否 1:是") - private Integer isSecretComments; - - @ApiModelProperty("项目简介") - private String projectIntroduction; - - @ApiModelProperty("资金申报情况-申报金额(万元)") - private BigDecimal declareAmount; - - @ApiModelProperty("资金申报情况-自有金额(万元)") - private BigDecimal declareHaveAmount; - - @ApiModelProperty("资金申报情况-政府投资-本级财政资金(万元)") - private BigDecimal declareGovOwnFinanceAmount; - - @ApiModelProperty("资金申报情况-政府投资-上级补助资金(万元)") - private BigDecimal declareGovSuperiorFinanceAmount; - - @ApiModelProperty("银行贷款(万元)") - private BigDecimal declareBankLendingAmount; - - @ApiModelProperty("其它资金(万元)") - private BigDecimal declareOtherAmount; - - @ApiModelProperty("资金分配情况-软件开发(万元)") - private BigDecimal softwareDevelopmentAmount; - - @ApiModelProperty("资金分配情况-云资源、硬件购置(万元)") - private BigDecimal cloudHardwarePurchaseAmount; - - @ApiModelProperty("资金分配情况-第三方服务(万元)") - private BigDecimal thirdPartyAmount; - - @ApiModelProperty("年度支付计划-年度支付计划(万元)") - private BigDecimal annualPlanAmount; - - @ApiModelProperty("年度支付计划-自有金额(万元)") - private BigDecimal annualPlanHaveAmount; - - @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") - private BigDecimal annualPlanGovOwnFinanceAmount; - - @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") - private BigDecimal annualPlanGovSuperiorFinanceAmount; - - @ApiModelProperty("年度支付计划-银行贷款(万元)") - private BigDecimal annualPlanBankLendingAmount; - - @ApiModelProperty("年度支付计划-其它资金(万元)") - private BigDecimal annualPlanOtherAmount; - - @ApiModelProperty("立项批复资金(万元)") - private BigDecimal approvalAmount; - - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") - private LocalDateTime annualPlanAddTime; - - @ApiModelProperty("核心业务-核心业务模块") - private String coreBusiness; - - @ApiModelProperty("安全投入-投入项") - private String safetyInputTitle; - - @ApiModelProperty("安全投入-内容描述") - private String safetyInputDescribe; - - @ApiModelProperty("安全投入-金额(万元)") - private BigDecimal safetyInputAmount; - - @ApiModelProperty("附件-初步方案") - private String preliminaryPlanFile; - - @ApiModelProperty("附件-佐证材料") - private String supportingMaterialsFile; - - @ApiModelProperty("附件-项目总投资测算明细") - private String calculationTotalInvestmentFile; - - @ApiModelProperty("附件-申报单位主要职责(单位三定方案)") - private String mainResponsibilitiesApplicantFile; - - @ApiModelProperty("备注") - private String projectRemarks; - - @ApiModelProperty("是否包含应用 0:否 1:是") - private Integer includeApplication; - - @ApiModelProperty("工程形象进度-第一季度") - private String engineeringSpeedOne; - - @ApiModelProperty("工程形象进度-第二季度") - private String engineeringSpeedTwo; - - @ApiModelProperty("工程形象进度-第三季度") - private String engineeringSpeedThree; - - @ApiModelProperty("工程形象进度-第四季度") - private String engineeringSpeedFour; - - @ApiModelProperty("核心业务-是否开启核心业务模块 false:关闭 true:开启") - private Boolean isOpenCoreBusiness; - - @ApiModelProperty("安全投入-是否开启安全投入模块 false:关闭 true:开启") - private Boolean isOpenSafetyInput; - - @ApiModelProperty("工程形象进度-是否开启 false:关闭 true:开启") - private Boolean isEngineeringSpeed; - - @ApiModelProperty("附件-是否开启 false:关闭 true:开启") - private Boolean isAccessories; - - @ApiModelProperty("备注-是否开启 false:关闭 true:开启") - private Boolean isRemarks; - - @ApiModelProperty("年度支付计划-是否开启 false:关闭 true:开启") - private Boolean isAnnualPlanAmount; - - @ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启") - private Boolean isInnovateWholeProvinceShare; - - private LocalDateTime createOn; - - private LocalDateTime updateOn; - - @ApiModelProperty("流程实例编号") - private String instCode; - - @ApiModelProperty("安全投入-模块信息") - private String safetyInputModular; - - @ApiModelProperty("项目申报pdf") - private String projectPdf; - - @ApiModelProperty("立项申报pdf") - private String declarationPdf; - - @ApiModelProperty("建设周期(月)") - private String buildCycle; - - @ApiModelProperty("建设方案文件") - private String constructionPlanFile; - - @ApiModelProperty("立项批复文件") - private String approvedFile; - - @ApiModelProperty("批复金额") - private BigDecimal approvedTotalInvestmentIncrease; - - @ApiModelProperty("上级主管部门") - private String higherSuperOrg; - - @ApiModelProperty("上级主管部门Code") - private String higherSuperOrgCode; - - @ApiModelProperty("主管部门名称") - private String superOrg; - - @ApiModelProperty("主管部门Code") - private String superOrgCode; - - @ApiModelProperty("前端所需验证字段") - private Integer allApplicationsDone; - - @ApiModelProperty("流程实例id") - private String processInsId; - - @ApiModelProperty("流程实例 formId") - private String formId; - - @ApiModelProperty("项目应用实例") - private List applicationList; - - @ApiModelProperty("流程状态") - private Integer processStatus; - - @ApiModelProperty("动态表单 json") - private String dynamicForm; - - private Long createBy; - - private Long updateBy; - -} From 9ae878e949c3034c23f936ebd28d238a34fee1aa Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 13 Feb 2023 17:46:40 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/projectlib/model/entity/Project.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index 4ba35f9..8f61c13 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -1,8 +1,6 @@ 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 com.baomidou.mybatisplus.annotation.*; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -233,8 +231,10 @@ public class Project implements Serializable { @ApiModelProperty("一地创新全省共享项目-是否开启 false:关闭 true:开启") private Boolean isInnovateWholeProvinceShare; + @TableField(fill = FieldFill.INSERT) private LocalDateTime createOn; + @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateOn; @ApiModelProperty("流程实例编号") @@ -285,8 +285,10 @@ public class Project implements Serializable { @ApiModelProperty("动态表单 json") private String dynamicForm; - + @TableField(fill = FieldFill.INSERT) private Long createBy; + + @TableField(fill = FieldFill.INSERT_UPDATE) private Long updateBy; } From 73fa845c6de402aac00d49e4dae4f778c943b40f Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Mon, 13 Feb 2023 21:47:41 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=A4=84=E7=90=86-?= =?UTF-8?q?=E6=92=A4=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../builder/ProjectDeclareStateMachineBuilder.java | 35 --- .../event/ProjectStatusChangeEvent.java | 28 --- .../pmapi/todocenter/manage/TodoCenterManage.java | 246 ++++++++++++++------- 3 files changed, 162 insertions(+), 147 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java index 117c2af..e34eb3f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/builder/ProjectDeclareStateMachineBuilder.java @@ -92,11 +92,6 @@ public class ProjectDeclareStateMachineBuilder { .source(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE) .first(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS,projectDeclareGuardFactory.new PendingPreQualificationChoiceGuard(),projectDeclareAction.new ProjectDeclareChoiceAction()) .last(ProjectStatusEnum.PRE_APPLYING,projectDeclareAction.new ProjectDeclareChoiceAction()).and() - // 待预审撤回,从待预审到单位内部审核中 - .withExternal() - .source(ProjectStatusEnum.PENDING_PREQUALIFICATION) - .target(ProjectStatusEnum.UNDER_INTERNAL_AUDIT) - .event(ProjectStatusChangeEvent.PENDING_PREQUALIFICATION_WITHDRAW).and() // 省级部门联审通过,从省级部门联审中到预审中 .withExternal() .source(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS) @@ -157,21 +152,11 @@ public class ProjectDeclareStateMachineBuilder { .source(ProjectStatusEnum.IN_THE_ANNUAL_PLAN) .target(ProjectStatusEnum.BE_SUSPENDED) .event(ProjectStatusChangeEvent.ANNUAL_PLAN_SUSPEND).and() - // 年度计划中撤回,从年度计划中到部门联审中 - .withExternal() - .source(ProjectStatusEnum.IN_THE_ANNUAL_PLAN) - .target(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW) - .event(ProjectStatusChangeEvent.IN_THE_ANNUAL_PLAN_WITHDRAW).and() // 方案待申报申报方案,从方案待申报到方案评审中 .withExternal() .source(ProjectStatusEnum.PLAN_TO_BE_DECLARED) .target(ProjectStatusEnum.SCHEME_UNDER_REVIEW) .event(ProjectStatusChangeEvent.DECLARE_PLAN).and() - // 方案待申报撤回,从方案待申报到年度计划中 - .withExternal() - .source(ProjectStatusEnum.PLAN_TO_BE_DECLARED) - .target(ProjectStatusEnum.IN_THE_ANNUAL_PLAN) - .event(ProjectStatusChangeEvent.PLAN_TO_DECLARE_WITHDRAW).and() // 方案评审通过,从方案评审中到待立项批复 .withExternal() .source(ProjectStatusEnum.SCHEME_UNDER_REVIEW) @@ -192,41 +177,21 @@ public class ProjectDeclareStateMachineBuilder { .source(ProjectStatusEnum.TO_BE_APPROVED) .target(ProjectStatusEnum.TO_BE_PURCHASED) .event(ProjectStatusChangeEvent.PROJECT_APPROVAL).and() - // 待立项批复撤回,从待立项批复到方案评审中 - .withExternal() - .source(ProjectStatusEnum.TO_BE_APPROVED) - .target(ProjectStatusEnum.SCHEME_UNDER_REVIEW) - .event(ProjectStatusChangeEvent.TO_BE_APPROVED_WITHDRAW).and() // 待采购采购备案,从待采购到建设中 .withExternal() .source(ProjectStatusEnum.TO_BE_PURCHASED) .target(ProjectStatusEnum.UNDER_CONSTRUCTION) .event(ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD).and() - // 待采购撤回,从待采购到待立项批复 - .withExternal() - .source(ProjectStatusEnum.TO_BE_PURCHASED) - .target(ProjectStatusEnum.TO_BE_APPROVED) - .event(ProjectStatusChangeEvent.TO_BE_PURCHASED_WITHDRAW).and() // 建设中初验备案,从建设中到待终验 .withExternal() .source(ProjectStatusEnum.UNDER_CONSTRUCTION) .target(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED) .event(ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD).and() - // 建设中撤回,从建设中到待采购 - .withExternal() - .source(ProjectStatusEnum.UNDER_CONSTRUCTION) - .target(ProjectStatusEnum.TO_BE_PURCHASED) - .event(ProjectStatusChangeEvent.UNDER_CONSTRUCTION_WITHDRAW).and() // 待终验终验申请,从待终验到终验审核中 .withExternal() .source(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED) .target(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW) .event(ProjectStatusChangeEvent.FINAL_ACCEPTANCE_APPLICATION).and() - // 待终验撤回,从待终验到建设中 - .withExternal() - .source(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED) - .target(ProjectStatusEnum.UNDER_CONSTRUCTION) - .event(ProjectStatusChangeEvent.TO_BE_FINALLY_INSPECTED_WITHDRAW).and() // 终审审核通过,从终审审核中到已归档 .withExternal() .source(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/event/ProjectStatusChangeEvent.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/event/ProjectStatusChangeEvent.java index 7146033..ff5574e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/event/ProjectStatusChangeEvent.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/event/ProjectStatusChangeEvent.java @@ -114,10 +114,6 @@ public enum ProjectStatusChangeEvent { */ UNDER_INTERNAL_WITHDRAW(null, null, 10001), /** - * 待预审时被撤回(项目状态进入:单位内部审核中) - */ - PENDING_PREQUALIFICATION_WITHDRAW(null, null, 10003), - /** * 省级部门联审中时被撤回(项目状态进入:待预审) */ JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null, null, 10004), @@ -130,34 +126,10 @@ public enum ProjectStatusChangeEvent { */ DEPARTMENT_JOINT_REVIEW_WITHDRAW(null, null, 10008), /** - * 年度计划中时被撤回(项目状态进入:部门联审中) - */ - IN_THE_ANNUAL_PLAN_WITHDRAW(null, null, 10010), - /** - * 方案待申报时被撤回(项目状态进入:年度计划中) - */ - PLAN_TO_DECLARE_WITHDRAW(null, null, 10016), - /** * 方案评审中时被撤回(项目状态进入:方案待申报) */ SCHEME_UNDER_REVIEW_WITHDRAW(null, null, 10012), /** - * 待立项批复时被撤回(项目状态进入:方案评审中) - */ - TO_BE_APPROVED_WITHDRAW(null, null, 10014), - /** - * 待采购时被撤回(项目状态进入:待立项批复) - */ - TO_BE_PURCHASED_WITHDRAW(null, null, 20001), - /** - * 建设中时被撤回(项目状态进入:待采购) - */ - UNDER_CONSTRUCTION_WITHDRAW(null, null, 20002), - /** - * 待终验时被撤回(项目状态进入:建设中) - */ - TO_BE_FINALLY_INSPECTED_WITHDRAW(null, null, 20003), - /** * 终验审核中时被撤回(项目状态进入:待终验) */ FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null, null, 20004); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index cbb2d69..3de7eb2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -24,6 +24,7 @@ import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.util.ExcelDownUtil; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; @@ -42,7 +43,6 @@ import com.ningdatech.pmapi.todocenter.zwdd.model.MessageContent; import com.ningdatech.pmapi.todocenter.zwdd.model.MessageText; import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.service.IUserInfoService; -import com.ningdatech.pmapi.user.util.LoginUserUtil; import com.wflow.bean.do_.UserDo; import com.wflow.bean.entity.WflowCcTasks; import com.wflow.bean.entity.WflowModelHistorys; @@ -78,6 +78,7 @@ import org.flowable.engine.history.HistoricProcessInstanceQuery; import org.flowable.engine.impl.util.ProcessDefinitionUtil; import org.flowable.engine.runtime.ActivityInstance; import org.flowable.engine.runtime.Execution; +import org.flowable.engine.task.Comment; import org.flowable.task.api.Task; import org.flowable.task.api.TaskInfo; import org.flowable.task.api.TaskQuery; @@ -110,7 +111,6 @@ public class TodoCenterManage { private final RepositoryService repositoryService; private final RuntimeService runtimeService; private final UserDeptOrLeaderService userDeptOrLeaderService; - private final ProcessInstanceService processService; private final FormService formService; private final ManagementService managementService; private final HistoryService historyService; @@ -137,8 +137,9 @@ public class TodoCenterManage { // 获取登录用户ID // long userId = LoginUserUtil.getUserId(); - Long userId = 381496L; - // Long userId = 6418616L; + // Long userId = 381496L; + Long userId = 6418616L; + // Long userId = 61769799L; TaskQuery taskQuery = taskService.createTaskQuery(); taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); List taskList = taskQuery.list(); @@ -300,10 +301,16 @@ public class TodoCenterManage { // Long userId = LoginUserUtil.getUserId(); - // Long userId = 381496L; + Long userId = 381496L; - Long userId = 6418616L; + // Long userId = 6418616L; + // 若进行的是撤回操作(流程发起人和当前流程审核人的前一个审核人操作) + if (param.getAction().equals(ProcessHandlerEnum.WITHDRAW)){ + HistoricTaskInstance handledTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(param.getTaskId()).singleResult(); + doWithDrawProcess(handledTaskInstance, userId); + return; + } Task task = taskService.createTaskQuery().taskId(param.getTaskId()).active().singleResult(); HashMap formData = new HashMap<>(32); if (Objects.isNull(task)) { @@ -330,10 +337,6 @@ public class TodoCenterManage { formService.updateInstanceFormData(param.getInstanceId(), formData); doBackTask(task, userId, param); break; - // 撤回 - case WITHDRAW: - doWithDrawProcess(task, userId); - break; default: throw new IllegalStateException("Unexpected value: " + param.getAction()); } @@ -354,33 +357,38 @@ public class TodoCenterManage { Map var = new HashMap<>(16); var.put("approve_" + task.getId(), param.getAction()); + + // 保存审核意见 + if (hasComment(param.getAuditInfo())) { + // 执行自定义的保存评论的功能 + managementService.executeCommand(new SaveCommentCmd(param.getTaskId(), param.getInstanceId(), + String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo()))); + } + // TODO 中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被驳回,请及时处理。 - // 获取流程定义 - Process process = ProcessDefinitionUtil.getProcess(task.getProcessDefinitionId()); + + // 获取bpm对象 + BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId()); // 获取根节点即流程发起节点 - FlowNode rootNode = (FlowNode) process.getFlowElement("root", true); + FlowNode rootNode = (FlowNode) bpmnModel.getFlowElement("root"); + // TODO 中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被驳回,请及时处理。 - sendWorkNoticeToStartUser(task, projectName, rootNode); + // sendWorkNoticeToStartUser(task, projectName, rootNode); // 更新项目状态 - updateRejectProjectStatus(task); + updateRejectProjectStatus(userId,declaredProject); taskService.complete(param.getTaskId(), var); } /** * 当为驳回操作时,更新项目表中的项目状态 - * - * @param task 当前任务 + * @param userId + * @param declaredProject * @return void * @author CMM * @since 2023/02/08 */ - private void updateRejectProjectStatus(Task task) { - // 获取当前登录用户 - Long userId = LoginUserUtil.getUserId(); - // 获取当前申报项目 - Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + private void updateRejectProjectStatus(Long userId, Project declaredProject) { // 获取当前流程项目状态 Integer projectStatusSecond = declaredProject.getStatus(); // 根据当前状态获取对应的通过事件 @@ -432,7 +440,7 @@ public class TodoCenterManage { Project declaredProject = projectService .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); // 更新项目状态到下一个状态 - updatePassProjectStatus(task, userId, declaredProject); + updatePassProjectStatus(userId, declaredProject); taskService.complete(param.getTaskId(), var); } @@ -458,19 +466,48 @@ public class TodoCenterManage { managementService.executeCommand(new SaveCommentCmd(param.getTaskId(), param.getInstanceId(), String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo()))); } - updatePassProjectStatus(task, userId, declaredProject); - taskService.complete(param.getTaskId(), var); - // 获取bpm对象 BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId()); // 传节点定义key 获取当前节点 FlowNode currentNode = (FlowNode) bpmnModel.getFlowElement(task.getTaskDefinitionKey()); + + // TODO 若当前流程是预审流程,需要在提交预审申报的时候,调用状态机判断申报后的项目状态, + // 若是省级部门联审中,要对接外部接口,获取省级部门联审的结果,更新项目状态(预审申报提交的时候处理) + + // 需要先通过后才能有下一个节点的信息 + taskService.complete(param.getTaskId(), var); + // 获取流程下一个节点的审核用户ID String nextUserId = getNextUserId(currentNode, processInstanceId); - // 若有下一个审核人,向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 + // 获取当前流程状态 + Integer status = declaredProject.getStatus(); + // 若当前登录用户是最后一个审批人 + HistoricProcessInstance instance = historyService + .createHistoricProcessInstanceQuery() + .processInstanceId(processInstanceId) + .singleResult(); + if (HisProInsEndActId.END.equals(instance.getEndActivityId())) { + switch (Objects.requireNonNull(ProjectStatusEnum.getValue(status))) { + // 当前项目状态是单位内部审核中 + case UNDER_INTERNAL_AUDIT: + // 当前项目状态是预审中 + case PRE_APPLYING: + // 当前项目状态是部门联审中 + case DEPARTMENT_JOINT_REVIEW: + // 当前项目状态是方案评审中 + case SCHEME_UNDER_REVIEW: + // 当前项目状态是终验审核中 + case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: + updatePassProjectStatus(userId, declaredProject); + break; + default: + throw new IllegalStateException("Unexpected value: " + status); + } + } + // 若有下一个审核人(当前节点的用户),向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 if (Objects.nonNull(nextUserId)) { - UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(nextUserId)); + // UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(nextUserId)); // TODO 获取浙政钉用户dingKey,向其发送浙政钉工作通知 String msg = String.format(PASS_MSG_TEMPLATE, null, projectName); // sendWorkNotice(auditUserInfo,msg); @@ -478,22 +515,20 @@ public class TodoCenterManage { // 若没有,向发起人发送浙政钉工作通知:【项目名称】已通过【流程名称】,请及时开始下一步操作。 // TODO 向其发送浙政钉工作通知 获取根节点的孩子节点(即发起人节点),向其发送浙政钉工作通知 // 获取根节点即流程发起节点 - FlowNode rootNode = (FlowNode) bpmnModel.getFlowElement("root"); + // FlowNode rootNode = (FlowNode) bpmnModel.getFlowElement("root"); // sendWorkNoticeToStartUser(task, projectName, rootNode); } } /** * 当为通过操作时,更新项目表中项目状态 - * - * @param task 当前任务 * @param userId * @param declaredProject * @return void * @author CMM * @since 2023/02/08 */ - private void updatePassProjectStatus(Task task, Long userId, Project declaredProject) { + private void updatePassProjectStatus(Long userId, Project declaredProject) { // 获取当前流程项目状态 Integer projectStatusSecond = declaredProject.getStatus(); // 根据当前状态获取对应的通过事件 @@ -520,7 +555,7 @@ public class TodoCenterManage { * @since 2023/02/03 */ private void sendWorkNoticeToStartUser(Task task, String projectName, FlowNode rootNode) { - String startUserId = getRootUserId(rootNode); + String startUserId = getRootUserId(rootNode, task.getProcessInstanceId()); UserInfo startUserInfo = userInfoService.getById(Long.valueOf(startUserId)); // 从历史表获取最新版本的流程 WflowModels wflowModels = getLastWflowModels(task); @@ -530,14 +565,15 @@ public class TodoCenterManage { } /** - * 获取流程发起节点的浙政钉用户ID + * 获取流程发起节点的用户ID * * @param rootNode 根节点 + * @param processInstanceId * @return java.lang.String * @author CMM * @since 2023/02/02 */ - private String getRootUserId(FlowNode rootNode) { + private String getRootUserId(FlowNode rootNode, String processInstanceId) { String rootUserId = null; // 输出连线 List outgoingFlows = rootNode.getOutgoingFlows(); @@ -548,8 +584,11 @@ public class TodoCenterManage { // TODO 若要会签需判断候选人 // 发起事件 if (targetFlowElement instanceof StartEvent) { - UserTask userTask = (UserTask) targetFlowElement; - rootUserId = userTask.getAssignee(); + String actId = targetFlowElement.getId(); + ActivityInstance activityInstance = runtimeService.createActivityInstanceQuery() + .processInstanceId(processInstanceId).activityId(actId).singleResult(); + String executionId = activityInstance.getExecutionId(); + rootUserId = runtimeService.getVariable(executionId, "initiator", String.class); break; } } @@ -560,7 +599,7 @@ public class TodoCenterManage { /** * 获取当前节点的下一个节点的审核用户ID * - * @param currentNode 当前节点 + * @param currentNode 当前节点 * @param processInstanceId * @return java.lang.String 下一个节点的浙政钉用户ID * @author CMM @@ -646,70 +685,106 @@ public class TodoCenterManage { /** * 撤销流程处理 * - * @param task 当前任务 - * @param userId + * @param handledTaskInstance 已处理的历史任务实例 + * @param userId 当前登录用户ID */ - private void doWithDrawProcess(Task task, Long userId) { - // 获取流程定义 - Process process = ProcessDefinitionUtil.getProcess(task.getProcessDefinitionId()); - // 获取当前运行流程的发起人节点信息 - FlowNode rootNode = (FlowNode) process.getFlowElement("root", true); - // 获取当前节点 - FlowNode currentNode = (FlowNode) process.getFlowElement(task.getTaskDefinitionKey(), true); - String rootUserId = getRootUserId(rootNode); + private void doWithDrawProcess(HistoricTaskInstance handledTaskInstance, Long userId) { + String processInstanceId = handledTaskInstance.getProcessInstanceId(); + // 获取当前流程实例待审核任务信息 + Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult(); + // 获取当前流程实例信息 + HistoricProcessInstance historicProcessInstance = historyService + .createHistoricProcessInstanceQuery() + .processInstanceId(processInstanceId) + .singleResult(); + // 流程发起人ID + String startUserId = historicProcessInstance.getStartUserId(); + // 获取当前申报项目 + Project declaredProject = projectService.getOne(Wrappers.lambdaQuery(Project.class) + .eq(Project::getInstCode, processInstanceId)); + String projectName = declaredProject.getProjectName(); + + // 获取bpm对象 + BpmnModel bpmnModel = repositoryService.getBpmnModel(handledTaskInstance.getProcessDefinitionId()); + // 传节点定义key 获取传入节点(撤回操作人在流程配置中所在的节点) + FlowNode handledNode = (FlowNode) bpmnModel.getFlowElement(handledTaskInstance.getTaskDefinitionKey()); + + // 获取当前流程状态 + Integer status = declaredProject.getStatus(); + // 判断当前登录用户是否是流程发起人 - if (rootUserId.equals(String.valueOf(userId))) { + if (startUserId.equals(String.valueOf(userId))) { // TODO 若是流程发起人点击撤回,项目回到上一个状态,并删除当前审核人对应的待办记录 - updateWithdrawProjectStatus(task, userId); + // 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态 + switch (Objects.requireNonNull(ProjectStatusEnum.getValue(status))) { + // 当前项目状态是单位内部审核中 + case UNDER_INTERNAL_AUDIT: + // 当前项目状态是预审中 + case PRE_APPLYING: + // 当前项目状态是部门联审中 + case DEPARTMENT_JOINT_REVIEW: + // 当前项目状态是方案评审中 + case SCHEME_UNDER_REVIEW: + // 当前项目状态是终验审核中 + case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: + updateWithdrawProjectStatus(userId, declaredProject); + break; + default: + throw new IllegalStateException("Unexpected value: " + status); + } List executions = runtimeService.createExecutionQuery() - .processInstanceId(task.getProcessInstanceId()).onlyChildExecutions().list(); + .processInstanceId(handledTaskInstance.getProcessInstanceId()).onlyChildExecutions().list(); // 强制流程指向撤回 - runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()) + runtimeService.createChangeActivityStateBuilder() + .processInstanceId(task.getProcessInstanceId()) .moveActivityIdTo(task.getTaskDefinitionKey(), HisProInsEndActId.WITHDRAW) - .moveExecutionsToSingleActivityId( - executions.stream().map(Execution::getId).collect(Collectors.toList()), HisProInsEndActId.WITHDRAW) + .moveExecutionsToSingleActivityId(executions.stream() + .map(Execution::getId) + .collect(Collectors.toList()), HisProInsEndActId.WITHDRAW) .changeState(); } else { - FlowElementsContainer parentContainer = currentNode.getParentContainer(); - for (FlowElement flowElement : parentContainer.getFlowElements()) { - UserTask beforeUserTask = (UserTask) flowElement; - if (beforeUserTask.getAssignee().equals(String.valueOf(userId))) { - // TODO 若是前一个审核人点击撤回,在审核记录中移除自己提交过的审核意见、 - // 待我处理中移除当前审核人的待办记录、 - // 待我处理中增加自己的待办记录、 - // 我已处理中去掉自己之前处理的记录 - // 更新项目状态 - updateWithdrawProjectStatus(task, userId); - HistoricTaskInstance beforeTaskInstance = - historyService.createHistoricTaskInstanceQuery().taskId(beforeUserTask.getId()).singleResult(); - List executions = runtimeService.createExecutionQuery() - .processInstanceId(beforeTaskInstance.getProcessInstanceId()).onlyChildExecutions().list(); - // 强制流程指向撤回 - runtimeService.createChangeActivityStateBuilder().processInstanceId(task.getProcessInstanceId()) - .moveActivityIdTo(flowElement.getId(), HisProInsEndActId.WITHDRAW) - .moveExecutionsToSingleActivityId( - executions.stream().map(Execution::getId).collect(Collectors.toList()), - HisProInsEndActId.WITHDRAW) - .changeState(); - break; - } + // TODO 获取前一个审核节点审核人信息 + + // TODO 判断前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 + Boolean orgFlag = true; + if (orgFlag){ + // 注意:是前一个审核人,说明此时仍在一个审核流程中,项目状态不需要改变 + // 在审核记录中移除前一个审核人提交过的审核意见 + Comment comment = taskService.getProcessInstanceComments(processInstanceId).stream() + .filter(c -> c.getTaskId().equals(handledTaskInstance.getId())) + .findFirst() + .get(); + taskService.deleteComment(comment.getId()); + // 我已处理中去掉自己之前处理的记录 + String taskInstanceId = handledTaskInstance.getId(); + historyService.deleteHistoricTaskInstance(taskInstanceId); + + List executions = runtimeService.createExecutionQuery() + .processInstanceId(handledTaskInstance.getProcessInstanceId()).onlyChildExecutions().list(); + // 强制流程指向前一个审核人节点 + runtimeService.createChangeActivityStateBuilder() + .processInstanceId(task.getProcessInstanceId()) + .moveActivityIdsToSingleActivityId(executions.stream() + .map(Execution::getActivityId) + .collect(Collectors.toList()), handledNode.getId()) + .changeState(); + }else { + throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); } + } } + /** * 当为撤回操作时,更新项目表中的项目状态为前一个状态 - * - * @param task 当前任务 * @param userId + * @param declaredProject * @return void * @author CMM * @since 2023/02/08 */ - private void updateWithdrawProjectStatus(Task task, Long userId) { - // 获取当前申报项目 - Project declaredProject = projectService - .getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId())); + private void updateWithdrawProjectStatus(Long userId, Project declaredProject) { // 获取当前流程项目状态 Integer projectStatusSecond = declaredProject.getStatus(); // 根据当前状态获取对应的撤回事件 @@ -923,7 +998,10 @@ public class TodoCenterManage { public PageVo queryHandledProjectList(ReqToBeProcessedDTO param) { // 获取登录用户ID // long userId = LoginUserUtil.getUserId(); + Long userId = 381496L; + // Long userId = 6418616L; + // Long userId = 61769799L; // 自定义sql查询所有已办的任务实例 String nativeSql = "SELECT aht.* FROM ACT_HI_TASKINST AS aht \n"