Commit 64880da3 authored by tianbo's avatar tianbo

refactor(statistics): 优化设备数量统计逻辑

- 在 JGDPStatisticsServiceImpl 中单独计算已纳管设备(台套)数量总数
parent ad0f5d43
...@@ -380,6 +380,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -380,6 +380,9 @@ public class JGDPStatisticsServiceImpl {
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode, true, false, false); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode, true, false, false);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 //1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode, true, false, false); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode, true, false, false);
// 单独计算已纳管设备(台套)数量总数
long hasSupervisoryCodeEquipCount = stCommonService.queryHasSupervisoryCodeEquipCount(orgCode, false);
result.put("total", hasSupervisoryCodeEquipCount);
//2.压力管道长度统计 //2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode, true, false);
//3.单位数量统计 //3.单位数量统计
......
...@@ -303,7 +303,7 @@ public class StCommonServiceImpl { ...@@ -303,7 +303,7 @@ public class StCommonServiceImpl {
}); });
// 注意,求总数时:countMap不包括气瓶数量、压力管道数量(20240819修改) // 注意,求总数时:countMap不包括气瓶数量、压力管道数量(20240819修改)
// 总数为已赋码设备数量,需要单独统计 // 总数为已赋码设备数量,需要单独统计
result.put(DPMapStatisticsItemEnum.TOTAL.getCode(), queryHasSupervisoryCodeEquipCount(orgCode, isOrgBranchCodeExactMatch, cylinderNum)); result.put(DPMapStatisticsItemEnum.TOTAL.getCode(), countMap.values().stream().mapToLong(e -> e).sum());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
...@@ -315,10 +315,9 @@ public class StCommonServiceImpl { ...@@ -315,10 +315,9 @@ public class StCommonServiceImpl {
* 统计已赋码设备数量 * 统计已赋码设备数量
* @param orgCode * @param orgCode
* @param isOrgBranchCodeExactMatch * @param isOrgBranchCodeExactMatch
* @param cylinderNum
* @return * @return
*/ */
public long queryHasSupervisoryCodeEquipCount(String orgCode, Boolean isOrgBranchCodeExactMatch, long cylinderNum) { public long queryHasSupervisoryCodeEquipCount(String orgCode, Boolean isOrgBranchCodeExactMatch) {
CountRequest request = new CountRequest(); CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all"); request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
......
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