소스 검색

修复巡检区域删除失败

hanzhengyi 2 주 전
부모
커밋
6d36a8a5ec
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java

+ 2 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java

@@ -176,6 +176,8 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
             siteNum = patrolInspectionSiteMapper.selectSiteCount(areaIdList);
         }
         if (siteNum>0){
+            throw new BusinessException("区域下有绑定的点位,请解绑后再删除!");
+        }else {
             for (int i = 0; i < patrolInspectionArealist.size(); i++) {
                 PatrolInspectionArea patrolInspectionAreaz = new PatrolInspectionArea();
                 patrolInspectionAreaz.setId(patrolInspectionArealist.get(i).getId());
@@ -186,8 +188,6 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
             patrolInspectionArea.setId(id);
             patrolInspectionArea.setEnable(0);
             this.updateById(patrolInspectionArea);
-        }else {
-            throw new BusinessException("区域下有绑定的点位,请解绑后再删除!");
         }
     }