|
|
|
@ -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));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|