|
@@ -1,6 +1,7 @@
|
|
|
package com.persagy.proxy.dictionary.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.persagy.proxy.adm.constant.AdmDictCategoryEnum;
|
|
|
import com.persagy.proxy.adm.request.AdmDictQueryCriteria;
|
|
@@ -138,24 +139,44 @@ public class AdmLabslController {
|
|
|
specialQueryFlag = handleRequestCriteria(filters, newFilters, specailFilters, specialQueryFlag);
|
|
|
List<AdmEquipment> result = new ArrayList<>();
|
|
|
List<AdmEquipment> specailContent = new ArrayList<>();
|
|
|
- if(specialQueryFlag){
|
|
|
- //查询未明确建筑,未明确楼层
|
|
|
- AdmQueryCriteria specifal = new AdmQueryCriteria();
|
|
|
- specifal = request;
|
|
|
- specifal.setFilters(specailFilters.toString());
|
|
|
- AdmResponse specailQueryResponse = iAdmEquipmentService.doQuery(context, request, AdmEquipment.class);
|
|
|
- specailContent = (List<AdmEquipment>)specailQueryResponse.getContent();
|
|
|
- }
|
|
|
+
|
|
|
+ AdmQueryCriteria specifal = new AdmQueryCriteria();
|
|
|
+ specifal = request;
|
|
|
+ specifal.setFilters(specailFilters.toString());
|
|
|
+
|
|
|
+ int totalCount = 0 ;
|
|
|
request.setFilters(newFilters.toString());
|
|
|
AdmResponse queryResponse = iAdmEquipmentService.doQuery(context, request, AdmEquipment.class);
|
|
|
List<AdmEquipment> content = (List<AdmEquipment>)queryResponse.getContent();
|
|
|
+ if(queryResponse.getTotal() != null){
|
|
|
+ totalCount += queryResponse.getTotal().intValue();
|
|
|
+ }
|
|
|
+ if(specialQueryFlag){
|
|
|
+ //查询未明确建筑,未明确楼层
|
|
|
+ Long count = queryResponse.getCount();
|
|
|
+ Integer pageSize = request.getPageSize();
|
|
|
+ if(count < pageSize){
|
|
|
+ long specailPageSize = pageSize - count;
|
|
|
+ specifal.setPageSize((int) specailPageSize);
|
|
|
+ AdmResponse specailQueryResponse = iAdmEquipmentService.doQuery(context, specifal, AdmEquipment.class);
|
|
|
+ specailContent = (List<AdmEquipment>)specailQueryResponse.getContent();
|
|
|
+ if(specailQueryResponse.getTotal() != null){
|
|
|
+ totalCount += specailQueryResponse.getTotal().intValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(CollUtil.isNotEmpty(content)){
|
|
|
result.addAll(content);
|
|
|
}
|
|
|
if(CollUtil.isNotEmpty(specailContent)){
|
|
|
result.addAll(specailContent);
|
|
|
}
|
|
|
- return AdmResponse.success(result);
|
|
|
+ AdmResponse response = AdmResponse.success(result);
|
|
|
+ response.setTotal(Long.valueOf(totalCount));
|
|
|
+ response.setCount(CollectionUtil.isEmpty(result) ? 0 : Long.valueOf(result.size()));
|
|
|
+ response.setPageNumber(request.getPageNumber());
|
|
|
+ response.setPageSize(request.getPageSize());
|
|
|
+ return response;
|
|
|
}
|
|
|
|
|
|
/**
|