Commit 4af7829f 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 0ab1e6f9 5befd66f
......@@ -636,9 +636,11 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueMonthList(String cityCode) {
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
if(orgCode == null){
return new ArrayList<>(0);
}
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
List<Map<String, Object>> list = statisticsMapper.issueMonthList(orgCode, time);
return list;
return statisticsMapper.issueMonthList(orgCode, time);
}
public Map<String, Object> issueProblemLevelCount(String cityCode) {
......@@ -748,19 +750,22 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueCountTopByProblemType(String cityCode) {
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<Map<String, Object>> allList = statisticsMapper.issueCountTopByProblemType(orgCode, null);
List<Map<String, Object>> endList = statisticsMapper.issueCountTopByProblemType(orgCode, "1");
Map<String, Object> endIssuedataMap = new HashMap<>();
endList.forEach(t -> {
endIssuedataMap.put(t.get("problemTypeCode").toString(), t.get("count"));
});
List<Map<String, Object>> allList = new ArrayList<>();
Map<String, Object> endIssueDataMap = new HashMap<>();
if(orgCode != null){
allList = statisticsMapper.issueCountTopByProblemType(orgCode, null);
List<Map<String, Object>> endList = statisticsMapper.issueCountTopByProblemType(orgCode, "1");
endList.forEach(t -> {
endIssueDataMap.put(t.get("problemTypeCode").toString(), t.get("count"));
});
}
List<Map<String, Object>> resultList = new ArrayList<>();
for (int i = 0; i < allList.size(); i++) {
Map<String, Object> map = new HashMap<>();
map.put("name", IssueTypeEnum.getNameByCode(allList.get(i).get("problemTypeCode").toString()));
map.put("count", allList.get(i).get("count"));
if (null != endIssuedataMap.get(allList.get(i).get("problemTypeCode").toString())) {
map.put("rate", new DecimalFormat("0.00").format(Double.parseDouble(endIssuedataMap.get(allList.get(i).get("problemTypeCode").toString()) + "") / (Double.parseDouble(allList.get(i).get("count") + ""))));
if (null != endIssueDataMap.get(allList.get(i).get("problemTypeCode").toString())) {
map.put("rate", new DecimalFormat("0.00").format(Double.parseDouble(endIssueDataMap.get(allList.get(i).get("problemTypeCode").toString()) + "") / (Double.parseDouble(allList.get(i).get("count") + ""))));
}
resultList.add(map);
}
......
......@@ -103,7 +103,7 @@ public class CylinderDPStatisticsServiceImpl {
// 这里只是打印出聚合的名称和桶的数量,你需要根据自己的需求来处理这些数据
Terms terms = searchResponse.getAggregations().get("USE_UNIT_CREDIT_CODE");
List<Map<String, Object>> dataList = new ArrayList<>();
List<String> keys = new ArrayList<>();
Set<String> keys = new HashSet<>();
for (Terms.Bucket bucket : terms.getBuckets()) {
Map<String, Object> item = new HashMap<>();
item.put("count", bucket.getDocCount());
......@@ -111,7 +111,10 @@ public class CylinderDPStatisticsServiceImpl {
dataList.add(item);
keys.add(bucket.getKeyAsString());
}
Map<String, TzBaseEnterpriseInfo> useCodeEntryMap = getStringTzBaseEnterpriseInfoDtoMap(keys);
Map<String, TzBaseEnterpriseInfo> useCodeEntryMap = new HashMap<>();
if(keys.size() > 0){
useCodeEntryMap = getStringTzBaseEnterpriseInfoDtoMap(keys);
}
for (Map<String, Object> item : dataList) {
Object key = item.get("key");
if (useCodeEntryMap.containsKey(key)) {
......@@ -124,7 +127,7 @@ public class CylinderDPStatisticsServiceImpl {
return dataList;
}
private Map<String, TzBaseEnterpriseInfo> getStringTzBaseEnterpriseInfoDtoMap(List<String> keys) {
private Map<String, TzBaseEnterpriseInfo> getStringTzBaseEnterpriseInfoDtoMap(Set<String> keys) {
LambdaQueryWrapper<TzBaseEnterpriseInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(TzBaseEnterpriseInfo::getUseUnitCode, keys);
queryWrapper.select(TzBaseEnterpriseInfo::getUseUnitCode, TzBaseEnterpriseInfo::getProvince, TzBaseEnterpriseInfo::getCity, TzBaseEnterpriseInfo::getDistrict, TzBaseEnterpriseInfo::getUseUnit);
......
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