Commit bb7934ec authored by tianyiming's avatar tianyiming

bug修改

parent 190a9f00
......@@ -1186,8 +1186,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray rightGroup = filterParams.getJSONArray("group2");
Boolean isOrGroup = or.equals(filterParams.getString("groupAndOr")) ? Boolean.TRUE : Boolean.FALSE;
handleAdvancedFilter(boolMust, leftGroup, rightGroup, isOrGroup, StatisticalAnalysisEnum.equip.getCode());
equListCodes.add("8000");
equCategoryCodes.add("2300");
equListCodes.add("all");
equCategoryCodes.add("all");
}
filterParams.put("equList", String.join(",", equListCodes));
filterParams.put("equCategory", String.join(",", equCategoryCodes));
......@@ -3246,9 +3246,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
Map<String, Object> result = new HashMap<>();
// 一级统计
if (!is2LeveFlag) {
companyBoolMust(boolMust, "company");
Map<String, Object> dats = getTotalAggMapsByUnitType(request, builder, boolMust, tabTotalMap, StatisticalAnalysisEnum.person);
result = getUseAndProductAndFillingStatistics(dats);
BoolQueryBuilder countBoolMust = QueryBuilderUtils.copyBoolQuery(boolMust);
companyBoolMust(countBoolMust, "company");
long total = this.queryDpStatisticsTotalByIndex(countBoolMust, StatisticalAnalysisEnum.person.getKey());
// 汇总总数
tabTotalMap.put(StatisticalAnalysisEnum.person.getCode(), total);
result = getUseAndProductAndFillingStatistics(boolMust, StatisticalAnalysisEnum.person.getKey());
} else if (!is3LeveFlag) {
if (unitCategory.equals(UnitCategoryEnum.use.getCode())) {
companyBoolMust(boolMust, UnitCategoryEnum.use.getCode());
......@@ -3405,16 +3408,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.orElse(false);
// 一级统计
if (!is2LeveFlag) {
// 计算总数
boolMust.should(QueryBuilders.matchQuery("unitType", UnitTypeEnum.sydw.getName()))
.should(QueryBuilders.matchQuery("unitType", UnitTypeEnum.grzt.getName()))
.should(QueryBuilders.matchQuery("unitType", UnitTypeEnum.zzdw.getName()))
.should(QueryBuilders.matchQuery("unitType", UnitTypeEnum.sjdw.getName()))
.should(QueryBuilders.matchQuery("unitType", UnitTypeEnum.azgzwxdw.getName()))
.should(QueryBuilders.matchQuery("unitType", UnitTypeEnum.czdw.getName()))
.minimumShouldMatch(1);
Map<String, Object> datas = getTotalAggMapsByUnitType(request, builder, boolMust, tabTotalMap, StatisticalAnalysisEnum.company);
return Collections.singletonList(getUseAndProductAndFillingStatistics(datas));
BoolQueryBuilder countBoolMust = QueryBuilderUtils.copyBoolQuery(boolMust);
companyBoolMust(countBoolMust, "company");
long total = this.queryDpStatisticsTotalByIndex(countBoolMust, StatisticalAnalysisEnum.company.getKey());
// 汇总总数
tabTotalMap.put(StatisticalAnalysisEnum.company.getCode(), total);
return Collections.singletonList(getUseAndProductAndFillingStatistics(boolMust, StatisticalAnalysisEnum.company.getKey()));
} else if (!is3LeveFlag) {
Long companyCount = getStatisticCount(boolMust, StatisticalAnalysisEnum.company.getKey());
JSONObject industrySupervisor = this.getItemGroupStatisticsByItemName(boolMust,
......@@ -3540,29 +3539,20 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return Collections.singletonList(result);
}
private Map<String, Object> getUseAndProductAndFillingStatistics(Map<String, Object> datas) {
private Map<String, Object> getUseAndProductAndFillingStatistics(BoolQueryBuilder boolMust, String index) {
Map<String, Object> result = new HashMap<>();
Long filling = 0L;
Long use = 0L;
Long produce = 0L;
for (String key : datas.keySet()) {
if (key.equals("sydw")) {
use += Long.valueOf(datas.get("sydw").toString());
} else if (key.equals("grzt")) {
use += Long.valueOf(datas.get("grzt").toString());
} else if (key.equals("sjdw")) {
produce += Long.valueOf(datas.get("sjdw").toString());
} else if (key.equals("zzdw")) {
produce += Long.valueOf(datas.get("zzdw").toString());
} else if (key.equals("azgzwxdw")) {
produce += Long.valueOf(datas.get("azgzwxdw").toString());
} else if (key.equals("czdw")) {
filling = Long.valueOf(datas.get("czdw").toString());
}
}
result.put("use", use);
result.put("produce", produce);
result.put("filling", filling);
BoolQueryBuilder useBoolMust = QueryBuilderUtils.copyBoolQuery(boolMust);
companyBoolMust(useBoolMust, UnitCategoryEnum.use.getCode());
BoolQueryBuilder produceBoolMust = QueryBuilderUtils.copyBoolQuery(boolMust);
companyBoolMust(produceBoolMust, UnitCategoryEnum.produce.getCode());
BoolQueryBuilder fillingBoolMust = QueryBuilderUtils.copyBoolQuery(boolMust);
companyBoolMust(fillingBoolMust, UnitCategoryEnum.filling.getCode());
Long useCount = getStatisticCount(useBoolMust, index);
Long produceCount = getStatisticCount(produceBoolMust, index);
Long fillingCount = getStatisticCount(fillingBoolMust, index);
result.put("use", useCount);
result.put("produce", produceCount);
result.put("filling", fillingCount);
return result;
}
......
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