Commit e01135e6 authored by suhuiguang's avatar suhuiguang

1.设备状态统计增加未登记状态

parent 55e31488
......@@ -717,7 +717,7 @@ public class JGDPStatisticsServiceImpl {
boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
SearchSourceBuilder builder = new SearchSourceBuilder();
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).missing(EquimentEnum.WEIDENGJI.getCode());
builder.aggregation(aggregationBuilder);
builder.size(0);
request.source(builder);
......@@ -730,7 +730,7 @@ public class JGDPStatisticsServiceImpl {
long docCount = bucket.getDocCount();
dataMap.put(category, docCount);
}
resultList = Arrays.stream(EquimentEnum.values()).filter(e -> e.getCode() > 0).map(e -> {
resultList = Arrays.stream(EquimentEnum.values()).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put("name", e.getName());
map.put("value", dataMap.getOrDefault(e.getCode().toString(), 0L));
......
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