From bc41a676bb2825ded7270d35138190ca087ad414 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 2 Aug 2023 09:46:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/handler/GlobalResponseHandler.java | 3 +- .../controller/AnnualPlanController.java | 1 - .../pmapi/projectlib/model/vo/ProjectDetailVO.java | 19 ++++++ .../safety/controller/SafetyRiskController.java | 54 ++++++++++++++++ .../pmapi/safety/manage/SafetyRiskManage.java | 34 ++++++++++ .../pmapi/safety/model/vo/ProjectMonitorVO.java | 75 ++++++++++++++++++++++ 6 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java index ad76321..7f7bb57 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java @@ -30,7 +30,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.ningdatech.pmapi.ding.controller", "com.ningdatech.pmapi.filemanage.controller", "com.ningdatech.pmapi.performance.controller", - "com.ningdatech.pmapi.irs.controller" + "com.ningdatech.pmapi.irs.controller", + "com.ningdatech.pmapi.safety.controller" }) public class GlobalResponseHandler implements ResponseBodyAdvice { 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 index 8850698..5202441 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/AnnualPlanController.java @@ -37,7 +37,6 @@ public class AnnualPlanController { @GetMapping("/list") @ApiOperation("年度计划库列表") - @WebLog("年度计划库列表") public PageVo annualPlanLibList(ProjectListReq req) { return annualPlanLibManage.annulPlanLibList(req); } 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 522efdb..5815201 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 @@ -10,6 +10,7 @@ import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo; import io.swagger.annotations.ApiModel; @@ -422,4 +423,22 @@ public class ProjectDetailVO { this.dynamicForm = JSON.parseObject(dynamicFormStr, Map.class); } } + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java new file mode 100644 index 0000000..3badb64 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/controller/SafetyRiskController.java @@ -0,0 +1,54 @@ +package com.ningdatech.pmapi.safety.controller; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.manage.SafetyRiskManage; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname SafetyRiskController + * @Description + * @Date 2023/8/2 9:15 + * @Author PoffyZhang + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "安全风险监测") +@RequestMapping("/api/v1/safety-risk") +public class SafetyRiskController { + + private final SafetyRiskManage safetyRiskManage; + + @GetMapping("/person-monitor/list") + @ApiOperation("安全人员监控列表") + public PageVo personMonitorList(ProjectListReq req) { + return safetyRiskManage.personMonitorList(req); + } + + @GetMapping("/person-monitor/detail/{projectCode}") + @ApiOperation("安全人员监控详情") + public ProjectMonitorVO personMonitorDetail(@PathVariable String projectCode) { + return safetyRiskManage.personMonitorDetail(projectCode); + } + + + @GetMapping("/operation-monitor/list") + @ApiOperation("安全运行监控列表") + public PageVo operationnMonitorList(ProjectListReq req) { + return safetyRiskManage.operationnMonitorList(req); + } + + @GetMapping("/operation-monitor/search/{projectCode}") + @ApiOperation("安全运行监控-查询监测(对接外部平台)") + public JSONObject operationnMonitorList(@PathVariable String projectCode) { + return safetyRiskManage.operationnMonitorSearch(projectCode); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java new file mode 100644 index 0000000..eb57d94 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/manage/SafetyRiskManage.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.safety.manage; + +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.safety.model.vo.ProjectMonitorVO; +import org.springframework.stereotype.Component; + +/** + * @Classname SafetyRiskManage + * @Description + * @Date 2023/8/2 9:17 + * @Author PoffyZhang + */ +@Component +public class SafetyRiskManage { + + + public PageVo personMonitorList(ProjectListReq req) { + return null; + } + + public ProjectMonitorVO personMonitorDetail(String projectCode) { + return null; + } + + public PageVo operationnMonitorList(ProjectListReq req) { + return null; + } + + public JSONObject operationnMonitorSearch(String projectCode) { + return null; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java new file mode 100644 index 0000000..11d5972 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/safety/model/vo/ProjectMonitorVO.java @@ -0,0 +1,75 @@ +package com.ningdatech.pmapi.safety.model.vo; + +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; +import java.util.Optional; + +/** + * @Classname ProjectMonitorVO + * @Description + * @Date 2023/8/2 9:19 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "ProjectMonitorVO", description = "项目监控VO") +public class ProjectMonitorVO { + + @ApiModelProperty("项目ID") + private Long id; + + @ApiModelProperty("项目名称") + private String projectName; + + @ApiModelProperty("申报单位code") + private String buildOrgCode; + + @ApiModelProperty("申报单位名") + private String buildOrgName; + + @ApiModelProperty("项目年度") + private Integer projectYear; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("项目类型名") + private String projectTypeName; + + public String getProjectTypeName() { + if (Objects.nonNull(this.projectType)) { + Optional.ofNullable(ProjectTypeEnum.getDesc(this.projectType)) + .ifPresent(desc -> this.projectTypeName = desc); + } + return this.projectTypeName; + } + + @ApiModelProperty("项目阶段") + private Integer stage; + + @ApiModelProperty("项目状态") + private Integer status; + + @ApiModelProperty("项目阶段中文") + private String stageName; + public String getStageName(){ + if(Objects.nonNull(this.stage)){ + return ProjectStatusEnum.getDesc(this.stage); + } + return StringUtils.EMPTY; + } + + @ApiModelProperty("项目状态中文") + private String statusName; + public String getStatusName(){ + if(Objects.nonNull(this.status)){ + return ProjectStatusEnum.getDesc(this.status); + } + return StringUtils.EMPTY; + } +}