Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

null 4 дней назад
Родитель
Сommit
2fb2996625

+ 5 - 0
pipe-network-service/sql/migration_equipment_warning_threshold_config.sql

@@ -27,6 +27,11 @@ CREATE UNIQUE INDEX IF NOT EXISTS uk_equipment_warning_type_code ON app_user.equ
 
 -- 旧入口按 menu_id 精准迁移,避免同名菜单被误改:
 -- 2119 供水、2194 排水、2017 窨井盖、2192 燃气。
+-- 燃气、排水的阈值配置父目录使用业务路径,替换旧数字路径 1/2。
+UPDATE app_user.sys_menu
+   SET path = 'thresholdConfig'
+ WHERE menu_id IN (2191, 2193);
+
 UPDATE app_user.sys_menu
        SET component = 'subSystem/lifeCompany/warningThreshold/index',
        path = 'warningThreshold',

+ 17 - 17
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/warning/EarlyWarningController.java

@@ -57,7 +57,7 @@ public class EarlyWarningController {
 
     @GetMapping("/list")
     @ApiOperation("分页查询预警列表")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult getWarningList(
             @ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
@@ -72,7 +72,7 @@ public class EarlyWarningController {
 
     @GetMapping("/todo/list")
     @ApiOperation("待办预警列表")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult getTodoList(
             @ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
@@ -209,8 +209,8 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
 
     @PostMapping("/misreport")
     @ApiOperation("确认误报并清除预警")
-    @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
-    public AjaxResult misreportWarning(@RequestParam String warningId, @RequestParam String reason) {
+    @PreAuthorize("@ss.hasPermi('warning:warning:audit')")
+    public AjaxResult misreportWarning(@RequestParam("warningId") String warningId, @RequestParam("reason") String reason) {
         boolean result = earlyWarningService.misreportWarning(warningId, reason);
         return result ? AjaxResult.success("误报已清除") : AjaxResult.error("误报处理失败");
     }
@@ -233,8 +233,8 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
 
     @PostMapping("/clear")
     @ApiOperation("清除预警")
-    @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
-    public AjaxResult clearWarning(@RequestParam String warningId, @RequestParam String clearRemark) {
+    @PreAuthorize("@ss.hasPermi('warning:warning:audit')")
+    public AjaxResult clearWarning(@RequestParam("warningId") String warningId, @RequestParam("clearRemark") String clearRemark) {
         boolean result = earlyWarningService.clearWarning(warningId, clearRemark);
         return result ? AjaxResult.success("预警已清除") : AjaxResult.error("预警清除失败");
     }
@@ -254,10 +254,10 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
     @PostMapping("/resolve")
     @ApiOperation("解除预警")
     @Log(title = "解除预警", businessType = BusinessType.UPDATE)
-    @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:audit')")
     public AjaxResult resolveWarning(
-            @ApiParam("预警ID") @RequestParam String warningId,
-            @ApiParam("处置说明") @RequestParam String disposalContent) {
+            @ApiParam("预警ID") @RequestParam("warningId") String warningId,
+            @ApiParam("处置说明") @RequestParam("disposalContent") String disposalContent) {
         boolean result = earlyWarningService.resolveWarning(warningId, disposalContent);
         return result ? AjaxResult.success("解除成功") : AjaxResult.error("解除失败");
     }
@@ -265,10 +265,10 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
     @PostMapping("/return")
     @ApiOperation("退回重办")
     @Log(title = "退回重办", businessType = BusinessType.UPDATE)
-    @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:audit')")
     public AjaxResult returnWarning(
-            @ApiParam("预警ID") @RequestParam String warningId,
-            @ApiParam("退回说明") @RequestParam String disposalContent) {
+            @ApiParam("预警ID") @RequestParam("warningId") String warningId,
+            @ApiParam("退回说明") @RequestParam("disposalContent") String disposalContent) {
         boolean result = earlyWarningService.returnWarning(warningId, disposalContent);
         return result ? AjaxResult.success("退回成功") : AjaxResult.error("退回失败");
     }
@@ -290,7 +290,7 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
     }
 
     @PostMapping("/notifications/{todoId}/read")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult readNotification(@PathVariable String todoId) {
         return earlyWarningService.readNotification(todoId) ? AjaxResult.success() : AjaxResult.error("通知不存在或无权访问");
     }
@@ -354,7 +354,7 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
 
     @GetMapping("/search")
     @ApiOperation("综合搜索预警信息")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult searchWarnings(
             @ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
@@ -388,7 +388,7 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
 
     @GetMapping("/processing/list")
     @ApiOperation("获取处置过程跟踪 - 进行中的预警")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult getProcessingWarnings(
             @ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
@@ -401,7 +401,7 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
 
     @GetMapping("/completed/list")
     @ApiOperation("获取处置过程跟踪 - 已完成的预警")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult getCompletedWarnings(
             @ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
@@ -568,7 +568,7 @@ List<String> alarmIds = alarmIdsJson != null && !alarmIdsJson.isEmpty()
 
     @GetMapping("/archive/list")
     @ApiOperation("获取归档列表")
-    @PreAuthorize("@ss.hasPermi('warning:warning:list')")
+    @PreAuthorize("@ss.hasPermi('warning:warning:query')")
     public AjaxResult getArchiveList(
             @ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
             @ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,

+ 10 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/warning/service/impl/EarlyWarningServiceImpl.java

@@ -571,6 +571,9 @@ public class EarlyWarningServiceImpl extends ServiceImpl<EarlyWarningMapper, Ear
     }
 
     private void requireHandler(EarlyWarning warning) {
+        if (!SecurityUtils.hasPermi("warning:warning:handle")) {
+            throw new ServiceException("没有预警处置权限");
+        }
         if (!Objects.equals(warning.getHandler(), currentUser())) {
             throw new ServiceException("只有发布时指定的处置人可以接收和提交处置结果");
         }
@@ -581,6 +584,9 @@ public class EarlyWarningServiceImpl extends ServiceImpl<EarlyWarningMapper, Ear
     }
 
     private void requireReviewer(EarlyWarning warning) {
+        if (!SecurityUtils.hasPermi("warning:warning:audit")) {
+            throw new ServiceException("没有预警核验权限");
+        }
         if (!Objects.equals(reviewerOf(warning), currentUser())) {
             throw new ServiceException("只有指定核查人可以解除或退回预警");
         }
@@ -605,6 +611,10 @@ public class EarlyWarningServiceImpl extends ServiceImpl<EarlyWarningMapper, Ear
             actions.removeAll(Arrays.asList("RECEIVE", "START", "HANDLE"));
         }
         if (!username.equals(reviewer)) actions.removeAll(Arrays.asList("CLEAR", "RETURN"));
+        if (!SecurityUtils.hasPermi("warning:warning:handle")) {
+            actions.removeAll(Arrays.asList("RECEIVE", "START", "HANDLE"));
+        }
+        if (!SecurityUtils.hasPermi("warning:warning:audit")) actions.removeAll(Arrays.asList("CLEAR", "RETURN"));
         if ("DONE".equals(row.get("todo_type"))) actions.clear();
         row.put("availableActions", actions);
         row.put("statusLabel", WarningWorkflow.label(state));