From ec48e874a61abe9e0936b9b8db40ae3228500c51 Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 27 Apr 2022 16:27:31 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=9B=91=E6=8E=A7=E5=8D=95?= =?UTF-8?q?=E5=85=83=E7=88=B6=E7=BA=A7=E5=88=A0=E9=99=A4=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E5=AD=90=E7=BA=A7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/base/BaseMonitorunitInfoController.java | 10 ++++++++++ ruoyi-admin/src/main/resources/application-druid.yml | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java index 82049bc..7a3f786 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitInfoController.java @@ -204,6 +204,16 @@ public class BaseMonitorunitInfoController extends BaseController { @GetMapping("/remove/{ObjId}") @ResponseBody public AjaxResult remove(@PathVariable("ObjId") Long ObjId) { + BaseMonitorunitInfo baseMonitorunitInfo = baseMonitorunitInfoService.selectBaseMonitorunitInfoByObjId(ObjId); + + if(StringUtils.isNotNull(baseMonitorunitInfo.getMonitorunitId())){ + BaseMonitorunitInfo baseMonitorunitInfo1 = new BaseMonitorunitInfo(); + baseMonitorunitInfo1.setParentId(baseMonitorunitInfo.getMonitorunitId()); + List baseMonitorunitInfos = baseMonitorunitInfoService.selectBaseMonitorunitInfoList(baseMonitorunitInfo1); + if(baseMonitorunitInfos.size() > 0){ + return AjaxResult.warn("存在下级监控单元,不允许删除"); + } + } return toAjax(baseMonitorunitInfoService.deleteBaseMonitorunitInfoByObjId(ObjId)); } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index ed3ae52..abaf8f6 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,12 +6,12 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: Haiwei123456 -# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: root -# password: root +# password: Haiwei123456 + url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: root # 从库数据源 slave: # 从数据源开关/默认关闭