From c9ab092ad5717e750d81adb903a702ca89657d13 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期五, 06 十月 2023 10:28:25 +0800
Subject: [PATCH] 应急预案删除及修改加入部门判断提交
---
ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java b/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java
index 8346301..eb9dd3b 100644
--- a/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java
+++ b/ard-work/src/main/java/com/ruoyi/plan/controller/ArdEplanController.java
@@ -200,6 +200,10 @@
@PutMapping
public AjaxResult edit(@RequestBody Map<String,Object> para)
{
+ ArdEplan result = ardEplanService.selectArdEplanById((String) para.get("id"));
+ if(!result.getDeptId().equals(String.valueOf((Integer) para.get("deptId")))){
+ return toAjax(0);//闈炴湰閮ㄩ棬棰勬鏃犳硶鏇存敼
+ }
ArdEplan ardEplan = new ArdEplan();
ardEplan.setId((String) para.get("id"));
ardEplan.setName((String) para.get("name"));
@@ -235,6 +239,12 @@
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
+ ArdEplan result = ardEplanService.selectArdEplanById(ids[0]);
+ String userId = SecurityUtils.getUserId();
+ SysUser sysUser = userService.selectUserById(userId);
+ if(!result.getDeptId().equals(sysUser.getDeptId())){
+ return toAjax(0);//闈炴湰閮ㄩ棬棰勬鏃犳硶鍒犻櫎
+ }
return toAjax(ardEplanService.deleteArdEplanByIds(ids));
}
}
--
Gitblit v1.9.3