Bläddra i källkod

单位子流程 发布

tags/24080901
PoffyZhang 1 år sedan
förälder
incheckning
d1008692cf
6 ändrade filer med 449 tillägg och 28 borttagningar
  1. +3
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java
  2. +53
    -23
      pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java
  3. +54
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectStatusEnum.java
  4. +34
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectTypeEnum.java
  5. +294
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java
  6. +11
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java

+ 3
- 4
pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java Visa fil

@@ -4,9 +4,8 @@ import com.ningdatech.basic.model.PageVo;
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;
@@ -31,13 +30,13 @@ public class DeclaredProjectController {

@ApiOperation(value = "申报项目已申报列表", notes = "申报项目已申报列表")
@GetMapping("/list")
public PageVo<NdDeclaredProjectVo> list(@Validated @ModelAttribute DeclaredProjectListParamDto params) {;
public PageVo<ProjectLibListItemVO> list(@Validated @ModelAttribute DeclaredProjectListParamDto params) {;
return declaredProjectManage.page(params);
}

@ApiOperation(value = "申报项目草稿箱", notes = "申报项目草稿箱")
@GetMapping("/draft")
public PageVo<NdDeclaredProjectVo> draft(@Validated @ModelAttribute ProcessStartParamsVo params) {
public PageVo<ProjectLibListItemVO> draft(@Validated @ModelAttribute ProcessStartParamsVo params) {
return PageVo.empty();
}



+ 53
- 23
pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java Visa fil

@@ -1,15 +1,19 @@
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.DeclaredProjectDto;
import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectListParamDto;
import com.wflow.bean.entity.NdDeclaredProject;
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.bean.vo.NdDeclaredProjectVo;
import com.wflow.service.NdDeclaredProjectService;
import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.vo.ProcessStartParamsVo;
import com.wflow.workflow.service.ProcessInstanceService;
import com.wflow.workflow.service.ProcessModelService;
@@ -19,8 +23,10 @@ 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;

@@ -35,29 +41,29 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class DeclaredProjectManage {

private final NdDeclaredProjectService declaredProjectService;
private final INdProjectService ndProjectService;

private final ProcessInstanceService processService;

private final ProcessModelService processModelService;

public PageVo<NdDeclaredProjectVo> page(DeclaredProjectListParamDto params) {
Page<NdDeclaredProject> page = params.page();
LambdaQueryWrapper<NdDeclaredProject> 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);
public PageVo<ProjectLibListItemVO> page(DeclaredProjectListParamDto params) {
Page<Project> page = params.page();
LambdaQueryWrapper<Project> 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<NdDeclaredProjectVo> res = page.getRecords().stream().map(record -> {
NdDeclaredProjectVo vo = new NdDeclaredProjectVo();
List<ProjectLibListItemVO> res = page.getRecords().stream().map(record -> {
ProjectLibListItemVO vo = new ProjectLibListItemVO();
BeanUtils.copyProperties(record, vo);
return vo;
}).collect(Collectors.toList());
@@ -70,18 +76,42 @@ public class DeclaredProjectManage {
* @return
*/
public String startTheProcess(DeclaredProjectDto dto) {
String defId = null;
String regionCode = dto.getRegionCode();

processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode,regionCode)
.eq(WflowModels::getFormName,"单位内部审批流程")
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<Map<String, Object>>() {
}));
params.setFormData(dto.getFormData());
return processService.startProcess(defId, params);
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;
}
}

+ 54
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectStatusEnum.java Visa fil

@@ -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;
}
}

+ 34
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enums/ProjectTypeEnum.java Visa fil

@@ -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;
}
}

+ 294
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDto.java Visa fil

@@ -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;

/**
* <p>
*
* </p>
*
* @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;

}

+ 11
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java Visa fil

@@ -275,8 +275,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;

}

Laddar…
Avbryt
Spara