ソースを参照

fix:空间 查询

lvxianyun 3 年 前
コミット
7d68be902a

+ 5 - 17
src/main/java/com/persagy/proxy/adm/service/impl/AdmSpaceServiceImpl.java

@@ -140,31 +140,19 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             }
         }else if(StrUtil.isEmpty(request.getBuildingId()) && StrUtil.isEmpty(request.getFloorId())){
             QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, "space");
-            ObjectNode criteriaPe = queryCriteria.getCriteria();
+           /* ObjectNode criteriaPe = queryCriteria.getCriteria();
             JSONObject isnull = new JSONObject();
-            isnull.put("$null", false);
+            isnull.put("$null", true);
             criteriaPe.putPOJO("floorId", isnull);
-            queryCriteria.setCriteria(criteriaPe);
+            queryCriteria.setCriteria(criteriaPe);*/
             dmpResult = queryObj(context, queryCriteria);
             if(CollUtil.isNotEmpty(dmpResult.getData())){
                 spaceArray.addAll(dmpResult.getData());
             }
         }
-        //处理查询结果转化为目标返回值
-        List<JSONObject> jsonObjects = new ArrayList<JSONObject>();
-        if(CollUtil.isNotEmpty(spaceArray)){
-            List<AdmSpace> spaceList = JSONUtil.toList(JSONUtil.toJsonStr(spaceArray), AdmSpace.class);
-            Map<String, AdmSpace> admSpaceMap = CollUtil.fieldValueMap(spaceList, BaseEntity.PROP_ID);
-            admSpaceMap.values().stream().forEach(admSpace -> {
-                JSONObject jsonObject = new JSONObject();
-                jsonObject.put("zoneType", admSpace.getClassCode());
-                jsonObject.put("floorId", admSpace.getFloorId());
-                jsonObjects.add(jsonObject);
-            });
-        }
         AdmResponse admResponse = new AdmResponse();
-        admResponse.setContent(jsonObjects);
-        admResponse.setTotal(jsonObjects.size()*1l);
+        admResponse.setContent(spaceArray);
+        admResponse.setTotal(spaceArray.size()*1l);
         admResponse.setPageSize(request.getPageSize());
         admResponse.setPageNumber(request.getPageNumber());
         admResponse.setResult(DmpResult.SUCCESS);