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: # 从数据源开关/默认关闭