Explorar el Código

验证条件调整

lvxianyun hace 3 años
padre
commit
8aa66d75dc

+ 4 - 6
src/main/java/com/persagy/proxy/adm/controller/AdmBuildingController.java

@@ -92,27 +92,25 @@ public class AdmBuildingController {
         filters+= "]";
 
         admQueryCriteria.setFilters(filters);
-        admQueryCriteria.setOnlyCount(true);
-
         admQueryCriteria.setName("floor");
         AdmResponse admResponseF = floorService.doQuery(context, admQueryCriteria, AdmFloor.class);
-        if(DmpResult.SUCCESS.equals(admResponseF.getResult()) && admResponseF.getTotal() > 0){
+        if(DmpResult.SUCCESS.equals(admResponseF.getResult()) && CollUtil.isNotEmpty(admResponseF.getContent())){
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName("space");
         AdmResponse admResponseSpace = spaceService.doQuery(context, admQueryCriteria, AdmSpace.class);
-        if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getTotal() > 0){
+        if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName("ispace");
         AdmResponse admResponseISpace = iAdmISpaceService.doQuery(context, admQueryCriteria, AdmISpace.class);
-        if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && admResponseISpace.getTotal() > 0){
+        if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseISpace.getContent())){
             return AdmResponse.failure(msg);
         }
 
         admQueryCriteria.setName("equipment");
         AdmResponse admResponseEuip = equipmentService.doQuery(context, admQueryCriteria, AdmEquipment.class);
-        if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && admResponseEuip.getTotal() > 0){
+        if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
             return AdmResponse.failure(msg);
         }
         service.doDelete(context, vos);

+ 3 - 4
src/main/java/com/persagy/proxy/adm/controller/AdmFloorController.java

@@ -124,18 +124,17 @@ public class AdmFloorController {
 
         admQueryCriteria.setName("space");
         AdmResponse admResponseSpace = spaceService.doQuery(context, admQueryCriteria, AdmSpace.class);
-        if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && admResponseSpace.getTotal() > 0){
+        if(admResponseSpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseSpace.getContent())){
             return AdmResponse.failure(msg);
         }
         admQueryCriteria.setName("ispace");
         AdmResponse admResponseISpace = iAdmISpaceService.doQuery(context, admQueryCriteria, AdmISpace.class);
-        if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && admResponseISpace.getTotal() > 0){
+        if(admResponseISpace.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseISpace.getContent())){
             return AdmResponse.failure(msg);
         }
-
         admQueryCriteria.setName("equipment");
         AdmResponse admResponseEuip = equipmentService.doQuery(context, admQueryCriteria, AdmEquipment.class);
-        if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && admResponseEuip.getTotal() > 0){
+        if(admResponseEuip.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(admResponseEuip.getContent())){
             return AdmResponse.failure(msg);
         }
         service.doDelete(context, vos);