Commit 09efbd22 authored by suhuiguang's avatar suhuiguang

1.安全指数修改为随机数88到92之间整数

2.气瓶大屏自测bug修改
parent 2a5490c5
...@@ -83,7 +83,7 @@ public class CylinderDPStatisticsServiceImpl { ...@@ -83,7 +83,7 @@ public class CylinderDPStatisticsServiceImpl {
// 按照管辖机构区域信息模糊查询 // 按照管辖机构区域信息模糊查询
.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")) .must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"))
); );
TermsAggregationBuilder aggregation = AggregationBuilders.terms("USE_UNIT_CREDIT_CODE").field("USE_UNIT_CREDIT_CODE.keyword").size(10); TermsAggregationBuilder aggregation = AggregationBuilders.terms("USE_UNIT_CREDIT_CODE").field("USE_UNIT_CREDIT_CODE.keyword").size(300);
searchSourceBuilder.aggregation(aggregation); searchSourceBuilder.aggregation(aggregation);
searchRequest.source(searchSourceBuilder); searchRequest.source(searchSourceBuilder);
// 执行搜索并获取响应 // 执行搜索并获取响应
...@@ -127,8 +127,8 @@ public class CylinderDPStatisticsServiceImpl { ...@@ -127,8 +127,8 @@ public class CylinderDPStatisticsServiceImpl {
List<RegionModel> regionList = stCommonService.setRegionIfRootParent(regionCode); List<RegionModel> regionList = stCommonService.setRegionIfRootParent(regionCode);
List<Map<String, Object>> legendData = new ArrayList<>(); List<Map<String, Object>> legendData = new ArrayList<>();
List<String> xdata = this.buildXData(regionList); List<String> xdata = this.buildXData(regionList);
List<Long> qiping = getYDataForQP(regionCode, regionList); List<Long> qiping = getYDataForQP(regionList);
List<Long> qizhan = getYDataForQZ(regionCode, regionList); List<Long> qizhan = getYDataForQZ(regionList);
Map<String, Object> qiLegend = getQZLegend("气瓶数量", "qiping"); Map<String, Object> qiLegend = getQZLegend("气瓶数量", "qiping");
Map<String, Object> zhanLegend = getQZLegend("气站数量", "qizhan"); Map<String, Object> zhanLegend = getQZLegend("气站数量", "qizhan");
legendData.add(qiLegend); legendData.add(qiLegend);
...@@ -148,11 +148,11 @@ public class CylinderDPStatisticsServiceImpl { ...@@ -148,11 +148,11 @@ public class CylinderDPStatisticsServiceImpl {
return qiLegend; return qiLegend;
} }
private List<Long> getYDataForQZ(String regionCode, List<RegionModel> regionList) { private List<Long> getYDataForQZ(List<RegionModel> regionList) {
List<CountDto> enterpriseCountList = regionList.parallelStream().map(e -> { List<CountDto> enterpriseCountList = regionList.parallelStream().map(e -> {
CountDto dto = new CountDto(); CountDto dto = new CountDto();
dto.setKeyStr(e.getRegionCode() + ""); dto.setKeyStr(e.getRegionCode() + "");
String orgCode = stCommonService.getAndSetOrgCode(regionCode); String orgCode = stCommonService.getAndSetOrgCode(e.getRegionCode() + "");
if (StringUtils.isNotEmpty(orgCode)) { if (StringUtils.isNotEmpty(orgCode)) {
Long enterpriseNum = cylinderStatisticsMapper.countEnterpriseNumForCylinder(orgCode); Long enterpriseNum = cylinderStatisticsMapper.countEnterpriseNumForCylinder(orgCode);
dto.setLongValue(enterpriseNum); dto.setLongValue(enterpriseNum);
...@@ -164,10 +164,10 @@ public class CylinderDPStatisticsServiceImpl { ...@@ -164,10 +164,10 @@ public class CylinderDPStatisticsServiceImpl {
return regionList.stream().map(r -> enterpriseCountList.stream().filter(e -> e.getKeyStr().equals(r.getRegionCode() + "")).mapToLong(CountDto::getLongValue).sum()).collect(Collectors.toList()); return regionList.stream().map(r -> enterpriseCountList.stream().filter(e -> e.getKeyStr().equals(r.getRegionCode() + "")).mapToLong(CountDto::getLongValue).sum()).collect(Collectors.toList());
} }
private List<Long> getYDataForQP(String regionCode, List<RegionModel> regionList) { private List<Long> getYDataForQP(List<RegionModel> regionList) {
List<Long> qiping = new ArrayList<>(); List<Long> qiping = new ArrayList<>();
regionList.forEach(r -> { regionList.forEach(r -> {
String orgCode = stCommonService.getAndSetOrgCode(regionCode); String orgCode = stCommonService.getAndSetOrgCode(r.getRegionCode() + "");
if (StringUtils.isNotEmpty(orgCode)) { if (StringUtils.isNotEmpty(orgCode)) {
Long num = this.countForCylinderNum(orgCode); Long num = this.countForCylinderNum(orgCode);
qiping.add(num); qiping.add(num);
......
...@@ -50,6 +50,7 @@ import java.time.format.DateTimeFormatter; ...@@ -50,6 +50,7 @@ import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalAdjusters;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -477,7 +478,8 @@ public class JGDPStatisticsServiceImpl { ...@@ -477,7 +478,8 @@ public class JGDPStatisticsServiceImpl {
public Map<String, Object> querySafetyIndex(DPFilterParamDto dpFilterParamDto) { public Map<String, Object> querySafetyIndex(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put("riskScore", 12); int riskScore = ThreadLocalRandom.current().nextInt(88, 93);
result.put("riskScore", riskScore);
return result; 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