|
@@ -97,7 +97,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();
|
|
|
Set<String> zoneTypeList = StrUtil.isNotEmpty(request.getZoneType()) ? Sets.newHashSet(request.getZoneType())
|
|
|
: (request.getZoneTypeList() == null ? Sets.newHashSet() : request.getZoneTypeList());
|
|
@@ -120,9 +120,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");
|
|
|
}
|
|
@@ -136,9 +136,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");
|
|
@@ -147,9 +147,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();
|
|
@@ -307,7 +307,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));
|