Commit 784d591d authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register_to_0715' of…

Merge branch 'develop_tzs_register_to_0715' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register_to_0715
parents 24ba5f4c 2dce083d
...@@ -637,7 +637,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -637,7 +637,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
taskModelDto.setStartUserCompanyName(item.getCreateUserCompanyName()); // 任务发起人所在单位 taskModelDto.setStartUserCompanyName(item.getCreateUserCompanyName()); // 任务发起人所在单位
taskModelDto.setStartDate(item.getCreateDate()); taskModelDto.setStartDate(item.getCreateDate());
taskModelDto.setNextExecuteUser(item.getNextExecuteIds()); taskModelDto.setNextExecuteUser(item.getNextExecuteIds());
taskModelDto.setStartDate(new Date());
taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo())); taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()));
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(item, taskMessageDto); BeanUtils.copyProperties(item, taskMessageDto);
......
...@@ -465,9 +465,7 @@ public class ZLDPStatisticsServiceImpl { ...@@ -465,9 +465,7 @@ public class ZLDPStatisticsServiceImpl {
String orgCode = getAndSetOrgCode(screenDto.getCityCode()); String orgCode = getAndSetOrgCode(screenDto.getCityCode());
searchSourceBuilder.query(QueryBuilders.boolQuery() searchSourceBuilder.query(QueryBuilders.boolQuery()
.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"))); .must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")));
searchSourceBuilder.aggregation( searchSourceBuilder.aggregation(AggregationBuilders.terms("count_by_use_site_code").field("USE_SITE_CODE").size(500));
AggregationBuilders.terms("USE_SITE_CODE").field("USE_SITE_CODE")
);
searchRequest.source(searchSourceBuilder); searchRequest.source(searchSourceBuilder);
Map<String, Integer> dataMap = new HashMap<>(); Map<String, Integer> dataMap = new HashMap<>();
List<Map<String, Object>> returnList = new ArrayList<>(); List<Map<String, Object>> returnList = new ArrayList<>();
...@@ -476,7 +474,7 @@ public class ZLDPStatisticsServiceImpl { ...@@ -476,7 +474,7 @@ public class ZLDPStatisticsServiceImpl {
SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT); SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
// 获取所有聚合结果 // 获取所有聚合结果
Aggregations aggregations = searchResponse.getAggregations(); Aggregations aggregations = searchResponse.getAggregations();
Terms termsResult = aggregations.get("USE_SITE_CODE"); Terms termsResult = aggregations.get("count_by_use_site_code");
for (Terms.Bucket bucket : termsResult.getBuckets()) { for (Terms.Bucket bucket : termsResult.getBuckets()) {
String category = bucket.getKeyAsString(); // 或者使用 bucket.getKey() 对于非字符串类型 String category = bucket.getKeyAsString(); // 或者使用 bucket.getKey() 对于非字符串类型
...@@ -488,11 +486,12 @@ public class ZLDPStatisticsServiceImpl { ...@@ -488,11 +486,12 @@ public class ZLDPStatisticsServiceImpl {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("name", x.getName()); map.put("name", x.getName());
map.put("value", dataMap.getOrDefault(x.getCode(), 0)); map.put("value", dataMap.getOrDefault(x.getCode(), 0));
dataMap.remove(x.getCode());
returnList.add(map); returnList.add(map);
}); });
Map<String, Object> otherMap = new HashMap<>(); Map<String, Object> otherMap = new HashMap<>();
otherMap.put("name", "其他"); otherMap.put("name", "其他");
otherMap.put("value", dataMap.getOrDefault("其他", 0) + dataMap.getOrDefault("", 0)); otherMap.put("value", dataMap.values().stream().mapToLong(e -> e).sum());
returnList.add(otherMap); returnList.add(otherMap);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
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