change - 监控单元父级删除判断是否存在子级信息

main
wenjy 3 years ago
parent 92e4be80be
commit ec48e874a6

@ -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<BaseMonitorunitInfo> baseMonitorunitInfos = baseMonitorunitInfoService.selectBaseMonitorunitInfoList(baseMonitorunitInfo1);
if(baseMonitorunitInfos.size() > 0){
return AjaxResult.warn("存在下级监控单元,不允许删除");
}
}
return toAjax(baseMonitorunitInfoService.deleteBaseMonitorunitInfoByObjId(ObjId));
}

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

Loading…
Cancel
Save