From 54e7dabc77fa0ce1a0ef658232691eb7b6126606 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Sat, 11 Feb 2023 14:41:28 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=A1=B9=E7=9B=AE=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/enums/ProjectProessStageEnum.java | 22 ++++++++++++++++++++++ .../contants/DeclaredProjectContant.java | 17 +++++++++++++++++ .../pmapi/projectdeclared/entity/ProjectDraft.java | 6 ++++-- .../entity/dto/DeclaredProjectListParamDto.java | 4 ++-- .../manage/DeclaredProjectManage.java | 15 ++++++++------- 5 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java new file mode 100644 index 0000000..3b7ad16 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/enums/ProjectProessStageEnum.java @@ -0,0 +1,22 @@ +package com.ningdatech.pmapi.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum ProjectProessStageEnum { + /** + * 项目流程配置 阶段枚举 + */ + ORG_INTERNAL_APPROVAL_PROCESS(1,"单位内部审批流程"), + PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2,"项目预审审批流程"), + DEPARTMENT_JOINT_APPROVAL_PROCESS(3,"部门联合审批流程"), + CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4,"建设方案审批流程"), + ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5,"验收申报审批流程"); + + private Integer code; + private String desc; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java new file mode 100644 index 0000000..27ed0ee --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/contants/DeclaredProjectContant.java @@ -0,0 +1,17 @@ +package com.ningdatech.pmapi.projectdeclared.contants; + +public interface DeclaredProjectContant { + + class ProcessDef { + public static final String PROJECT_STAGE_1 = "单位内部审批流程"; + + public static final String PROJECT_STAGE_2 = "项目预审审批流程"; + + public static final String PROJECT_STAGE_3 = "部门联合审批流程"; + + public static final String PROJECT_STAGE_4 = "建设方案审批流程"; + + public static final String PROJECT_STAGE_5 = "验收申报审批流程"; + } + +} 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 db0a88f..a1c17b2 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 @@ -404,9 +404,11 @@ public class ProjectDraft implements Serializable { @ApiModelProperty("试点文件") private String experimentsFile; - @ApiModelProperty("新增form内容") - private String formData; + @ApiModelProperty("项目应用") + private String projectApplicationList; + @ApiModelProperty("新增form内容") + private String dynamicForm; private Long createBy; private Long updateBy; 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 cfb3ead..686f3c6 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 @@ -22,9 +22,9 @@ public class DeclaredProjectListParamDto extends PagePo { private Integer projectType; - private Integer projectStatusFirst; + private Integer projectStage; - private Integer projectStatusSecond; + private Integer projectStatus; private Integer projectYear; 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 6cf5d5e..0930cd2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.common.enums.ProjectProessStageEnum; import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; @@ -66,8 +67,8 @@ public class DeclaredProjectManage { .le(Objects.nonNull(params.getEndTime()), Project::getCreateOn, params.getEndTime()) .eq(Objects.nonNull(params.getProjectType()), Project::getProjectType, params.getProjectType()) .eq(Objects.nonNull(params.getProjectYear()), Project::getProjectYear, params.getProjectYear()) - .eq(Objects.nonNull(params.getProjectStatusFirst()), Project::getProjectStatusFirst, params.getProjectStatusFirst()) - .eq(Objects.nonNull(params.getProjectStatusSecond()), Project::getProjectStatusSecond, params.getProjectStatusSecond()) + .eq(Objects.nonNull(params.getProjectStage()), Project::getStage, params.getProjectStage()) + .eq(Objects.nonNull(params.getProjectStatus()), Project::getStatus, params.getProjectStatus()) .like(StringUtils.isNotBlank(params.getProjectName()), Project::getProjectName, params.getProjectName()) .orderByDesc(Project::getUpdateOn); projectService.page(page,wrapper); @@ -99,8 +100,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.getProjectStatusFirst()), ProjectDraft::getProjectStatusFirst, params.getProjectStatusFirst()) - .eq(Objects.nonNull(params.getProjectStatusSecond()), ProjectDraft::getProjectStatusSecond, params.getProjectStatusSecond()) + .eq(Objects.nonNull(params.getProjectStage()), ProjectDraft::getProjectStatusFirst, params.getProjectStage()) + .eq(Objects.nonNull(params.getProjectStatus()), ProjectDraft::getProjectStatusSecond, params.getProjectStatus()) .like(StringUtils.isNotBlank(params.getProjectName()), ProjectDraft::getProjectName, params.getProjectName()) .orderByDesc(ProjectDraft::getUpdateOn); projectDraftService.page(page,wrapper); @@ -132,7 +133,7 @@ public class DeclaredProjectManage { WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getRegionCode, regionCode) - .eq(WflowModels::getFormName, "单位内部审批流程") + .eq(WflowModels::getFormName, ProjectProessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getDesc()) .last("limit 1")); if(Objects.isNull(model)){ @@ -157,8 +158,8 @@ public class DeclaredProjectManage { project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); project.setAreaCode(regionCode); - project.setProjectStatusFirst(ProjectStatusEnum.NOT_APPROVED.getCode()); - project.setProjectStatusSecond(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); + project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); project.setInstCode(instanceId); projectService.save(project); }catch (Exception e){ From 27aef1ada8ecd509957248f663811e666a3ca278 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 11 Feb 2023 14:45:15 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/model/entity/ExcelExportDTO.java | 218 +++++++++++++++++++++ .../common/model/entity/ExcelExportWriter.java | 65 ++++++ .../pmapi/common/util/ExcelDownUtil.java | 67 +++++++ .../controller/ProjectLibController.java | 9 + .../pmapi/projectlib/manage/ProjectLibManage.java | 13 ++ .../pmapi/todocenter/bean/entity/ExportOption.java | 197 +++++++++++++++++++ .../bean/vo/ProcessProgressDetailVo.java | 4 - .../controller/TodoCenterController.java | 3 +- .../pmapi/todocenter/manage/TodoCenterManage.java | 66 +++++-- .../model/dto/req/ReqToBeProcessedDTO.java | 8 + .../todocenter/model/dto/res/ResToBeExportDTO.java | 42 ---- 11 files changed, 624 insertions(+), 68 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportWriter.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ExportOption.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeExportDTO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportDTO.java new file mode 100644 index 0000000..448328e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportDTO.java @@ -0,0 +1,218 @@ +package com.ningdatech.pmapi.common.model.entity; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 待办中心待我处理项目列表导出实体 + * + * @author CMM + * @since 2023/01/19 16:42 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor + +public class ExcelExportDTO implements Serializable { + private static final long serialVersionUID = 1L; + + //@ExcelProperty("项目名称") + //private String projectName; + // + //@ExcelProperty("申报单位") + //private String buildUnitName; + // + //@ExcelProperty("申报金额") + //private Integer declareAmount; + // + //@ExcelProperty("预算年度") + //private Integer projectYear; + // + //@ExcelProperty("流程状态") + //private String processStatusName; + // + //@ExcelProperty("发起时间") + //@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") + //private LocalDateTime processLaunchTime; + + @ExcelProperty("项目ID") + private Long id; + + @ExcelProperty("项目名称") + private String projectName; + + @ExcelProperty("行政区划编码") + private String areaCode; + + @ExcelProperty("行政区划名称") + private String area; + + @ExcelProperty("项目负责人") + private String responsibleMan; + + @ExcelProperty("项目负责人手机号") + private String responsibleManMobile; + + @ExcelProperty("项目联系人") + private String contactName; + + @ExcelProperty("项目联系人手机号") + private String contactPhone; + + @ExcelProperty("上级业务主管单位") + private String higherSuperUnit; + + @ExcelProperty("上级主管单位浙政钉ID") + private Boolean higherSuperUnitCode; + + @ExcelProperty("本级主管部门") + private Boolean superUnit; + + @ExcelProperty("本级主管部门浙政钉ID") + private Boolean superUnitCode; + + @ExcelProperty("建设单位名称") + private Boolean constructionUnitName; + + @ExcelProperty("建设单位浙政钉ID") + private Boolean buildUnitZheJiangGovernmentDingId; + + @ExcelProperty("建设单位统一信用代码") + private Boolean buildUnitCode; + + @ExcelProperty("项目类型") + private Boolean projectType; + + @ExcelProperty("是否首次新建") + private Boolean isFirst; + + @ExcelProperty("关联应用") + private Boolean includeApplication; + + @ExcelProperty("关联应用IRS编码") + private Boolean includeApplicationIRSCode; + + @ExcelProperty("申报金额(万元)") + private Boolean declareAmount; + + @ExcelProperty("批复金额") + private Boolean approvedTotalInvestmentIncrease; + + @ExcelProperty("预算来源") + private Boolean budgetSource; + + @ExcelProperty("预算年度") + private Boolean budgetYear; + + @ExcelProperty("项目简介") + private Boolean projectIntroduction; + + @ExcelProperty("立项依据") + private Boolean buildBasis; + + @ExcelProperty("建设层级") + private Boolean buildLevel; + + @ExcelProperty("发改编码") + private Boolean developCode; + + @ExcelProperty("财政编码") + private Boolean financialCode; + + @ExcelProperty("信息是否有效") + private Boolean informationValidity; + + @ExcelProperty("是否数字化改革项目") + private Boolean isDigitalReform; + + @ExcelProperty("综合应用领域") + private Boolean bizDomain; + + @ExcelProperty("是否上云") + private Boolean isCloud; + + @ExcelProperty("云类型") + private Boolean cloudType; + + @ExcelProperty("四大体系") + private Boolean fourSystems; + + @ExcelProperty("是否临时增补") + private Boolean isTemporaryAugment; + + @ExcelProperty("等保级别") + private Boolean protectionLevel; + + @ExcelProperty("是否密评 0:否 1:是") + private Boolean isSecretComments; + + @ExcelProperty("业务编号") + private Boolean businessNumber; + + @ExcelProperty("业务名称") + private Boolean businessName; + + @ExcelProperty("单位名称") + private Boolean unitName; + + @ExcelProperty("软件开发(万元)") + private Boolean softwareDevelopmentAmount; + + @ExcelProperty("云资源、硬件购置(万元)") + private Boolean cloudHardwarePurchaseAmount; + + @ExcelProperty("第三方服务(万元)") + private Boolean thirdPartyAmount; + + @ExcelProperty("投入项") + private Boolean safetyInputTitle; + + @ExcelProperty("内容描述") + private Boolean safetyInputDescribe; + + @ExcelProperty("金额(万元)") + private Boolean safetyInputAmount; + + @ExcelProperty("年度支付金额(万元)") + private Boolean annualPlanAmount; + + @ExcelProperty("自有资金(万元)") + private Boolean annualPlanHaveAmount; + + @ExcelProperty("政府投资-本级财政资金(万元)") + private Boolean declareGovernmentOwnFinanceAmount; + + @ExcelProperty("政府投资-上级补助资金(万元)") + private Boolean declareGovernmentSuperiorFinanceAmount; + + @ExcelProperty("银行贷款(万元)") + private Boolean declareBankLendingAmount; + + @ExcelProperty("其它资金(万元)") + private Boolean declareOtherAmount; + + @ExcelProperty("第一季度") + private Boolean engineeringSpeedOne; + + @ExcelProperty("第二季度") + private Boolean engineeringSpeedTwo; + + @ExcelProperty("第三季度") + private Boolean engineeringSpeedThree; + + @ExcelProperty("第四季度") + private Boolean engineeringSpeedFour; + + @ExcelProperty("初步方案") + private Boolean preliminaryPlanFile; + + @ExcelProperty("附件-佐证材料") + private Boolean supportingMaterialsFile; + + @ExcelProperty("备注") + private Boolean projectRemarks; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportWriter.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportWriter.java new file mode 100644 index 0000000..ac77f57 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/entity/ExcelExportWriter.java @@ -0,0 +1,65 @@ +package com.ningdatech.pmapi.common.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; +import java.util.List; + + +/** + * 文件模板导出对象 + * @author CMM + * @since 2023/02/11 11:26 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ExcelExportWriter { + /** + * 文件名称 + */ + private String fileName; + + /** + * sheet 名称数组 + */ + private List sheets; + + /** + * 是否启用 头部Excel属性。 + * 如果使用,则会读取 class对象注解 ExcelProperty 属性值。 + * 不启用:则会根据heads 动态对列名称去便利 + */ + private Boolean headPropertyFlag; + + /** + * 头部属性class + */ + private Class headPropertyClass; + + /** + * 动态列名称 + * 描述: + * 第一个List 代表:sheet 列表集合 + * 第二个List 代表:表体行数据(集合) + * 第三个list 代表:表体列数据(集合) + */ + private List>> heads; + + + /** + * 数据对象 + * 1、对象写:根据对象固定字段写(分为三层) + * 第二个List 代表:表体行数据(集合) + * 第三个对象(class) 对象 + * List + * + * 2、无对象写(动态表体数据) 分为三层 + * 第一个List 代表:表体行数据(集合) + * 第二个list 代表:表体列数据(集合) + * List> + */ + private Collection datas; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java index 76396ac..63bbb88 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/util/ExcelDownUtil.java @@ -2,11 +2,21 @@ package com.ningdatech.pmapi.common.util; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.util.Collection; +import java.util.List; +import java.util.Objects; import java.util.UUID; import java.util.function.BiConsumer; import javax.servlet.http.HttpServletResponse; +import com.alibaba.druid.wall.violation.ErrorCode; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; +import org.apache.commons.collections4.CollectionUtils; import org.apache.http.HttpStatus; import com.alibaba.fastjson.JSON; @@ -68,4 +78,61 @@ public class ExcelDownUtil { response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); } + public static void excelExportFile(HttpServletResponse response, ExcelExportWriter excelExport) { + try { + if (Objects.isNull(excelExport)) { + throw new BizException("导出失败!"); + } + setExportResponseHeader(excelExport.getFileName(), response); + + ExcelWriter writer = null; + //是否启用头部属性、头部属性类不能为空 + if (Objects.nonNull(excelExport.getHeadPropertyFlag()) && excelExport.getHeadPropertyFlag() && Objects.nonNull(excelExport.getHeadPropertyClass())) { + writer = EasyExcel.write(response.getOutputStream(), excelExport.getHeadPropertyClass()).build(); + }else { + writer = EasyExcel.write(response.getOutputStream()).build(); + } + + int sheetNum = 0; + if (CollectionUtils.isNotEmpty(excelExport.getSheets())){ + sheetNum = excelExport.getSheets().size(); + }else if (CollectionUtils.isNotEmpty(excelExport.getHeads())) { + sheetNum = excelExport.getHeads().size(); + }else if (CollectionUtils.isNotEmpty(excelExport.getDatas())) { + sheetNum = excelExport.getDatas().size(); + } + + if (sheetNum == 0){ + sheetNum = 1; + } + + for (int i = 0; i < sheetNum; i++) { + WriteSheet sheet = EasyExcel.writerSheet(i).build(); + if (CollectionUtils.isNotEmpty(excelExport.getSheets())){ + sheet.setSheetName(excelExport.getSheets().get(i)); + } + if (CollectionUtils.isNotEmpty(excelExport.getHeads())){ + sheet.setHead(excelExport.getHeads().get(i)); + } + + if (CollectionUtils.isNotEmpty(excelExport.getDatas())) { + writer.write((Collection) ((List)excelExport.getDatas()).get(i), sheet); + }else { + writer.write((Collection) null, sheet); + } + } + // 最后 finish + if (null != writer) { + writer.finish(); + } + }catch (Exception e){ + log.error("export file error!", e); + throw new BizException("导出失败!"); + } + } + public static void setExportResponseHeader(String fileName, HttpServletResponse response) throws UnsupportedEncodingException { + // 设置响应头和保存文件名 + response.setContentType(StrPool.CONTENT_TYPE); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodeName(fileName) + ".xls"); + } } 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 e253c82..9d47572 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 @@ -2,12 +2,15 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; +import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -33,4 +36,10 @@ public class ProjectLibController { return projectLibManage.projectLibList(req); } + @GetMapping("/getProjectInfo") + @ApiOperation("获取申报项目信息") + private Project getProjectInfo (@Validated @ModelAttribute 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 c61e5d3..aed9e60 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 @@ -80,4 +80,17 @@ public class ProjectLibManage { return PageVo.of(records, total); } + /** + * + * @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/bean/entity/ExportOption.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ExportOption.java new file mode 100644 index 0000000..b35ab77 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/entity/ExportOption.java @@ -0,0 +1,197 @@ +package com.ningdatech.pmapi.todocenter.bean.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 导出选项实体类 + * + * @author CMM + * @since 2023/02/10 16:38 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ExportOption { + /** + * 导出选项 + */ + @ApiModelProperty("项目ID") + private Boolean id; + + @ApiModelProperty("项目名称") + private Boolean name; + + @ApiModelProperty("行政区划编码") + private Boolean areaCode; + + @ApiModelProperty("行政区划名称") + private Boolean area; + + @ApiModelProperty("项目负责人") + private Boolean responsibleMan; + + @ApiModelProperty("项目负责人手机号") + private Boolean responsibleManMobile; + + @ApiModelProperty("项目联系人") + private Boolean contactName; + + @ApiModelProperty("项目联系人手机号") + private Boolean contactPhone; + + @ApiModelProperty("上级业务主管单位") + private Boolean higherSuperUnit; + + @ApiModelProperty("上级主管单位浙政钉ID") + private Boolean higherSuperUnitCode; + + @ApiModelProperty("本级主管部门") + private Boolean superUnit; + + @ApiModelProperty("本级主管部门浙政钉ID") + private Boolean superUnitCode; + + @ApiModelProperty("建设单位名称") + private Boolean constructionUnitName; + + @ApiModelProperty("建设单位浙政钉ID") + private Boolean buildUnitZheJiangGovernmentDingId; + + @ApiModelProperty("建设单位统一信用代码") + private Boolean buildUnitCode; + + @ApiModelProperty("项目类型") + private Boolean projectType; + + @ApiModelProperty("是否首次新建") + private Boolean isFirst; + + @ApiModelProperty("关联应用") + private Boolean includeApplication; + + @ApiModelProperty("关联应用IRS编码") + private Boolean includeApplicationIRSCode; + + @ApiModelProperty("申报金额(万元)") + private Boolean declareAmount; + + @ApiModelProperty("批复金额") + private Boolean approvedTotalInvestmentIncrease; + + @ApiModelProperty("预算来源") + private Boolean budgetSource; + + @ApiModelProperty("预算年度") + private Boolean budgetYear; + + @ApiModelProperty("项目简介") + private Boolean projectIntroduction; + + @ApiModelProperty("立项依据") + private Boolean buildBasis; + + @ApiModelProperty("建设层级") + private Boolean buildLevel; + + @ApiModelProperty("发改编码") + private Boolean developCode; + + @ApiModelProperty("财政编码") + private Boolean financialCode; + + @ApiModelProperty("信息是否有效") + private Boolean informationValidity; + + @ApiModelProperty("是否数字化改革项目") + private Boolean isDigitalReform; + + @ApiModelProperty("综合应用领域") + private Boolean bizDomain; + + @ApiModelProperty("是否上云") + private Boolean isCloud; + + @ApiModelProperty("云类型") + private Boolean cloudType; + + @ApiModelProperty("四大体系") + private Boolean fourSystems; + + @ApiModelProperty("是否临时增补") + private Boolean isTemporaryAugment; + + @ApiModelProperty("等保级别") + private Boolean protectionLevel; + + @ApiModelProperty("是否密评 0:否 1:是") + private Boolean isSecretComments; + + @ApiModelProperty("业务编号") + private Boolean businessNumber; + + @ApiModelProperty("业务名称") + private Boolean businessName; + + @ApiModelProperty("单位名称") + private Boolean unitName; + + @ApiModelProperty("软件开发(万元)") + private Boolean softwareDevelopmentAmount; + + @ApiModelProperty("云资源、硬件购置(万元)") + private Boolean cloudHardwarePurchaseAmount; + + @ApiModelProperty("第三方服务(万元)") + private Boolean thirdPartyAmount; + + @ApiModelProperty("投入项") + private Boolean safetyInputTitle; + + @ApiModelProperty("内容描述") + private Boolean safetyInputDescribe; + + @ApiModelProperty("金额(万元)") + private Boolean safetyInputAmount; + + @ApiModelProperty("年度支付金额(万元)") + private Boolean annualPlanAmount; + + @ApiModelProperty("自有资金(万元)") + private Boolean annualPlanHaveAmount; + + @ApiModelProperty("政府投资-本级财政资金(万元)") + private Boolean declareGovernmentOwnFinanceAmount; + + @ApiModelProperty("政府投资-上级补助资金(万元)") + private Boolean declareGovernmentSuperiorFinanceAmount; + + @ApiModelProperty("银行贷款(万元)") + private Boolean declareBankLendingAmount; + + @ApiModelProperty("其它资金(万元)") + private Boolean declareOtherAmount; + + @ApiModelProperty("第一季度") + private Boolean engineeringSpeedOne; + + @ApiModelProperty("第二季度") + private Boolean engineeringSpeedTwo; + + @ApiModelProperty("第三季度") + private Boolean engineeringSpeedThree; + + @ApiModelProperty("第四季度") + private Boolean engineeringSpeedFour; + + @ApiModelProperty("初步方案") + private Boolean preliminaryPlanFile; + + @ApiModelProperty("附件-佐证材料") + private Boolean supportingMaterialsFile; + + @ApiModelProperty("备注") + private Boolean projectRemarks; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java index 278d672..4fb8d53 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/bean/vo/ProcessProgressDetailVo.java @@ -75,8 +75,4 @@ public class ProcessProgressDetailVo { * 发起时间 */ private Date startTime; - /** - * 项目申报信息 - */ - private Project declaredProjectInfo; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java index 628901b..2c3c2aa 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java @@ -56,7 +56,8 @@ public class TodoCenterController { */ @GetMapping("/exportPending") public void exportPendingProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ - ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportPendingProjectList); + todoCenterManage.exportPendingProjectList(response,param); + // ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportPendingProjectList); } /** 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 5c849d1..89d6f4e 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 @@ -19,12 +19,15 @@ import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.constant.DingConstant; +import com.ningdatech.pmapi.common.model.entity.ExcelExportDTO; +import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.util.ExcelDownUtil; import com.ningdatech.pmapi.common.util.ExcelExportStyle; import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.todocenter.bean.entity.ExportOption; import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; import com.ningdatech.pmapi.todocenter.bean.vo.ProcessProgressDetailVo; @@ -58,10 +61,8 @@ import com.wflow.workflow.bean.process.enums.ApprovalModeEnum; import com.wflow.workflow.bean.process.enums.NodeTypeEnum; import com.wflow.workflow.bean.process.form.Form; import com.wflow.workflow.bean.process.props.ApprovalProps; -import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo; import com.wflow.workflow.bean.vo.ProcessInstanceVo; import com.wflow.workflow.bean.vo.ProcessTaskVo; -import com.wflow.workflow.bean.vo.TaskCommentVo; import com.wflow.workflow.config.WflowGlobalVarDef; import com.wflow.workflow.enums.ProcessHandlerEnum; import com.wflow.workflow.service.FormService; @@ -69,7 +70,6 @@ import com.wflow.workflow.service.*; import com.wflow.workflow.utils.Executor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import net.sf.jsqlparser.statement.select.Distinct; import org.assertj.core.util.Maps; import org.flowable.bpmn.model.*; import org.flowable.bpmn.model.Process; @@ -86,7 +86,6 @@ import org.flowable.task.api.TaskQuery; import org.flowable.task.api.history.HistoricTaskInstance; import org.flowable.task.service.history.NativeHistoricTaskInstanceQuery; import org.flowable.variable.api.history.HistoricVariableInstance; -import org.flowable.variable.api.history.NativeHistoricVariableInstanceQuery; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; @@ -222,25 +221,54 @@ public class TodoCenterManage { * @since 2023/02/01 17:44 */ public void exportPendingProjectList(HttpServletResponse response, ReqToBeProcessedDTO param) { - PageVo page = queryPendingProjectList(param); - List collect = (List) page.getRecords(); + + Page page = param.page(); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class); + wrapper.like(StrUtil.isNotBlank(param.getProjectName()),Project::getProjectName,param.getProjectName()) + .like(StrUtil.isNotBlank(param.getBuildUnitName()),Project::getBuildUnitName,param.getBuildUnitName()) + .eq(Objects.nonNull(param.getProjectYear()),Project::getProjectYear,param.getProjectYear()) + .eq(Objects.nonNull(param.getIsSupplement()),Project::getIsTemporaryAugment,param.getIsSupplement()) + .ge(Objects.nonNull(param.getProcessLaunchStartTime()),Project::getBeginTime,param.getProcessLaunchStartTime()) + .le(Objects.nonNull(param.getProcessLaunchEndTime()),Project::getEndTime,param.getProcessLaunchEndTime()); + projectService.page(page,wrapper); + + List records = page.getRecords(); + + ExcelExportWriter excelExportWriter = new ExcelExportWriter(); + String fileName = null; if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsSupplement())){ fileName = "待办中心_待我处理_增补项目列表"; }else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsSupplement())){ fileName = "待办中心_待我处理_非增补项目列表"; } - ExcelDownUtil.setFileName(fileName,response); - //数据导出处理函数 - try { - EasyExcel.write(response.getOutputStream(), ResToBeExportDTO.class) - .autoCloseStream(false) - .registerWriteHandler(ExcelExportStyle.formalStyle()) - .sheet(fileName) - .doWrite(collect); - } catch (IOException e) { - throw new BizException("导出失败!"); - } + excelExportWriter.setFileName(fileName); + + List sheetsName = new ArrayList<>(); + sheetsName.add("sheet1"); + // 表体列数据集合 + List columnList = new ArrayList<>(); + // 表体行数据集合 + List> rowList = new ArrayList<>(); + // sheet列表集合 + List>> sheets = new ArrayList<>(); + ExportOption exportOption = param.getExportOption(); + + excelExportWriter.setHeads(sheets); + + List data = records.stream().map(r -> { + ExcelExportDTO res = new ExcelExportDTO(); + BeanUtils.copyProperties(r, res); + return res; + }).collect(Collectors.toList()); + + excelExportWriter.setDatas(data); + excelExportWriter.setSheets(sheetsName); + excelExportWriter.setHeadPropertyClass(ExcelExportDTO.class); + excelExportWriter.setHeadPropertyFlag(Boolean.FALSE); + + + ExcelDownUtil.excelExportFile(response,excelExportWriter); } /** * 流程处理相关操作 @@ -775,10 +803,6 @@ public class TodoCenterManage { } else if (HisProInsEndActId.END.equals(instance.getEndActivityId())) { res.setStatus(ProcessStatusEnum.APPROVED.name()); } - // 查询项目申报信息 - Project projectInfo = projectService.getOne(Wrappers.lambdaQuery(Project.class) - .eq(Project::getInstCode, instanceId)); - res.setDeclaredProjectInfo(projectInfo); return res; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java index 593016c..b792f7d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/req/ReqToBeProcessedDTO.java @@ -1,10 +1,16 @@ package com.ningdatech.pmapi.todocenter.model.dto.req; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.ningdatech.basic.model.PagePo; +import com.ningdatech.pmapi.todocenter.bean.entity.ExportOption; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; @@ -43,5 +49,7 @@ public class ReqToBeProcessedDTO extends PagePo implements Serializable { @NotNull(message = "是否增补字段不能为空!") private Integer isSupplement; + @ApiModelProperty("导出选项") + private ExportOption exportOption; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeExportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeExportDTO.java deleted file mode 100644 index e3b83d1..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/res/ResToBeExportDTO.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.ningdatech.pmapi.todocenter.model.dto.res; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.springframework.format.annotation.DateTimeFormat; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 待办中心待我处理项目列表导出实体 - * - * @author CMM - * @since 2023/01/19 16:42 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ResToBeExportDTO implements Serializable { - private static final long serialVersionUID = 1L; - - @ExcelProperty("项目名称") - private String projectName; - - @ExcelProperty("申报单位") - private String buildUnitName; - - @ExcelProperty("申报金额") - private Integer declareAmount; - - @ExcelProperty("预算年度") - private Integer projectYear; - - @ExcelProperty("流程状态") - private String processStatusName; - - @ExcelProperty("发起时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") - private LocalDateTime processLaunchTime; -} From 5dc58e4abe5b83730485964e13b4b49bfaa9b409 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 11 Feb 2023 14:50:09 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statemachine/action/ProjectDeclareAction.java | 78 +++++++++++----------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java index 4796fb5..7204bbc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/statemachine/action/ProjectDeclareAction.java @@ -28,126 +28,126 @@ public class ProjectDeclareAction { @OnTransition(source = "UNDER_INTERNAL_AUDIT",target = "PENDING_PREQUALIFICATION") public void UNDER_INTERNAL_PASS(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); } @OnTransition(source = "UNDER_INTERNAL_AUDIT",target = "UNDER_INTERNAL_AUDIT_NOT_PASS") public void UNDER_INTERNAL_REJECT(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT_NOT_PASS.getCode()); } @OnTransition(source = "UNDER_INTERNAL_AUDIT",target = "TO_BE_DECLARED") public void UNDER_INTERNAL_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_DECLARED.getCode()); + project.setStatus(ProjectStatusEnum.TO_BE_DECLARED.getCode()); } @OnTransition(source = "PENDING_PREQUALIFICATION",target = "PENDING_PREQUALIFICATION_CHOICE") public void PRELIMINARY_REVIEW_DECLARE(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); } @OnTransition(source = "PENDING_PREQUALIFICATION",target = "UNDER_INTERNAL_AUDIT") public void PENDING_PREQUALIFICATION_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); } @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "PRE_APPLYING") public void PROVINCIAL_DEPARTMENT_REVIEW_PASS(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PRE_APPLYING.getCode()); + project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); } @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED") public void PROVINCIAL_DEPARTMENT_REVIEW_REJECT(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()); + project.setStatus(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()); } @OnTransition(source = "JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS",target = "PENDING_PREQUALIFICATION") public void JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); } @OnTransition(source = "PRE_APPLYING",target = "DEPARTMENT_JOINT_REVIEW") public void PRELIMINARY_REVIEW_PASS(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); } @OnTransition(source = "PRE_APPLYING",target = "PREQUALIFICATION_FAILED") public void PRELIMINARY_REVIEW_REJECT(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); + project.setStatus(ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode()); } @OnTransition(source = "PRE_APPLYING",target = "PENDING_PREQUALIFICATION_CHOICE") public void PRE_APPLYING_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); + project.setStatus(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE.getCode()); } @OnTransition(source = "DEPARTMENT_JOINT_REVIEW",target = "IN_THE_ANNUAL_PLAN") public void DEPARTMENT_UNITED_REVIEW_PASS(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); + project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); } @OnTransition(source = "DEPARTMENT_JOINT_REVIEW",target = "DEPARTMENT_JOINT_REVIEW_FAILED") public void DEPARTMENT_UNITED_REVIEW_REJECT(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode()); + project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW_FAILED.getCode()); } @OnTransition(source = "DEPARTMENT_JOINT_REVIEW",target = "PRE_APPLYING") public void DEPARTMENT_JOINT_REVIEW_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PRE_APPLYING.getCode()); + project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); } @OnTransition(source = "IN_THE_ANNUAL_PLAN",target = "PLAN_TO_BE_DECLARED") public void ANNUAL_PLAN_PROJECT_OPEN_PLAN_DECLARE(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); + project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); } @OnTransition(source = "IN_THE_ANNUAL_PLAN",target = "BE_SUSPENDED") public void ANNUAL_PLAN_SUSPEND(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.BE_SUSPENDED.getCode()); + project.setStatus(ProjectStatusEnum.BE_SUSPENDED.getCode()); } @OnTransition(source = "IN_THE_ANNUAL_PLAN",target = "DEPARTMENT_JOINT_REVIEW") public void IN_THE_ANNUAL_PLAN_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.DEPARTMENT_JOINT_REVIEW.getCode()); } @OnTransition(source = "PLAN_TO_BE_DECLARED",target = "SCHEME_UNDER_REVIEW") public void DECLARE_PLAN(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } @OnTransition(source = "PLAN_TO_BE_DECLARED",target = "IN_THE_ANNUAL_PLAN") public void PLAN_TO_DECLARE_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); + project.setStatus(ProjectStatusEnum.IN_THE_ANNUAL_PLAN.getCode()); } @OnTransition(source = "SCHEME_UNDER_REVIEW",target = "TO_BE_APPROVED") public void PLAN_REVIEW_PASS(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_APPROVED.getCode()); + project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); } @OnTransition(source = "SCHEME_UNDER_REVIEW",target = "SCHEME_REVIEW_FAILED") public void PLAN_REVIEW_REJECT(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); + project.setStatus(ProjectStatusEnum.SCHEME_REVIEW_FAILED.getCode()); } @OnTransition(source = "SCHEME_UNDER_REVIEW",target = "PLAN_TO_BE_DECLARED") public void SCHEME_UNDER_REVIEW_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); + project.setStatus(ProjectStatusEnum.PLAN_TO_BE_DECLARED.getCode()); } @@ -155,51 +155,51 @@ public class ProjectDeclareAction { public void PROJECT_APPROVAL(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); // 待立项批复批复后,项目一级状态变更为已立项 - project.setProjectStatusFirst(ProjectStatusEnum.PROJECT_APPROVED.getCode()); - project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); + project.setStage(ProjectStatusEnum.PROJECT_APPROVED.getCode()); + project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); } @OnTransition(source = "TO_BE_APPROVED",target = "SCHEME_UNDER_REVIEW") public void TO_BE_APPROVED_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode()); } @OnTransition(source = "TO_BE_PURCHASED",target = "UNDER_CONSTRUCTION") public void PURCHASE_PUT_ON_RECORD(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } @OnTransition(source = "TO_BE_PURCHASED",target = "TO_BE_APPROVED") public void TO_BE_PURCHASED_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); // 待采购状态撤回后,项目一级状态回退到未立项 - project.setProjectStatusFirst(ProjectStatusEnum.NOT_APPROVED.getCode()); - project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_APPROVED.getCode()); + project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode()); + project.setStatus(ProjectStatusEnum.TO_BE_APPROVED.getCode()); } @OnTransition(source = "UNDER_CONSTRUCTION",target = "TO_BE_FINALLY_INSPECTED") public void PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } @OnTransition(source = "UNDER_CONSTRUCTION",target = "TO_BE_PURCHASED") public void UNDER_CONSTRUCTION_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); + project.setStatus(ProjectStatusEnum.TO_BE_PURCHASED.getCode()); } @OnTransition(source = "TO_BE_FINALLY_INSPECTED",target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") public void FINAL_ACCEPTANCE_APPLICATION(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); } @OnTransition(source = "TO_BE_FINALLY_INSPECTED",target = "UNDER_CONSTRUCTION") public void TO_BE_FINALLY_INSPECTED_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); + project.setStatus(ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); } @@ -207,18 +207,18 @@ public class ProjectDeclareAction { public void FINAL_ACCEPTANCE_PASS(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); // 终验审核通过后,项目一级状态变更为已归档 - project.setProjectStatusFirst(ProjectStatusEnum.ARCHIVED.getCode()); - project.setProjectStatusSecond(ProjectStatusEnum.ARCHIVED.getCode()); + project.setStage(ProjectStatusEnum.ARCHIVED.getCode()); + project.setStatus(ProjectStatusEnum.ARCHIVED.getCode()); } @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "FINAL_ACCEPTANCE_REVIEW_FAILED") public void FINAL_ACCEPTANCE_REJECT(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); + project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_REVIEW_FAILED.getCode()); } @OnTransition(source = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW",target = "FINAL_ACCEPTANCE_IS_UNDER_REVIEW") public void FINAL_ACCEPTANCE_IS_UNDER_REVIEW_WITHDRAW(Message message){ Project project = (Project) message.getHeaders().get(PROJECT_DECLARE); - project.setProjectStatusSecond(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); + project.setStatus(ProjectStatusEnum.FINAL_ACCEPTANCE_IS_UNDER_REVIEW.getCode()); } @@ -230,11 +230,11 @@ public class ProjectDeclareAction { ProjectStatusEnum projectStatusEnum = stateContext.getTarget().getId(); if (projectStatusEnum.equals(ProjectStatusEnum.PENDING_PREQUALIFICATION_CHOICE)){ Project project = stateContext.getMessage().getHeaders().get(PROJECT_DECLARE, Project.class); - log.info("预审申报事件之前,项目的状态为:{}"+project.getProjectStatusSecond()); + log.info("预审申报事件之前,项目的状态为:{}"+project.getStatus()); if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project)){ - project.setProjectStatusSecond(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); + project.setStatus(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); }else { - project.setProjectStatusSecond(ProjectStatusEnum.PRE_APPLYING.getCode()); + project.setStatus(ProjectStatusEnum.PRE_APPLYING.getCode()); } } } From 4fb0e7d23db79c8c9f7b93048027a6ce247ce6fd Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 11 Feb 2023 14:54:30 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AnnualPlanController.java | 21 +++++++ .../controller/ProjectLibController.java | 4 +- .../pmapi/projectlib/helper/ProjectHelper.java | 46 +++++++++++++++ .../projectlib/manage/AnnualPlanLibManage.java | 25 ++++++++ .../pmapi/projectlib/manage/ProjectLibManage.java | 42 +++----------- .../pmapi/projectlib/model/entity/Project.java | 30 ++++------ .../projectlib/model/req/ProjectLibListReq.java | 64 --------------------- .../pmapi/projectlib/model/req/ProjectListReq.java | 67 ++++++++++++++++++++++ .../projectlib/model/vo/ProjectLibListItemVO.java | 8 +-- 9 files changed, 184 insertions(+), 123 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java delete mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.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 new file mode 100644 index 0000000..718b28a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectlib.controller; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * AnnualPlanController + *

+ * + * @author WendyYang + * @since 14:07 2023/2/11 + */ +@RestController +@Api(tags = "年度计划库") +@RequestMapping("/api/v1/annualPlan") +public class AnnualPlanController { + + +} 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 e253c82..70b9f22 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 @@ -2,7 +2,7 @@ package com.ningdatech.pmapi.projectlib.controller; import com.ningdatech.basic.model.PageVo; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; -import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; +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; @@ -29,7 +29,7 @@ public class ProjectLibController { @GetMapping("/list") @ApiOperation("项目库列表") - public PageVo projectLibList(ProjectLibListReq req) { + public PageVo projectLibList(ProjectListReq req) { return projectLibManage.projectLibList(req); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java new file mode 100644 index 0000000..264d154 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java @@ -0,0 +1,46 @@ +package com.ningdatech.pmapi.projectlib.helper; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; + +/** + *

+ * ProjectHelper + *

+ * + * @author WendyYang + * @since 14:15 2023/2/11 + */ +public class ProjectHelper { + + /** + * 通用项目查询 + * + * @param req 查询条件 + * @return / + **/ + public static LambdaQueryWrapper projectQuery(ProjectListReq req) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(req.getRegionCode() != null, Project::getAreaCode, req.getRegionCode()); + query.eq(req.getUserId() != null, Project::getCreateBy, req.getUserId()); + query.like(req.getProjectName() != null, Project::getProjectName, req.getProjectName()); + query.eq(req.getProjectType() != null, Project::getProjectType, req.getProjectType()); + query.eq(req.getProjectYear() != null, Project::getProjectYear, req.getProjectYear()); + query.eq(req.getStage() != null, Project::getStage, req.getStage()); + query.eq(req.getStatus() != null, Project::getStatus, req.getStatus()); + // 申报金额 + query.ge(req.getDeclareAmountMin() != null, Project::getDeclareAmount, req.getDeclareAmountMin()); + query.le(req.getDeclareAmountMax() != null, Project::getDeclareAmount, req.getDeclareAmountMax()); + // 申报时间 + query.ge(req.getCreateOnMin() != null, Project::getCreateOn, req.getCreateOnMin()); + query.le(req.getCreateOnMax() != null, Project::getCreateOn, req.getCreateOnMax()); + // 批复金额 + query.ge(req.getApproveAmountMin() != null, Project::getApprovalAmount, req.getApproveAmountMin()); + query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()); + + query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()); + return query; + } + +} 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 new file mode 100644 index 0000000..e4e3663 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java @@ -0,0 +1,25 @@ +package com.ningdatech.pmapi.projectlib.manage; + +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Component; + +/** + *

+ * AnnualPlanLibManage + *

+ * + * @author WendyYang + * @since 14:09 2023/2/11 + */ +@Component +@AllArgsConstructor +public class AnnualPlanLibManage { + + private final IProjectService projectService; + + public void annulPlanLibList() { + + } + +} 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 c61e5d3..ab4640e 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 @@ -1,12 +1,12 @@ package com.ningdatech.pmapi.projectlib.manage; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.model.entity.Project; -import com.ningdatech.pmapi.projectlib.model.req.ProjectLibListReq; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.service.IProjectService; import lombok.RequiredArgsConstructor; @@ -14,9 +14,6 @@ import org.springframework.stereotype.Component; import java.util.List; -import static com.ningdatech.pmapi.common.utils.BizUtils.notBlank; -import static com.ningdatech.pmapi.common.utils.BizUtils.notNull; - /** *

* ProjectLibManage @@ -31,33 +28,8 @@ public class ProjectLibManage { private final IProjectService projectService; - private LambdaQueryWrapper projectLibQuery(ProjectLibListReq req) { - LambdaQueryWrapper query = Wrappers.lambdaQuery(Project.class); - notBlank(req.getProjectName(), w -> query.like(Project::getProjectName, w)); - notNull(req.getProjectType(), w -> query.eq(Project::getProjectType, w)); - notNull(req.getProjectYear(), w -> query.eq(Project::getProjectYear, w)); - // 申报金额 批复金额 - notNull(req.getApproveAmountMin(), w -> query.ge(Project::getApprovalAmount, w)); - notNull(req.getApproveAmountMax(), w -> query.le(Project::getApprovalAmount, w)); - - notNull(req.getDeclareAmountMax(), w -> query.le(Project::getDeclareAmount, w)); - notNull(req.getDeclareAmountMin(), w -> query.ge(Project::getDeclareAmount, w)); - // 状态查询 - notNull(req.getStatus1st(), w -> query.ge(Project::getStage, w)); - notNull(req.getStatus2nd(), w -> query.ge(Project::getStatus, w)); - - notNull(req.getCreateOnMin(), w -> query.ge(Project::getCreateOn, w)); - notNull(req.getCreateOnMax(), w -> query.le(Project::getCreateOn, w)); - - notBlank(req.getBuildUnit(), w -> query.like(Project::getBuildUnitName, w)); - - query.orderByDesc(Project::getUpdateOn, Project::getCreateOn); - // TODO 区域编码处理 - return query; - } - - public PageVo projectLibList(ProjectLibListReq req) { - LambdaQueryWrapper query = projectLibQuery(req); + public PageVo projectLibList(ProjectListReq req) { + LambdaQueryWrapper query = ProjectHelper.projectQuery(req); Page page = projectService.page(req.page(), query); long total; if ((total = page.getTotal()) == 0) { @@ -69,11 +41,11 @@ public class ProjectLibManage { item.setProjectName(w.getProjectName()); item.setCreateOn(w.getCreateOn()); item.setDeclaredAmount(w.getDeclareAmount()); - item.setStatus1st(w.getStage()); - item.setStatus2nd(w.getStatus()); + item.setStage(w.getStage()); + item.setStatus(w.getStatus()); item.setProjectType(w.getProjectType()); item.setProjectYear(w.getProjectYear()); - item.setBuildUnit(w.getBuildUnitName()); + item.setBuildOrg(w.getBuildOrgName()); item.setBizDomain(w.getBizDomain()); return item; }); 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 4f64203..e607751 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,7 +1,5 @@ package com.ningdatech.pmapi.projectlib.model.entity; -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -11,15 +9,11 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; -import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** *

- * + * 项目b *

* * @author WendyYang @@ -67,13 +61,13 @@ public class Project 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 +126,10 @@ public class Project 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 +153,10 @@ public class Project implements Serializable { private BigDecimal annualPlanHaveAmount; @ApiModelProperty("年度支付计划-政府投资-本级财政资金(万元)") - private BigDecimal annualPlanGovernmentOwnFinanceAmount; + private BigDecimal annualPlanGovOwnFinanceAmount; @ApiModelProperty("年度支付计划-政府投资-上级补助资金(万元)") - private BigDecimal annualPlanGovernmentSuperiorFinanceAmount; + private BigDecimal annualPlanGovSuperiorFinanceAmount; @ApiModelProperty("年度支付计划-银行贷款(万元)") private BigDecimal annualPlanBankLendingAmount; @@ -267,16 +261,16 @@ public class Project 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; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java deleted file mode 100644 index 4b8a807..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectLibListReq.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ningdatech.pmapi.projectlib.model.req; - -import com.ningdatech.basic.model.PagePo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - *

- * ProjectLibListReq - *

- * - * @author WendyYang - * @since 14:35 2023/2/1 - */ -@Data -@ApiModel("项目库列表查询") -@EqualsAndHashCode(callSuper = true) -public class ProjectLibListReq extends PagePo { - - @ApiModelProperty("区域编码") - private String regionCode; - - @ApiModelProperty("项目名称") - private String projectName; - - @ApiModelProperty("申报单位") - private String buildUnit; - - @ApiModelProperty("项目类型") - private Integer projectType; - - @ApiModelProperty("预算年度") - private Integer projectYear; - - @ApiModelProperty("项目状态") - private Integer status1st; - - @ApiModelProperty("项目状态") - private Integer status2nd; - - @ApiModelProperty("申报金额") - private BigDecimal declareAmountMin; - - @ApiModelProperty("申报金额") - private BigDecimal declareAmountMax; - - @ApiModelProperty("批复金额") - private BigDecimal approveAmountMin; - - @ApiModelProperty("批复金额") - private BigDecimal approveAmountMax; - - @ApiModelProperty("创建时间") - private LocalDateTime createOnMin; - - @ApiModelProperty("创建时间") - private LocalDateTime createOnMax; - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java new file mode 100644 index 0000000..0048072 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java @@ -0,0 +1,67 @@ +package com.ningdatech.pmapi.projectlib.model.req; + +import com.ningdatech.basic.model.PagePo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * ProjectLibListReq + *

+ * + * @author WendyYang + * @since 14:35 2023/2/1 + */ +@Data +@ApiModel("项目列表查询") +@EqualsAndHashCode(callSuper = true) +public class ProjectListReq extends PagePo { + + @ApiModelProperty("区域编码") + private String regionCode; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位") + private String buildOrg; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("预算年度") + private Integer projectYear; + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("申报金额") + private BigDecimal declareAmountMin; + + @ApiModelProperty("申报金额") + private BigDecimal declareAmountMax; + + @ApiModelProperty("批复金额") + private BigDecimal approveAmountMin; + + @ApiModelProperty("批复金额") + private BigDecimal approveAmountMax; + + @ApiModelProperty("创建时间") + private LocalDateTime createOnMin; + + @ApiModelProperty("创建时间") + private LocalDateTime createOnMax; + + @ApiModelProperty("用户ID") + private Long userId; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 3198cdc..73268a0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -34,17 +34,17 @@ public class ProjectLibListItemVO { @ApiModelProperty("项目类型") private Integer projectType; - @ApiModelProperty("项目状态") - private Integer status1st; + @ApiModelProperty("项目阶段") + private Integer stage; @ApiModelProperty("项目状态") - private Integer status2nd; + private Integer status; @ApiModelProperty("申报年度") private Integer projectYear; @ApiModelProperty("申报单位") - private String buildUnit; + private String buildOrg; @ApiModelProperty("业务领域") private String bizDomain; From 026ce0fac78eafc7083fbcbf00baf9b1cdcb39f4 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 11 Feb 2023 14:54:44 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/statemachine/builder/ProjectDeclareStateMachineBuilder.java | 2 +- .../java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 e8ab311..c44f8da 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 @@ -259,7 +259,7 @@ public class ProjectDeclareStateMachineBuilder { @Override public StateMachineContext read(Project contextObj) { - StateMachineContext result = new DefaultStateMachineContext(ProjectStatusEnum.getValueByCode(contextObj.getProjectStatusSecond()), + StateMachineContext result = new DefaultStateMachineContext(ProjectStatusEnum.getValueByCode(contextObj.getStatus()), null, null, null, null, MACHINEID_TO); return result; } 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 89d6f4e..03bfd34 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 @@ -254,6 +254,7 @@ public class TodoCenterManage { List>> sheets = new ArrayList<>(); ExportOption exportOption = param.getExportOption(); + excelExportWriter.setHeads(sheets); List data = records.stream().map(r -> { From bed4d5c0ac7ef57633e3216c3a5325e136a1e67c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Sat, 11 Feb 2023 15:32:05 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=A1=B9=E7=9B=AE=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/dto/DeclaredProjectDto.java | 10 +++++ .../entity/dto/ProjectConditionDto.java | 35 +++++++++++++++++ .../manage/DeclaredProjectManage.java | 44 ++++++++++++++++++---- .../model/entity/ProjectApplication.java | 2 +- 4 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.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 44ce29e..9692307 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 @@ -1,5 +1,7 @@ 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.wflow.workflow.bean.dto.ProcessInstanceUserDto; @@ -35,4 +37,12 @@ public class DeclaredProjectDto implements Serializable { @NotNull private ProcessInstanceUserDto user; + + public Map getFormData(){ + if(CollUtil.isNotEmpty(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/ProjectConditionDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.java new file mode 100644 index 0000000..4e60030 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.java @@ -0,0 +1,35 @@ +package com.ningdatech.pmapi.projectdeclared.entity.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Classname DeclaredProjectDto + * @Description 申报项目 里的条件判断实体 + * @Date 2023/2/1 14:52 + * @Author PoffyZhang + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ProjectConditionDto implements Serializable { + + private Long projectId; + + @ApiModelProperty("申报金额") + private BigDecimal declareAmount; + + @ApiModelProperty("是否临时增补 0:否 1:是") + private Integer isTemporaryAugment; + + @ApiModelProperty("是否数字化改革项目 0:否 1:是") + private Integer isDigitalReform; + + +} 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 0930cd2..65f1418 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 @@ -1,5 +1,6 @@ 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; @@ -10,12 +11,14 @@ import com.ningdatech.pmapi.common.enums.ProjectProessStageEnum; import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; import com.ningdatech.pmapi.projectdeclared.entity.vo.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.enums.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.service.IProjectApplicationService; @@ -144,17 +147,34 @@ public class DeclaredProjectManage { params.setUser(dto.getUser()); params.setProcessUsers(Collections.emptyMap()); //放入条件判断的项目字段 - dto.getFormData().putAll( - JSON.parseObject(JSON.toJSONString(dto.getProjectInfo()), new TypeReference>() { - })); + ProjectConditionDto conditionDto = new ProjectConditionDto(); + BeanUtils.copyProperties(dto.getProjectInfo(),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); + String instanceId = processService.startProcess(model.getProcessDefId(), params); log.info("申报项目成功 【{}】",instanceId); + //保存项目 + saveProject(dto.getProjectInfo(),instanceId,regionCode); + + return instanceId; + } + + /** + * 申报项目 时 新增项目到项目库 + * @param projectDto + * @param instanceId + */ + private void saveProject(ProjectDto projectDto,String instanceId,String regionCode) { //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 try{ + //保存项目表信息 Project project = new Project(); - BeanUtils.copyProperties(dto.getProjectInfo(),project); + BeanUtils.copyProperties(projectDto,project); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); project.setAreaCode(regionCode); @@ -162,12 +182,20 @@ public class DeclaredProjectManage { project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode()); project.setInstCode(instanceId); projectService.save(project); + //保存项目应用 + if(CollUtil.isNotEmpty(projectDto.getApplicationList())){ + List applications = projectDto.getApplicationList().stream().map(application -> { + ProjectApplication projectApplication = new ProjectApplication(); + BeanUtils.copyProperties(application, projectApplication); + projectApplication.setProjectId(project.getId()); + return projectApplication; + }).collect(Collectors.toList()); + projectApplicationService.saveBatch(applications); + } }catch (Exception e){ log.error("项目信息入库错误 ",e); - throw new BusinessException("项目信息入库错误 请注意格式"); + throw new BusinessException("项目信息入库错误 :" + e.getMessage()); } - - return instanceId; } /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java index 8916463..1e9e569 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java @@ -29,7 +29,7 @@ public class ProjectApplication implements Serializable { private Long id; @ApiModelProperty("项目ID") - private String projectId; + private Long projectId; @ApiModelProperty("是否初次建设 0否 1是") private Integer isFirst;