From ae509b3f764863f586b88a025bddd966a55664eb Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 10 Mar 2023 14:13:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=94=B3=E6=8A=A5=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/ProjectStatusChangeEvent.java | 55 +++++++++++----------- .../statemachine/util/StateMachineUtils.java | 24 ++++++++-- .../model/dto/ProjectRenewalDeclareExportDTO.java | 42 +++++++++++++++++ .../ProjectRenewalFundDeclarationController.java | 8 +++- .../manage/ProjectRenewalFundManage.java | 46 ++++++++++++++++++ .../model/dto/ProjectRenewalExportDTO.java | 3 ++ .../pmapi/todocenter/manage/TodoCenterManage.java | 2 +- 7 files changed, 148 insertions(+), 32 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectRenewalDeclareExportDTO.java 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 35febc2..4c31c2a 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 @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.common.statemachine.event; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -25,114 +26,114 @@ public enum ProjectStatusChangeEvent { /** * 项目申报提交(项目状态进入:单位内部审核中) */ - PROJECT_APPLICATION_SUBMIT(10015, null, null), + PROJECT_APPLICATION_SUBMIT( ProjectStatusEnum.TO_BE_DECLARED.getCode(), null, null), /** * 单位内部审核驳回(项目状态进入:单位内部审核不通过) */ - UNDER_INTERNAL_REJECT(null, 10001, null), + UNDER_INTERNAL_REJECT(null, ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode(), null), /** * 单位内部审核通过(项目状态进入:待预审) */ - UNDER_INTERNAL_PASS(10001, null, null), + UNDER_INTERNAL_PASS(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode(), null, null), /** * 预审申报(项目状态进入:待预审选择,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) */ - PRELIMINARY_REVIEW_DECLARE(10003, null, null), + PRELIMINARY_REVIEW_DECLARE(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(), null, null), /** * 省级部门联审不通过(项目状态变为:省级部门联审不通过) */ - PROVINCIAL_DEPARTMENT_REVIEW_REJECT(null, 10004, null), + PROVINCIAL_DEPARTMENT_REVIEW_REJECT(null, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), null), /** * 省级部门联审通过(项目状态变为:预审中) */ - PROVINCIAL_DEPARTMENT_REVIEW_PASS(10004, null, null), + PROVINCIAL_DEPARTMENT_REVIEW_PASS(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), null, null), /** * 预审驳回(项目状态变为:预审不通过) */ - PRELIMINARY_REVIEW_REJECT(null, 10006, null), + PRELIMINARY_REVIEW_REJECT(null, ProjectStatusEnum.PRE_APPLYING.getCode(), null), /** * 预审通过(项目状态变为:部门联审中) */ - PRELIMINARY_REVIEW_PASS(10006, null, null), + PRELIMINARY_REVIEW_PASS(ProjectStatusEnum.PRE_APPLYING.getCode(), null, null), /** * 部门联审驳回(项目状态变为:部门联审不通过) */ - DEPARTMENT_UNITED_REVIEW_REJECT(null, 10008, null), + DEPARTMENT_UNITED_REVIEW_REJECT(null, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(), null), /** * 部门联审通过(项目状态变为:年度计划中) */ - DEPARTMENT_UNITED_REVIEW_PASS(10008, null, null), + DEPARTMENT_UNITED_REVIEW_PASS(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode(), null, null), /** * 年度计划暂缓(项目状态变为:被暂缓) */ - ANNUAL_PLAN_SUSPEND(null, 10010, null), + ANNUAL_PLAN_SUSPEND(null, ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode(), null), /** * 年度计划项目开启方案申报(项目状态变为:方案待申报) */ - ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(10010, null, null), + ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode(), null, null), /** * 申报方案(项目状态变为:方案评审中) */ - DECLARE_PLAN(10016, null, null), + DECLARE_PLAN( ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode(), null, null), /** * 方案评审驳回(项目状态变为:方案评审不通过) */ - PLAN_REVIEW_REJECT(null, 10012, null), + PLAN_REVIEW_REJECT(null, ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode(), null), /** * 方案评审通过(项目状态变为:待立项批复) */ - PLAN_REVIEW_PASS(10012, null, null), + PLAN_REVIEW_PASS(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode(), null, null), /** * 立项批复(项目状态变为:已立项-待采购) */ - PROJECT_APPROVAL(10014, null, null), + PROJECT_APPROVAL(ProjectStatusEnum.TO_BE_APPROVED.getCode(), null, null), /** * 采购备案(项目状态变为:建设中) */ - PURCHASE_PUT_ON_RECORD(20001, null, null), + PURCHASE_PUT_ON_RECORD(ProjectStatusEnum.TO_BE_PURCHASED.getCode(), null, null), /** * 初验备案(项目状态变为:待终验) */ - PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(20002, null, null), + PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode(), null, null), /** * 终验申请(项目状态变为:终验审核中) */ - FINAL_ACCEPTANCE_APPLICATION(20003, null, null), + FINAL_ACCEPTANCE_APPLICATION(ProjectStatusEnum.TO_BE_FINALLY_INSPECTED.getCode(), null, null), /** * 终验审核不通过(项目状态变为:终验审核不通过) */ - FINAL_ACCEPTANCE_REJECT(null, 20004, null), + FINAL_ACCEPTANCE_REJECT(null, ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode(), null), /** * 终验审核通过(项目状态变为:已归档) */ - FINAL_ACCEPTANCE_PASS(20004, null, null), + FINAL_ACCEPTANCE_PASS(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode(), null, null), // 下个节点还未提交审核意见时,流程发起人和前一个审核人可以点击撤回 /** * 单位内部审核中时被撤回(项目状态进入:待申报) */ - UNDER_INTERNAL_WITHDRAW(null, null, 10001), + UNDER_INTERNAL_WITHDRAW(null, null, ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()), /** * 省级部门联审中时被撤回(项目状态进入:待预审) */ - JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null, null, 10004), + JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(null, null, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()), /** * 预审中时被撤回(项目状态进入:待预审选择,,有判断条件:市级项目且申报金额大于1000万项目状态变为:省级部门联审中;否则项目状态变为:预审中) */ - PRE_APPLYING_WITHDRAW(null, null, 10006), + PRE_APPLYING_WITHDRAW(null, null, ProjectStatusEnum.PRE_APPLYING.getCode()), /** * 部门联审中时被撤回(项目状态进入:预审中) */ - DEPARTMENT_JOINT_REVIEW_WITHDRAW(null, null, 10008), + DEPARTMENT_JOINT_REVIEW_WITHDRAW(null, null, ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()), /** * 方案评审中时被撤回(项目状态进入:方案待申报) */ - SCHEME_UNDER_REVIEW_WITHDRAW(null, null, 10012), + SCHEME_UNDER_REVIEW_WITHDRAW(null, null, ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()), /** * 终验审核中时被撤回(项目状态进入:待终验) */ - FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null, null, 20004); + FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(null, null, ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); private Integer passProjectStatusCode; private Integer rejectProjectStatusCode; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java index a6e64af..c8c4dd7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/util/StateMachineUtils.java @@ -41,17 +41,35 @@ public class StateMachineUtils { @Resource(name = "projectDeclareStateMachinePersister") private StateMachinePersister projectDeclareStateMachinePersister; - //通过审核 + /** + * 审核通过 + * @param project + * @return void + * @author CMM + * @since 2023/03/10 13:40 + */ public void pass(Project project) throws Exception { execute(project,getProjectStatusPassEvent(project.getStatus())); } - //拒绝 + /** + * 审核驳回 + * @param project + * @return void + * @author CMM + * @since 2023/03/10 13:40 + */ public void reject(Project project) throws Exception { execute(project,getProjectStatusRejectEvent(project.getStatus())); } - //撤回 + /** + * 审核撤回 + * @param project + * @return void + * @author CMM + * @since 2023/03/10 13:40 + */ public void withDraw(Project project) throws Exception { execute(project,getProjectStatusWithdrawEvent(project.getStatus())); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectRenewalDeclareExportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectRenewalDeclareExportDTO.java new file mode 100644 index 0000000..bcd396d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/ProjectRenewalDeclareExportDTO.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.projectdeclared.model.dto; + +import java.io.Serializable; +import java.math.BigDecimal; + +import com.alibaba.excel.annotation.ExcelProperty; + +import lombok.Data; + +/** + * 项目续建申报列表导出实体 + * + * @author CMM + * @since 2023/02/21 15:03 + */ +@Data +public class ProjectRenewalDeclareExportDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ExcelProperty(value = "序号",index = 0) + private Integer serialNumber; + + @ExcelProperty("项目名称") + private String projectName; + + @ExcelProperty("项目类型") + private String projectTypeName; + + @ExcelProperty("预算年度") + private Integer projectYear; + + @ExcelProperty("年度支付金额(万元)") + private BigDecimal annualPaymentAmount; + + @ExcelProperty("状态") + private String approvalStatusName; + + @ExcelProperty("创建时间") + private String createOn; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java index 677115d..06fceed 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java @@ -62,9 +62,15 @@ public class ProjectRenewalFundDeclarationController { } @GetMapping("/export") - @ApiOperation("续建项目列表导出") + @ApiOperation("项目库续建项目列表导出") private void exportList(ProjectRenewalListReq req, HttpServletResponse response){ ExcelDownUtil.downXls(response,req,projectRenewalFundManage::exportList); } + @GetMapping("/exportRenewalDeclare") + @ApiOperation("申报管理续建项目资金申报列表导出") + private void exportRenewalDeclareList(ProjectRenewalListReq req, HttpServletResponse response){ + ExcelDownUtil.downXls(response,req,projectRenewalFundManage::exportRenewalDeclareList); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index ef5521f..bf3b3f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -11,6 +11,7 @@ import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.common.util.ExcelDownUtil; import com.ningdatech.pmapi.common.util.ExcelExportStyle; +import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectRenewalDeclareExportDTO; import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; @@ -189,6 +190,10 @@ public class ProjectRenewalFundManage { return exportDTO; }).collect(Collectors.toList()); + for (int i = 0; i < collect.size(); i++) { + collect.get(i).setSerialNumber(i + 1); + } + String fileName = "续建项目资金库列表"; ExcelDownUtil.setFileName(fileName,response); @@ -203,4 +208,45 @@ public class ProjectRenewalFundManage { throw new RuntimeException(e); } } + + public void exportRenewalDeclareList(HttpServletResponse response, ProjectRenewalListReq param) { + param.setPageNumber(CommonConst.EXPORT_PAGE_NUMBER); + param.setPageSize(CommonConst.EXPORT_PAGE_SIZE); + Page page = param.page(); + projectRenewalFundDeclarationService.pageSql(page, param); + List records = page.getRecords(); + + List collect = records.stream().map(r -> { + ProjectRenewalDeclareExportDTO exportDTO = new ProjectRenewalDeclareExportDTO(); + BeanUtils.copyProperties(r, exportDTO); + exportDTO.setProjectTypeName(ProjectTypeEnum.getDesc(r.getProjectType())); + if (ProjectRenewalApprovalStatusEnum.PENDING.name().equals(r.getApprovalStatus())) { + exportDTO.setApprovalStatusName(ProjectRenewalApprovalStatusEnum.PENDING.getDesc()); + } else if (ProjectRenewalApprovalStatusEnum.PASS.name().equals(r.getApprovalStatus())) { + exportDTO.setApprovalStatusName(ProjectRenewalApprovalStatusEnum.PASS.getDesc()); + } else if (ProjectRenewalApprovalStatusEnum.NOT_PASS.name().equals(r.getApprovalStatus())) { + exportDTO.setApprovalStatusName(ProjectRenewalApprovalStatusEnum.NOT_PASS.getDesc()); + } + String createOnStr = NdDateUtils.format(r.getCreateOn(), "yyyy-MM-dd HH:mm"); + exportDTO.setCreateOn(createOnStr); + return exportDTO; + }).collect(Collectors.toList()); + + for (int i = 0; i < collect.size(); i++) { + collect.get(i).setSerialNumber(i + 1); + } + + String fileName = "续建项目资金申报列表"; + ExcelDownUtil.setFileName(fileName,response); + //数据导出处理函数 + try { + EasyExcel.write(response.getOutputStream(), ProjectRenewalDeclareExportDTO.class) + .autoCloseStream(false) + .registerWriteHandler(ExcelExportStyle.formalStyle()) + .sheet(fileName) + .doWrite(collect); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectRenewalExportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectRenewalExportDTO.java index 29b61e5..c9ff7eb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectRenewalExportDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectRenewalExportDTO.java @@ -17,6 +17,9 @@ public class ProjectRenewalExportDTO implements Serializable { private static final long serialVersionUID = 1L; + @ExcelProperty(value = "序号",index = 0) + private Integer serialNumber; + @ExcelProperty("项目名称") private String projectName; 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 a22d164..3a93ba6 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 @@ -268,7 +268,7 @@ public class TodoCenterManage { } // 如果流程状态是被退回状态,流程通过后,进入下一个审核人, - // 当前通过审核人一定不是最后一个审核人(下一个审核人至多是最后一个),更新流程状态为审核中 + // 当前通过审核人一定不是最后一个审核人(下一个审核人至多是最后一个) if (ProcessStatusEnum.BE_BACKED.getDesc().equals(currentProcessStatus)) { // 获取发送浙政钉工作通知必要信息 WorkNoticeInfo passWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);