diff --git a/pmapi/pom.xml b/pmapi/pom.xml index 3748d36..27b7fc7 100644 --- a/pmapi/pom.xml +++ b/pmapi/pom.xml @@ -187,10 +187,6 @@ org.slf4j slf4j-log4j12 - - - - @@ -203,10 +199,6 @@ - - com.ningdatech - nd-flowable-starter - com.ningdatech @@ -235,12 +227,10 @@ com.ningdatech nd-cache-starter - 1.0.0 com.ningdatech nd-basic - 1.0.0 com.kingbase.dialect @@ -251,17 +241,14 @@ com.alibaba easyexcel-core - 3.1.2 com.ningdatech nd-file-starter - 1.0.0 com.ningdatech - nd-zwdd-starter - 1.0.0 + nd-flowable-starter diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java index cabc31e..f559dc8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java @@ -1,11 +1,11 @@ package com.ningdatech.pmapi.declared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectParamDto; +import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectDto; +import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectListParamDto; import com.ningdatech.pmapi.declared.manage.DeclaredProjectManage; -import com.wflow.bean.vo.NdDeclaredProjectVo; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.wflow.workflow.bean.vo.ProcessStartParamsVo; -import com.wflow.workflow.service.ProcessInstanceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -26,28 +26,24 @@ import org.springframework.web.bind.annotation.*; @Api(value = "DeclaredProject", tags = "申报管理-申报项目") @RequiredArgsConstructor public class DeclaredProjectController { - private final ProcessInstanceService processService; - private final DeclaredProjectManage declaredProjectManage; @ApiOperation(value = "申报项目已申报列表", notes = "申报项目已申报列表") @GetMapping("/list") - public PageVo list(@Validated @ModelAttribute DeclaredProjectParamDto params) {; + public PageVo list(@Validated @ModelAttribute DeclaredProjectListParamDto params) {; return declaredProjectManage.page(params); } @ApiOperation(value = "申报项目草稿箱", notes = "申报项目草稿箱") @GetMapping("/draft") - public PageVo draft(@Validated @ModelAttribute ProcessStartParamsVo params) { + public PageVo draft(@Validated @ModelAttribute ProcessStartParamsVo params) { return PageVo.empty(); } @ApiOperation(value = "申报项目", notes = "申报项目") - @PostMapping("/start/{defId}") - public String startTheProcess(@PathVariable String defId, - @RequestBody ProcessStartParamsVo params) { - String instanceId = processService.startProcess(defId, params); + @PostMapping("/start") + public String startTheProcess(@Validated @RequestBody DeclaredProjectDto dto) { + String instanceId = declaredProjectManage.startTheProcess(dto); return "启动流程实例 " + instanceId + " 成功"; } - } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectDto.java new file mode 100644 index 0000000..2fa6883 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectDto.java @@ -0,0 +1,33 @@ +package com.ningdatech.pmapi.declared.entity.dto; + +import com.ningdatech.pmapi.projectlib.model.entity.Project; +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; + +/** + * @Classname DeclaredProjectDto + * @Description 申报项目 + * @Date 2023/2/1 14:52 + * @Author PoffyZhang + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DeclaredProjectDto implements Serializable { + + @NotNull + private Project projectInfo; + + private Map formData; + + @NotBlank + private String regionCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectParamDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectListParamDto.java similarity index 91% rename from pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectParamDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectListParamDto.java index 04f1a2b..526e92d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectParamDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectListParamDto.java @@ -16,7 +16,7 @@ import lombok.NoArgsConstructor; @Builder @NoArgsConstructor @AllArgsConstructor -public class DeclaredProjectParamDto extends PagePo { +public class DeclaredProjectListParamDto extends PagePo { private String projectName; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java index 0e8f80d..cd74382 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java @@ -1,20 +1,32 @@ package com.ningdatech.pmapi.declared.manage; +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.model.PageVo; -import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectParamDto; -import com.wflow.bean.entity.NdDeclaredProject; -import com.wflow.bean.vo.NdDeclaredProjectVo; -import com.wflow.service.NdDeclaredProjectService; +import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectDto; +import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectListParamDto; +import com.ningdatech.pmapi.projectlib.enums.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; +import com.ningdatech.pmapi.projectlib.service.INdProjectService; +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; @@ -29,28 +41,77 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class DeclaredProjectManage { - private final NdDeclaredProjectService declaredProjectService; - - public PageVo page(DeclaredProjectParamDto params) { - Page page = params.page(); - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(NdDeclaredProject.class) - .ge(Objects.nonNull(params.getStartTime()), NdDeclaredProject::getCreateOn, params.getStartTime()) - .le(Objects.nonNull(params.getEndTime()), NdDeclaredProject::getCreateOn, params.getEndTime()) - .eq(Objects.nonNull(params.getProjectType()), NdDeclaredProject::getProjectType, params.getProjectType()) - .eq(Objects.nonNull(params.getProjectYear()), NdDeclaredProject::getProjectYear, params.getProjectYear()) - .eq(Objects.nonNull(params.getProjectStatusFirst()), NdDeclaredProject::getProjectStatusFirst, params.getProjectStatusFirst()) - .eq(Objects.nonNull(params.getProjectStatusSecond()), NdDeclaredProject::getProjectStatusSecond, params.getProjectStatusSecond()) - .like(StringUtils.isNotBlank(params.getProjectName()), NdDeclaredProject::getProjectName, params.getProjectName()) - .orderByDesc(NdDeclaredProject::getUpdateOn); - declaredProjectService.page(page,wrapper); + private final INdProjectService ndProjectService; + + private final ProcessInstanceService processService; + + private final ProcessModelService processModelService; + + public PageVo page(DeclaredProjectListParamDto params) { + Page page = params.page(); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class) + .ge(Objects.nonNull(params.getStartTime()), Project::getCreateOn, params.getStartTime()) + .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()) + .like(StringUtils.isNotBlank(params.getProjectName()), Project::getProjectName, params.getProjectName()) + .orderByDesc(Project::getUpdateOn); + ndProjectService.page(page,wrapper); if(0L == page.getTotal()){ return PageVo.empty(); } - List res = page.getRecords().stream().map(record -> { - NdDeclaredProjectVo vo = new NdDeclaredProjectVo(); + List res = page.getRecords().stream().map(record -> { + ProjectLibListItemVO vo = new ProjectLibListItemVO(); BeanUtils.copyProperties(record, vo); return vo; }).collect(Collectors.toList()); return PageVo.of(res,page.getTotal()); } + + /** + * 启动实例 + * @param dto + * @return + */ + public String startTheProcess(DeclaredProjectDto dto) { + String regionCode = dto.getRegionCode(); + + WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) + .eq(WflowModels::getRegionCode, regionCode) + .eq(WflowModels::getFormName, "单位内部审批流程") + .last("limit 1")); + + if(Objects.isNull(model)){ + throw new BusinessException(String.format("此 【%s】区域找不到流程配置",regionCode)); + } + + ProcessStartParamsVo params = new ProcessStartParamsVo(); + params.setDeptId("6179678"); + params.setProcessUsers(Collections.emptyMap()); + dto.getFormData().putAll( + JSON.parseObject(JSON.toJSONString(dto.getProjectInfo()), new TypeReference>() { + })); + params.setFormData(dto.getFormData()); + String instanceId = processService.startProcess(model.getProcessDefId(), params); + + //流程启动之后 入库项目 重要业务信息 用于列表查询 展示 + try{ + Project project = new Project(); + BeanUtils.copyProperties(dto.getProjectInfo(),project); + 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.setInstCode(instanceId); + ndProjectService.save(project); + }catch (Exception e){ + log.error("项目信息入库错误 ",e); + throw new BusinessException("项目信息入库错误 请注意格式"); + } + + return instanceId; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectStatusEnum.java new file mode 100644 index 0000000..ac7bb06 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectStatusEnum.java @@ -0,0 +1,54 @@ +package com.ningdatech.pmapi.projectlib.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum ProjectStatusEnum { + /** + * 项目状态 + */ + NOT_APPROVED (10000,"未立项"), + UNDER_INTERNAL_AUDIT (10001,"单位内部审核中"), + UNDER_INTERNAL_AUDIT_NOT_PASS (10002,"单位内部审核不通过"), + PENDING_PREQUALIFICATION (10003,"待预审"), + JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS (10004,"省级部门联审中"), + THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED (10005,"省级部门联审不通过"), + PRE_APPLYING (10006,"预审中"), + PREQUALIFICATION_FAILED (10007,"预审不通过"), + DEPARTMENT_JOINT_REVIEW (10008,"部门联审中"), + DEPARTMENT_JOINT_REVIEW_FAILED (10009,"部门联审不通过"), + IN_THE_ANNUAL_PLAN (10010,"年度计划中"), + BE_SUSPENDED (10011,"被暂缓"), + SCHEME_UNDER_REVIEW (10012,"方案评审中"), + SCHEME_REVIEW_FAILED (10013,"方案评审不通过"), + TO_BE_APPROVED (10014,"待立项批复"), + PROJECT_APPROVED (20000,"已立项"), + TO_BE_PURCHASED (20001,"待采购"), + UNDER_CONSTRUCTION (20002,"建设中"), + TO_BE_FINALLY_INSPECTED (20003,"待终验"), + FINAL_ACCEPTANCE_IS_UNDER_REVIEW (20004,"终验审核中"), + FINAL_ACCEPTANCE_REVIEW_FAILED (20005,"终验审核不通过"), + ARCHIVED (30000,"已归档"); + + private Integer code; + private String desc; + + public static String getDescByCode(Integer code) { + if(Objects.isNull(code)){ + return StringUtils.EMPTY; + } + for (ProjectStatusEnum t : ProjectStatusEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectTypeEnum.java new file mode 100644 index 0000000..1aa579a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectTypeEnum.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.projectlib.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum ProjectTypeEnum { + /** + * 项目类型 + */ + BUILD (1,"建设"), + DEV_OPS (2,"运维"); + + private Integer code; + private String desc; + + public static String getDescByCode(Integer code) { + if(Objects.isNull(code)){ + return StringUtils.EMPTY; + } + for (ProjectTypeEnum t : ProjectTypeEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } +} 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..ee9ac54 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java @@ -0,0 +1,294 @@ +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.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @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 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; + + 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 higherSuperUnit; + + @ApiModelProperty("上级主管部门Code") + private String higherSuperUnitCode; + + @ApiModelProperty("主管部门名称") + private String superUnit; + + @ApiModelProperty("主管部门Code") + private String superUnitCode; + + @ApiModelProperty("前端所需验证字段") + private Integer allApplicationsDone; + + @ApiModelProperty("流程实例id") + private String processInsId; + + @ApiModelProperty("流程实例 formId") + private String formId; + + @ApiModelProperty("项目一级状态 10000 20000 30000") + private Integer projectStatusFirst; + + @ApiModelProperty("项目二级状态") + private Integer projectStatusSecond; + + @ApiModelProperty("单位名称") + private String orgName; + @ApiModelProperty("单位code") + private String orgCode; + + private Long createBy; + + private Long updateBy; + +} 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 933a8ce..4f310c7 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 @@ -281,8 +281,18 @@ public class Project implements Serializable { @ApiModelProperty("前端所需验证字段") private Integer allApplicationsDone; - private Long createBy; + @ApiModelProperty("项目一级状态 10000 20000 30000") + private Integer projectStatusFirst; + + @ApiModelProperty("项目二级状态") + private Integer projectStatusSecond; + @ApiModelProperty("单位名称") + private String orgName; + @ApiModelProperty("单位code") + private String orgCode; + + private Long createBy; private Long updateBy; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java index 6e93851..7d11e1f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java @@ -50,16 +50,17 @@ public class SysProcdefController { return processModelService.saveProcess(modelHistory); } + @ApiOperation(value = "系统流程配置启用(停用)", notes = "系统流程配置启用(停用)") @PutMapping("/{formId}/active/{state}") - public Object enOrDisModel(@PathVariable String formId, + public String enOrDisModel(@PathVariable String formId, @PathVariable Boolean state) { modelGroupService.enOrDisModel(formId, !state); - return R.ok(Boolean.TRUE.equals(state) ? "启用流程成功":"停用流程成功"); + return Boolean.TRUE.equals(state) ? "启用流程成功":"停用流程成功"; } @ApiOperation(value = "系统流程配置发布", notes = "系统流程配置发布") @PostMapping("/deploy/{formId}") - public String save(@Validated @PathVariable String formId) { + public String deploy(@Validated @PathVariable String formId) { return processModelService.deployProcess(formId); } } diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java new file mode 100644 index 0000000..2f74135 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/Node.java @@ -0,0 +1,23 @@ +package com.ningdatech.pmapi.sys.processDef; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class Node implements Serializable { + private static final long serialVersionUID = -45475579271153023L; + + private String id; + + private String parentId; + + private String name; + + private T props; + + private Node children; + + private List> branchs; +} \ No newline at end of file diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java new file mode 100644 index 0000000..8c47dd8 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/sys/processDef/ProcessDefTest.java @@ -0,0 +1,79 @@ +package com.ningdatech.pmapi.sys.processDef; + +import com.alibaba.fastjson.JSON; +import org.junit.Test; + +import java.io.Serializable; +import java.util.List; + +/** + * @Classname ProcessTest + * @Description + * @Date 2023/2/4 9:54 + * @Author PoffyZhang + */ +public class ProcessDefTest { + + + @Test + public void test() { + String processStr = "{\"id\":\"node_039152532706\",\"name\":\"审批单位\",\"type\":\"ORG\",\"props\":{\"regionCode\":\"\",\"orgCode\":\"GO_3bc86256687a4884ae410af00682b762\",\"type\":\"DEFAULT\",\"processDefId\":\"\",\"subNode\":[]},\"children\":{},\"parentId\":\"root\"}"; + + Node node = JSON.parseObject(processStr, Node.class); + + OrgProps props = JSON.parseObject(node.getProps().toString(), OrgProps.class); + System.out.println(props.getOrgCode()); + } + + public static class OrgProps { + private String regionCode; + + private String orgCode; + + private String type; + + private String processDefId; + + private List subNode; + + public String getRegionCode() { + return regionCode; + } + + public void setRegionCode(String regionCode) { + this.regionCode = regionCode; + } + + public String getOrgCode() { + return orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getProcessDefId() { + return processDefId; + } + + public void setProcessDefId(String processDefId) { + this.processDefId = processDefId; + } + + public List getSubNode() { + return subNode; + } + + public void setSubNode(List subNode) { + this.subNode = subNode; + } + } +} diff --git a/pom.xml b/pom.xml index bd757f0..beccbd0 100644 --- a/pom.xml +++ b/pom.xml @@ -123,6 +123,32 @@ kingbase8-8.2.0 1.0
+ + + com.alibaba + easyexcel-core + 3.1.2 + + + com.ningdatech + nd-file-starter + 1.0.0 + + + com.ningdatech + nd-zwdd-starter + 1.0.0 + + + com.ningdatech + nd-cache-starter + 1.0.0 + + + com.ningdatech + nd-log-starter + 1.0.0 +