diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/EarlyWarningController.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/EarlyWarningController.java index a901997..b3b62d3 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/EarlyWarningController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/EarlyWarningController.java @@ -36,16 +36,16 @@ public class EarlyWarningController { private final IEarlyWarningRecordsService earlyWarningRecordsService; @ApiOperation(value = "预警规则获取", notes = "预警规则获取") - @GetMapping("/detail/{areaCode}") - public List detail(@PathVariable String areaCode) { - return earlyWarningService.detailByRegion(areaCode); + @GetMapping("/detail/{mhUnitId}") + public List detail(@PathVariable Long mhUnitId) { + return earlyWarningService.detailByMhUnitId(mhUnitId); } @ApiOperation(value = "预警规则保存", notes = "预警规则保存") @PostMapping("/save") @WebLog("预警规则保存") public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { - return earlyWarningService.saveByDto(dto); + return earlyWarningService.saveByMhUnit(dto); } @ApiOperation(value = "预警记录查询", notes = "预警记录查询") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/WflowEarlyWarningRecords.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/WflowEarlyWarningRecords.java index 551ade1..64ca1ea 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/WflowEarlyWarningRecords.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/entity/WflowEarlyWarningRecords.java @@ -40,6 +40,12 @@ public class WflowEarlyWarningRecords implements Serializable { private String areaCode; /** + * 信创单位ID + */ + @ApiModelProperty(value = "信创单位ID") + private Long mhUnitId; + + /** * 项目 */ @ApiModelProperty(value = "项目编码") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/req/WarningListReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/req/WarningListReq.java index 4c68cd4..b828d64 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/req/WarningListReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sys/model/req/WarningListReq.java @@ -41,4 +41,7 @@ public class WarningListReq extends PagePo { @ApiModelProperty("区域Code") private String areaCode; + + @ApiModelProperty("单位ID") + private Long mhUnitId; } \ No newline at end of file diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/EarlyWarningRecordsServiceImpl.java b/hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/EarlyWarningRecordsServiceImpl.java index 637c7c6..9725046 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/EarlyWarningRecordsServiceImpl.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sys/service/impl/EarlyWarningRecordsServiceImpl.java @@ -42,6 +42,7 @@ public class EarlyWarningRecordsServiceImpl extends ServiceImpl wrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) .eq(WflowEarlyWarningRecords::getRuleType, ruleType) .eq(StringUtils.isNotBlank(req.getAreaCode()),WflowEarlyWarningRecords::getAreaCode,req.getAreaCode()) + .eq(Objects.nonNull(req.getMhUnitId()),WflowEarlyWarningRecords::getMhUnitId,req.getMhUnitId()) .like(StringUtils.isNotBlank(req.getProjectName()), WflowEarlyWarningRecords::getProjectName, req.getProjectName()) .like(StringUtils.isNotBlank(req.getBuildOrgName()), WflowEarlyWarningRecords::getBuildOrgName, req.getBuildOrgName()) .eq(StringUtils.isNotBlank(req.getBuildOrgCode()), WflowEarlyWarningRecords::getBuildOrgCode, req.getBuildOrgCode())