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 98213a8..d47468f 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 @@ -7,6 +7,8 @@ import com.alibaba.fastjson.JSONObject; import com.google.common.collect.Lists; import com.ningdatech.file.service.FileService; import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeNewEnum; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.provincial.model.dto.FileDTO; @@ -39,7 +41,7 @@ public class ApplicationConverter { .regionName(projectInfo.getArea()) .projectName(projectInfo.getProjectName()) .projectId(projectInfo.getProjectCode()) - .projectType(projectInfo.getProjectType()) + .projectType(convertProjectType(projectInfo.getProjectType())) .totalMoney(projectInfo.getDeclareAmount()) .yearBudget(projectInfo.getAnnualPlanAmount()) .budgetFrom(checkAddBudget(projectInfo.getDeclareHaveAmount() @@ -77,6 +79,21 @@ public class ApplicationConverter { .build(); } + private static Integer convertProjectType(String projectType) { + if(StringUtils.isBlank(projectType)){ + return null; + } + + if(Lists.newArrayList(ProjectTypeNewEnum.FIRST_BUILD.getCode(), + ProjectTypeNewEnum.SJ_BUILD.getCode(),ProjectTypeNewEnum.SZ_BUILD.getCode()).contains(projectType)){ + return ProjectTypeEnum.BUILD.getCode(); + }else if(Lists.newArrayList(ProjectTypeNewEnum.NEW_OPERA.getCode(), + ProjectTypeNewEnum.XU_OPERA.getCode()).contains(projectType)){ + return ProjectTypeEnum.DEV_OPS.getCode(); + } + return null; + } + private static String checkAddBudget(BigDecimal declareHaveAmount, BigDecimal declareGovOwnFinanceAmount, BigDecimal declareGovSuperiorFinanceAmount, BigDecimal declareBankLendingAmount, BigDecimal otherAmount) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/provincial/model/dto/ProvincialProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/provincial/model/dto/ProvincialProjectDTO.java index 28b59df..4a6f91b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/provincial/model/dto/ProvincialProjectDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/provincial/model/dto/ProvincialProjectDTO.java @@ -43,7 +43,7 @@ public class ProvincialProjectDTO implements Serializable { private String projectId; @ApiModelProperty("项目类型 1新建 2续建") - private String projectType; + private Integer projectType; @ApiModelProperty("项目总投资(万元)") private BigDecimal totalMoney; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/CpuController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/CpuController.java index 8178ce1..8311116 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/CpuController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/CpuController.java @@ -25,25 +25,25 @@ public class CpuController { private final CpuManage cpuManage; - @ApiOperation(value = "CPU初始化任务", notes = "CPU初始化任务") - @PostMapping("/start") + @ApiOperation(value = "内存初始化任务", notes = "内存初始化任务") + @PostMapping("/m-start") @WebLog("CPU初始化任务") - public String start() { + public String mStart() { cpuManage.whileTrueTask(); return "初始化成功"; } - @ApiOperation(value = "提升CPU", notes = "提升CPU") - @PostMapping("/high/{cpu}") - @WebLog("提升CPU") - public String high(@PathVariable Integer cpu) { - cpuManage.open(cpu); + @ApiOperation(value = "提升内存", notes = "提升内存") + @PostMapping("/m-high/{num}") + @WebLog("提升内存") + public String high(@PathVariable Integer num) { + cpuManage.open(num); return "提高成功"; } - @ApiOperation(value = "关闭CPU任务", notes = "关闭CPU任务") - @PostMapping("/close") - @WebLog("关闭CPU任务") + @ApiOperation(value = "关闭提升内存", notes = "关闭提升内存") + @PostMapping("/m-close") + @WebLog("关闭提升内存") public String close() { cpuManage.close(); return "关闭成功";