Commit 16702b4b authored by 王果's avatar 王果

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents 771f5cd2 1dc663e5
package com.yeejoin.amos.boot.module.statistcs.biz.init;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.AQZSDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.JGDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import org.springframework.boot.ApplicationArguments;
......@@ -15,19 +14,14 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
@Component
public class DataInitAfterRuning implements ApplicationRunner {
private JGDPStatisticsServiceImpl jgdpStatisticsService;
private AQZSDPStatisticsServiceImpl aqzsdpStatisticsService;
private StCommonServiceImpl stCommonService;
private AmosRequestContext amosRequestContext;
public DataInitAfterRuning(JGDPStatisticsServiceImpl jgdpStatisticsService, StCommonServiceImpl stCommonService, AmosRequestContext amosRequestContext, AQZSDPStatisticsServiceImpl aqzsdpStatisticsService) {
this.jgdpStatisticsService = jgdpStatisticsService;
public DataInitAfterRuning(StCommonServiceImpl stCommonService, AmosRequestContext amosRequestContext) {
this.stCommonService = stCommonService;
this.amosRequestContext = amosRequestContext;
this.aqzsdpStatisticsService = aqzsdpStatisticsService;
}
@Override
......@@ -36,8 +30,6 @@ public class DataInitAfterRuning implements ApplicationRunner {
RequestContext.setAppKey(amosRequestContext.getAppKey());
RequestContext.setProduct(amosRequestContext.getProduct());
RequestContext.setToken(amosRequestContext.getToken());
jgdpStatisticsService.init();
stCommonService.init();
aqzsdpStatisticsService.init();
}
}
......@@ -29,7 +29,6 @@ import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@Service
......@@ -45,13 +44,14 @@ public class ZLDPStatisticsServiceImpl {
private RestHighLevelClient restHighLevelClient;
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
private StCommonServiceImpl stCommonService;
public ZLDPStatisticsServiceImpl(ZLStatisticsMapper screenMapper, DataDictionaryServiceImpl iDataDictionaryService, AlertStatisticsMapper alertStatisticsMapper, RestHighLevelClient restHighLevelClient) {
public ZLDPStatisticsServiceImpl(ZLStatisticsMapper screenMapper, DataDictionaryServiceImpl iDataDictionaryService, AlertStatisticsMapper alertStatisticsMapper, RestHighLevelClient restHighLevelClient, StCommonServiceImpl stCommonService) {
this.screenMapper = screenMapper;
this.iDataDictionaryService = iDataDictionaryService;
this.alertStatisticsMapper = alertStatisticsMapper;
this.restHighLevelClient = restHighLevelClient;
this.stCommonService = stCommonService;
}
......@@ -462,7 +462,7 @@ public class ZLDPStatisticsServiceImpl {
SearchRequest searchRequest = new SearchRequest("idx_biz_view_jg_all");
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
//设置模糊搜索
String orgCode = getAndSetOrgCode(screenDto.getCityCode());
String orgCode = stCommonService.getAndSetOrgCode(screenDto.getCityCode());
searchSourceBuilder.query(QueryBuilders.boolQuery()
.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")));
searchSourceBuilder.aggregation(AggregationBuilders.terms("count_by_use_site_code").field("USE_SITE_CODE").size(500));
......@@ -499,16 +499,6 @@ public class ZLDPStatisticsServiceImpl {
return returnList;
}
private String getAndSetOrgCode(String cityCode) {
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode == null) {
orgCode = screenMapper.getOrgCodeByCompanyCode(cityCode);
if (orgCode != null) {
regionCodeOrgCodeMap.put(cityCode, orgCode);
}
}
return orgCode;
}
public Map<String,Object> userCountNew(DPFilterParamDto screenDto) {
List<String> unitTypeList = UnitTypeEnum.getNameListByType(screenDto.getCompanyType());
......@@ -580,7 +570,7 @@ public class ZLDPStatisticsServiceImpl {
jsonObject5.put("value", ValidationUtil.isEmpty(statistics.getAvgTime()) ? 0 : statistics.getAvgTime());
jsonObject5.put("name", "平均救援时间");
String orgCode = this.getAndSetOrgCode(regionCode);
String orgCode = stCommonService.getAndSetOrgCode(regionCode);
JSONObject jsonObject6 = new JSONObject();
jsonObject6.put("key", "jycq");
jsonObject6.put("value", this.getQuestionNumber("检验超期",params, orgCode));
......
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