Commit 0e75cf75 authored by suhuiguang's avatar suhuiguang

1.大屏-监管-接口自测优化

parent 952d9cf4
...@@ -14,7 +14,6 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*; ...@@ -14,7 +14,6 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
...@@ -712,6 +711,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -712,6 +711,7 @@ public class JGDPStatisticsServiceImpl {
builder.query(boolMust); builder.query(boolMust);
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("EQU_STATE_COUNT").field("EQU_STATE").size(20); TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("EQU_STATE_COUNT").field("EQU_STATE").size(20);
builder.aggregation(aggregationBuilder); builder.aggregation(aggregationBuilder);
builder.size(0);
request.source(builder); request.source(builder);
try { try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT); SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
...@@ -904,7 +904,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -904,7 +904,7 @@ public class JGDPStatisticsServiceImpl {
return resultMap; return resultMap;
} }
private Map<String, Object> cancelCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) { private void cancelCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>(); Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>(); List<Object> xDataList = new ArrayList<>();
...@@ -941,10 +941,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -941,10 +941,9 @@ public class JGDPStatisticsServiceImpl {
resultMap.put("xdata", xDataList); resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList); resultMap.put("ydata", yDataList);
return resultMap;
} }
private Map<String, Object> disableCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) { private void disableCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>(); Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>(); List<Object> xDataList = new ArrayList<>();
...@@ -981,10 +980,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -981,10 +980,9 @@ public class JGDPStatisticsServiceImpl {
resultMap.put("xdata", xDataList); resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList); resultMap.put("ydata", yDataList);
return resultMap;
} }
private Map<String, Object> changeCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) { private void changeCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>(); Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>(); List<Object> xDataList = new ArrayList<>();
...@@ -1035,10 +1033,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -1035,10 +1033,9 @@ public class JGDPStatisticsServiceImpl {
resultMap.put("xdata", xDataList); resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList); resultMap.put("ydata", yDataList);
return resultMap;
} }
private Map<String, Object> useCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) { private void useCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>(); Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>(); List<Object> xDataList = new ArrayList<>();
...@@ -1053,10 +1050,10 @@ public class JGDPStatisticsServiceImpl { ...@@ -1053,10 +1050,10 @@ public class JGDPStatisticsServiceImpl {
orgCodes.add(t.get("orgCode")); orgCodes.add(t.get("orgCode"));
} }
}); });
//使用告知 //使用登记
List<Map<String, Object>> useCountList = dpStatisticsMapper.useCountByOrgCodes(orgCodes); List<Map<String, Object>> useCountList = dpStatisticsMapper.useCountByOrgCodes(orgCodes);
countByMap(countMap, useCountList); countByMap(countMap, useCountList);
//车用气瓶使用告知 //车用气瓶使用登记
List<Map<String, Object>> vehicleCountList = dpStatisticsMapper.vehicleCountByOrgCodes(orgCodes); List<Map<String, Object>> vehicleCountList = dpStatisticsMapper.vehicleCountByOrgCodes(orgCodes);
countByMap(countMap, vehicleCountList); countByMap(countMap, vehicleCountList);
for (int i = 0; i < regionModelList.size(); i++) { for (int i = 0; i < regionModelList.size(); i++) {
...@@ -1078,10 +1075,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -1078,10 +1075,9 @@ public class JGDPStatisticsServiceImpl {
resultMap.put("xdata", xDataList); resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList); resultMap.put("ydata", yDataList);
return resultMap;
} }
private Map<String, Object> noticeCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) { private void noticeCount(Map<String, Object> resultMap, List<RegionModel> regionModelList) {
Map<String, Integer> countMap = new HashMap<>(); Map<String, Integer> countMap = new HashMap<>();
List<Object> xDataList = new ArrayList<>(); List<Object> xDataList = new ArrayList<>();
List<Object> yDataList = new ArrayList<>(); List<Object> yDataList = new ArrayList<>();
...@@ -1125,7 +1121,6 @@ public class JGDPStatisticsServiceImpl { ...@@ -1125,7 +1121,6 @@ public class JGDPStatisticsServiceImpl {
resultMap.put("xdata", xDataList); resultMap.put("xdata", xDataList);
resultMap.put("ydata", yDataList); resultMap.put("ydata", yDataList);
return resultMap;
} }
private void countByMap(Map<String, Integer> countMap, List<Map<String, Object>> list) { private void countByMap(Map<String, Integer> countMap, List<Map<String, Object>> list) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment