Commit 5aacb2d7 authored by suhuiguang's avatar suhuiguang

1.区县未在amos创建公司时代码报错处理

parent 1f8f3b92
...@@ -636,9 +636,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -636,9 +636,11 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueMonthList(String cityCode) { public List<Map<String, Object>> issueMonthList(String cityCode) {
String orgCode = stCommonService.getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
if(orgCode == null){
return new ArrayList<>(0);
}
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")); String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
List<Map<String, Object>> list = statisticsMapper.issueMonthList(orgCode, time); return statisticsMapper.issueMonthList(orgCode, time);
return list;
} }
public Map<String, Object> issueProblemLevelCount(String cityCode) { public Map<String, Object> issueProblemLevelCount(String cityCode) {
...@@ -748,19 +750,22 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -748,19 +750,22 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueCountTopByProblemType(String cityCode) { public List<Map<String, Object>> issueCountTopByProblemType(String cityCode) {
String orgCode = stCommonService.getAndSetOrgCode(cityCode); String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<Map<String, Object>> allList = statisticsMapper.issueCountTopByProblemType(orgCode, null); List<Map<String, Object>> allList = new ArrayList<>();
List<Map<String, Object>> endList = statisticsMapper.issueCountTopByProblemType(orgCode, "1"); Map<String, Object> endIssueDataMap = new HashMap<>();
Map<String, Object> endIssuedataMap = new HashMap<>(); if(orgCode != null){
endList.forEach(t -> { allList = statisticsMapper.issueCountTopByProblemType(orgCode, null);
endIssuedataMap.put(t.get("problemTypeCode").toString(), t.get("count")); 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<>(); List<Map<String, Object>> resultList = new ArrayList<>();
for (int i = 0; i < allList.size(); i++) { for (int i = 0; i < allList.size(); i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("name", IssueTypeEnum.getNameByCode(allList.get(i).get("problemTypeCode").toString())); map.put("name", IssueTypeEnum.getNameByCode(allList.get(i).get("problemTypeCode").toString()));
map.put("count", allList.get(i).get("count")); map.put("count", allList.get(i).get("count"));
if (null != endIssuedataMap.get(allList.get(i).get("problemTypeCode").toString())) { 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") + "")))); 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); resultList.add(map);
} }
......
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