Browse Source

fix 删除楼层判断bug

lvxianyun 3 years ago
parent
commit
74a25b0bd8

+ 5 - 5
src/main/java/com/persagy/proxy/object/controller/AdmFloorController.java

@@ -136,17 +136,17 @@ public class AdmFloorController {
 
         admQueryCriteria.setName(AdmSpace.OBJ_TYPE);
         AdmResponse admResponseSpace = spaceService.query(admQueryCriteria);
-        if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
+        if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getCount() > 0){
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName(AdmISpace.OBJ_TYPE);
         AdmResponse admResponseISpace = iAdmISpaceService.doQuery(AdmContextUtil.toDmpContext(), admQueryCriteria, AdmISpace.class);
-        if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseISpace.getContent())){
+        if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getCount() > 0){
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName(AdmEquipment.OBJ_TYPE);
         AdmResponse admResponseEuip = equipmentService.query(admQueryCriteria);
-        if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
+        if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getCount() > 0){
             return AdmResponse.failure(msg);
         }
         service.doDelete(AdmContextUtil.toDmpContext(), vos);
@@ -161,8 +161,8 @@ public class AdmFloorController {
      */
     @PostMapping("/single/delete")
     public AdmResponse deleteSingle( @RequestBody List<AdmFloor> vos) throws Exception {
-       delete(vos);
-       return AdmResponse.success();
+
+       return delete(vos);
     }
 
     /**