From 5cd33d7067a0f222f00735a3e7f9a78d1966fa9c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 12 Apr 2023 15:53:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E7=9C=81=E5=B1=80=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../converter/ApplicationConverter.java | 41 +++++++++++++++++++--- .../pmapi/projectlib/model/dto/ProjectDTO.java | 3 ++ .../pmapi/projectlib/model/entity/Project.java | 4 +++ .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 3 ++ .../ProjectProvincialAuditStatusEnum.java | 5 ++- .../task/CheckProvincialReviewResultTask.java | 14 +++++++- 6 files changed, 64 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java index 741aece..f2f819c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java @@ -6,8 +6,11 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.provincial.model.dto.ProvincialApplicationDTO; import com.ningdatech.pmapi.provincial.model.dto.ProvincialProjectDTO; import org.assertj.core.util.Lists; + +import java.math.BigDecimal; import java.util.Collections; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -23,13 +26,15 @@ public class ApplicationConverter { .regionCode(projectInfo.getAreaCode()) .regionName(projectInfo.getArea()) .projectName(projectInfo.getProjectName()) - .projectId(String.valueOf(projectInfo.getId())) + .projectId(projectInfo.getProjectCode()) .projectType(projectInfo.getProjectType()) .totalMoney(projectInfo.getDeclareAmount()) .yearBudget(projectInfo.getAnnualPlanAmount()) - .budgetFrom(projectInfo.getDeclareHaveAmount() + "," + - projectInfo.getDeclareGovOwnFinanceAmount() + "," - + projectInfo.getDeclareGovSuperiorFinanceAmount()) + .budgetFrom(checkAddBudget(projectInfo.getDeclareHaveAmount() + ,projectInfo.getDeclareGovOwnFinanceAmount(), + projectInfo.getDeclareGovSuperiorFinanceAmount(), + projectInfo.getDeclareBankLendingAmount(), + projectInfo.getDeclareOtherAmount())) .year(String.valueOf(projectInfo.getProjectYear())) .financialCode(projectInfo.getFinancialCode()) .developCode(projectInfo.getDevelopCode()) @@ -52,10 +57,35 @@ public class ApplicationConverter { .otherFile(projectInfo.getPreliminaryPlanFile()) .projectRemark(projectInfo.getProjectRemarks()) .includeApplication(projectInfo.getIncludeApplication()) + .projectApplyFile(projectInfo.getProjectApplicationForm()) + .researchReport(projectInfo.getPreliminaryPlanFile()) .applicationInfo(convertApplications(applications)) .build(); } + private static String checkAddBudget(BigDecimal declareHaveAmount, BigDecimal declareGovOwnFinanceAmount, + BigDecimal declareGovSuperiorFinanceAmount,BigDecimal declareBankLendingAmount, + BigDecimal otherAmount) { + StringBuffer sb = new StringBuffer(); + + if(Objects.nonNull(declareHaveAmount) && declareHaveAmount.compareTo(BigDecimal.ZERO) > 0){ + sb.append("自有资金,"); + } + if(Objects.nonNull(declareGovOwnFinanceAmount) && declareGovOwnFinanceAmount.compareTo(BigDecimal.ZERO) > 0){ + sb.append("政府投资-本级财政资金,"); + } + if(Objects.nonNull(declareGovSuperiorFinanceAmount) && declareGovSuperiorFinanceAmount.compareTo(BigDecimal.ZERO) > 0){ + sb.append("政府投资-上级财政资金,"); + } + if(Objects.nonNull(declareGovSuperiorFinanceAmount) && declareGovSuperiorFinanceAmount.compareTo(BigDecimal.ZERO) > 0){ + sb.append("银行贷款,"); + } + if(Objects.nonNull(otherAmount) && otherAmount.compareTo(BigDecimal.ZERO) > 0){ + sb.append("其他资金"); + } + return sb.toString(); + } + //放入项目 app private static List convertApplications(List applications) { if(CollUtil.isEmpty(applications)){ @@ -98,6 +128,9 @@ public class ApplicationConverter { .isProduceCommonComponent(projectApplication.getProduceCommonComponent()) .produceCommonComponent(projectApplication.getProduceCommonComponents()) .publishSide(projectApplication.getPublishSide()) + .isS2(projectApplication.getIsAccountAppName()) + .accountAppName(projectApplication.getAccountAppName()) + .applicationEstimateFile(projectApplication.getApplicationEstimateFile()) .build(); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java index 16e0d27..31ddadf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java @@ -285,6 +285,9 @@ public class ProjectDTO implements Serializable { @ApiModelProperty("上级条线单位审核意见") private String higherLineSuperOrgReviewComments; + @ApiModelProperty("项目申报书") + private String projectApplicationForm; + private Map dynamicForm; } 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 2b3831b..bc09959 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 @@ -317,4 +317,8 @@ public class Project implements Serializable { @ApiModelProperty("21位项目编号") private String projectCode; + + @ApiModelProperty("项目申报书") + private String projectApplicationForm; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 1026a9a..6a4b07e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -316,6 +316,9 @@ public class ProjectDetailVO { @ApiModelProperty("21位项目编号") private String projectCode; + @ApiModelProperty("项目申报书") + private String projectApplicationForm; + private LocalDateTime createOn; private LocalDateTime updateOn; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/provincial/enumeration/ProjectProvincialAuditStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/provincial/enumeration/ProjectProvincialAuditStatusEnum.java index e830d4e..7a90c46 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/provincial/enumeration/ProjectProvincialAuditStatusEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/provincial/enumeration/ProjectProvincialAuditStatusEnum.java @@ -18,9 +18,12 @@ public enum ProjectProvincialAuditStatusEnum { /** * 省级联审的状态 */ + NOT_AUDIT(0,"未审核"), AUDITING(1,"审核中"), SUCCESS(2,"审核通过"), - FAIL(3,"审核不通过"); + FAIL(3,"审核不通过"), + WITHDRAW(4,"被撤回"), + BACK(5,"退回地市"); private Integer code; private String desc; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java index d343be0..9097818 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CheckProvincialReviewResultTask.java @@ -67,7 +67,9 @@ public class CheckProvincialReviewResultTask { ProvincialProjectRes projectRes = JSON.parseObject(JSON.toJSONString(apiResponse.getData()), ProvincialProjectRes.class); - if(ProjectProvincialAuditStatusEnum.AUDITING.getCode().equals(projectRes.getProjectStatus())){ + if(ProjectProvincialAuditStatusEnum.NOT_AUDIT.getCode().equals(projectRes.getProjectStatus())){ + log.info("此项目 【{}】 还未审核",projectRes.getProjectId()); + } else if(ProjectProvincialAuditStatusEnum.AUDITING.getCode().equals(projectRes.getProjectStatus())){ log.info("此项目 【{}】 还在审核中",projectRes.getProjectId()); }else if(ProjectProvincialAuditStatusEnum.SUCCESS.getCode().equals(projectRes.getProjectStatus())){ log.info("此项目 【{}】 审核通过",projectRes.getProjectId()); @@ -79,6 +81,16 @@ public class CheckProvincialReviewResultTask { stateMachineUtils.reject(project); project.setUpdateOn(LocalDateTime.now()); projectService.updateById(project); + }else if(ProjectProvincialAuditStatusEnum.WITHDRAW.getCode().equals(projectRes.getProjectStatus())){ + log.info("此项目 【{}】 审核被撤回",projectRes.getProjectId()); + stateMachineUtils.reject(project); + project.setUpdateOn(LocalDateTime.now()); + projectService.updateById(project); + }else if(ProjectProvincialAuditStatusEnum.BACK.getCode().equals(projectRes.getProjectStatus())){ + log.info("此项目 【{}】 审核被退回",projectRes.getProjectId()); + stateMachineUtils.reject(project); + project.setUpdateOn(LocalDateTime.now()); + projectService.updateById(project); }else{ log.info("此项目 【{}】 审核结果错误",projectRes.getProjectId()); }