|
@@ -96,7 +96,7 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
QueryCriteria dmpRequest = AdmQueryCriteriaHelper.toDmpCriteria(request);
|
|
|
//查询的时候,floorId,buildingId 按照空间对象的自定义信息点处理
|
|
|
//TODO 这个ifelse判断是原来的代码实现,写此方法实现的时候不清楚实际业务,保留原来的判断,之后了解业务再根据业务调整
|
|
|
- DmpResult<JSONArray> dmpResult = new DmpResult<>();
|
|
|
+ DmpResult<JSONArray> result = new DmpResult<>();
|
|
|
List spaceArray = new ArrayList();
|
|
|
List<String> zoneTypeList = StrUtil.isNotEmpty(request.getZoneType()) ? CollUtil.newArrayList(request.getZoneType()) : request.getZoneTypeList();
|
|
|
if(StrUtil.isNotEmpty(request.getBuildingId()) && StrUtil.isNotEmpty(request.getFloorId()) && !request.getFloorId().equals("isnull")){
|
|
@@ -118,9 +118,9 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
floorMap.keySet().forEach(floorId -> jsonArray.add(floorId));
|
|
|
criteriaPe.putPOJO("floorId", jsonArray);
|
|
|
queryCriteria.setCriteria(criteriaPe);
|
|
|
- dmpResult = queryObj(context, queryCriteria);
|
|
|
- if(CollUtil.isNotEmpty(dmpResult.getData())){
|
|
|
- spaceArray.addAll(dmpResult.getData());
|
|
|
+ result = queryObj(context, queryCriteria);
|
|
|
+ if(CollUtil.isNotEmpty(result.getData())){
|
|
|
+ spaceArray.addAll(result.getData());
|
|
|
}
|
|
|
querySpaceByFl(dmpRequest, context, spaceArray, zoneTypeList, request.getBuildingId(), "Bd2Sp");
|
|
|
}
|
|
@@ -134,9 +134,9 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
isnull.put("$null", true);
|
|
|
criteriaPe.putPOJO("buildingId", isnull);
|
|
|
queryCriteria.setCriteria(criteriaPe);
|
|
|
- dmpResult = queryObj(context, queryCriteria);
|
|
|
- if(CollUtil.isNotEmpty(dmpResult.getData())){
|
|
|
- spaceArray.addAll(dmpResult.getData());
|
|
|
+ result = queryObj(context, queryCriteria);
|
|
|
+ if(CollUtil.isNotEmpty(result.getData())){
|
|
|
+ spaceArray.addAll(result.getData());
|
|
|
}
|
|
|
}else if(StrUtil.isEmpty(request.getBuildingId()) && StrUtil.isEmpty(request.getFloorId())){
|
|
|
QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, "space");
|
|
@@ -145,9 +145,9 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
isnull.put("$null", true);
|
|
|
criteriaPe.putPOJO("floorId", isnull);
|
|
|
queryCriteria.setCriteria(criteriaPe);*/
|
|
|
- dmpResult = queryObj(context, queryCriteria);
|
|
|
- if(CollUtil.isNotEmpty(dmpResult.getData())){
|
|
|
- spaceArray.addAll(dmpResult.getData());
|
|
|
+ result = queryObj(context, queryCriteria);
|
|
|
+ if(CollUtil.isNotEmpty(result.getData())){
|
|
|
+ spaceArray.addAll(result.getData());
|
|
|
}
|
|
|
}
|
|
|
AdmResponse admResponse = new AdmResponse();
|
|
@@ -305,7 +305,12 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
|
|
|
}
|
|
|
|
|
|
private QueryCriteria ensureQueryCommParm(QueryCriteria dmpRequest, InstanceUrlParam context, Collection<String> classCodes, String objType){
|
|
|
- ObjectNode criteriaEq = JsonNodeFactory.instance.objectNode();
|
|
|
+ ObjectNode criteriaEq = null;
|
|
|
+ if(JSONUtil.isNull(dmpRequest.getCriteria())){
|
|
|
+ criteriaEq = JsonNodeFactory.instance.objectNode();
|
|
|
+ }else{
|
|
|
+ criteriaEq = dmpRequest.getCriteria();
|
|
|
+ }
|
|
|
if(CollUtil.isNotEmpty(classCodes)){
|
|
|
ArrayNode array = criteriaEq.putObject("classCode").putArray("$in");
|
|
|
classCodes.forEach(code -> array.add(code));
|