Przeglądaj źródła

修复巡检区域删除失败

hanzhengyi 2 tygodni temu
rodzic
commit
6d36a8a5ec

+ 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("区域下有绑定的点位,请解绑后再删除!");
         }
     }