Commit f6a535a4 authored by tianyiming's avatar tianyiming

fix: 更新统计分析中的过滤条件和单位转换逻辑

parent f30ed85c
......@@ -2789,6 +2789,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
BoolQueryBuilder equipBoolMust = QueryBuilders.boolQuery();
handleOrgCode(equipBoolMust, orgCode);
equipBoolMust.mustNot(QueryBuilders.termsQuery("STATUS", Arrays.asList("草稿", "已拒领", "待认领")));
equipBoolMust.mustNot(QueryBuilders.termQuery("EQU_CATEGORY_CODE", "2300"));
equipBoolMust.mustNot(QueryBuilders.termQuery("EQU_LIST_CODE", "8000"));
BoolQueryBuilder companyBoolMust = QueryBuilders.boolQuery();
companyBoolMust.must(QueryBuilders.prefixQuery("superviseOrgCode.keyword", orgCode));
BoolQueryBuilder personBoolMust = QueryBuilders.boolQuery();
......@@ -3031,6 +3033,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if (groupField.equals("EQU_LIST_CODE")) {
gasBoolQueryBuilder = QueryBuilderUtils.copyBoolQuery(boolMust);
}
boolMust.mustNot(QueryBuilders.matchQuery("EQU_CATEGORY_CODE", "2300"));
getStatisticCountByGroup(request, builder, boolMust, groupField, staticCountByGroup, "noGas");
AtomicReference<Long> otherCount = new AtomicReference<>(0L);
......@@ -3066,7 +3069,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
map.put("img", dpEquipPhotoPrefix + code + dpEquipPhotoSuffix);
Integer count = tzsCustomFilterMapper.selectEquipmentCategoryCountByParentId(categoryMap.get("key").toString());
map.put("noChild", 0 == count ? Boolean.TRUE : Boolean.FALSE);
map.put("measurementUnit", code.startsWith("8") ? "千米" : "台套");
map.put("measurementUnit", equipCode != null && equipCode.startsWith("8") ? "千米" : equipCode != null && equipCode.startsWith("2") ? "个" : "台套");
map.put("noBottom", code.startsWith("8") ? Boolean.TRUE : Boolean.FALSE);
// 统计该分类下的数据完整性的分组数量 DATA_QUALITY_SCORE
BoolQueryBuilder scoreQuery = QueryBuilderUtils.copyBoolQuery(boolMust);
......@@ -3108,8 +3111,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
map.put("img", dpEquipPhotoPrefix + code + dpEquipPhotoSuffix);
Integer count = tzsCustomFilterMapper.selectEquipmentCategoryCountByParentId(gas.get("key").toString());
map.put("noChild", 0 == count ? Boolean.TRUE : Boolean.FALSE);
map.put("measurementUnit", "台套");
map.put("noBottom", Boolean.TRUE);
map.put("measurementUnit", "");
map.put("noBottom", Boolean.FALSE);
// 统计该分类下的数据完整性的分组数量 DATA_QUALITY_SCORE
BoolQueryBuilder scoreQuery = QueryBuilderUtils.copyBoolQuery(boolMust);
scoreQuery.must(QueryBuilders.termQuery(fieldKey, code));
......@@ -3124,7 +3127,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
getStatisticCountByDate(StatisticalAnalysisEnum.equip.getKey(), "NEXT_INSPECT_DATE", nextInspectQuery, nextInspectCountByGroup);
map.put("NEXT_INSPECT_DATE", nextInspectCountByGroup);
dataMapList.add(map);
boolMust.mustNot(QueryBuilders.matchQuery("EQU_CATEGORY_CODE", "2300"));
}
BigDecimal otherPipeLength = new BigDecimal(0);
......@@ -3217,7 +3219,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
map.put("noChild", Boolean.TRUE);
map.put("value", isOther ? otherPipeLength : otherCount);
map.put("img", dpEquipPhotoPrefix + type + dpEquipPhotoSuffix);
map.put("measurementUnit", equipCode != null && equipCode.startsWith("8") ? "千米" : "台套");
map.put("measurementUnit", equipCode != null && equipCode.startsWith("8") ? "千米" : equipCode != null && equipCode.startsWith("2") ? "个" : "台套");
map.put("noBottom", equipCode != null && equipCode.startsWith("8") ? Boolean.TRUE : Boolean.FALSE);
Map<String, Long> scoreCount = new HashMap<>();
scoreCount.put("1", oneCount);
......
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