Commit 45f6c180536270a592ba50f1a98a392739acec91
1 parent
9515a1a5e2
Exists in
master
and in
3 other branches
add statistics(map) common index
Showing 1 changed file with 37 additions and 15 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
View file @
45f6c18
| ... | ... | @@ -196,20 +196,7 @@ |
| 196 | 196 | groupRiskSeriesList.add(groupRiskSeries); |
| 197 | 197 | groupRiskOption.setSeries(groupRiskSeriesList); |
| 198 | 198 | |
| 199 | - | |
| 200 | - // 4. 按省或市或地区查询区域内近12个自然月每月建档人数 | |
| 201 | - List<AreaData> patientMonthList = statisticsService.queryMonthPatients(new AreaDataQuery()); | |
| 202 | 199 | Map<String, Map<String, Integer>> patientMonthMap = new HashMap<>(); |
| 203 | - Map<String, Integer> pmap = new HashMap<>(); | |
| 204 | - for (AreaData areaData:patientMonthList) { | |
| 205 | - String month = buildMonth(areaData.getYear()); | |
| 206 | - if (pmap.containsKey(month)) { | |
| 207 | - pmap.put(month, pmap.get(month) + areaData.getVal()); | |
| 208 | - } else { | |
| 209 | - pmap.put(month, areaData.getVal()); | |
| 210 | - } | |
| 211 | - } | |
| 212 | - patientMonthMap.put("建档人数", pmap); | |
| 213 | 200 | // 6. 按省或市或地区查询区域内近12个自然月每月产检中历史高危人数(按颜色分组) |
| 214 | 201 | AreaDataQuery query = new AreaDataQuery(); |
| 215 | 202 | query.setDays(12); |
| 216 | 203 | |
| 217 | 204 | |
| 218 | 205 | |
| ... | ... | @@ -224,18 +211,53 @@ |
| 224 | 211 | } |
| 225 | 212 | } |
| 226 | 213 | patientMonthMap.put("高危人数", rmap); |
| 227 | - | |
| 228 | - | |
| 214 | + // 4. 按省或市或地区查询区域内近12个自然月每月建档人数 | |
| 215 | + query = new AreaDataQuery(); | |
| 216 | + List<AreaData> patientMonthList = statisticsService.queryMonthPatients(query); | |
| 217 | + Map<String, Integer> pmap = new HashMap<>(); | |
| 218 | + for (AreaData areaData:patientMonthList) { | |
| 219 | + String month = buildMonth(areaData.getYear()); | |
| 220 | + if (pmap.containsKey(month)) { | |
| 221 | + pmap.put(month, pmap.get(month) + areaData.getVal()); | |
| 222 | + } else { | |
| 223 | + pmap.put(month, areaData.getVal()); | |
| 224 | + } | |
| 225 | + } | |
| 226 | + patientMonthMap.put("建档人数", pmap); | |
| 229 | 227 | Option patientMonthOption = buildLineOption("建档&高危人数", null, patientMonthMap, buildDefaultMonth(12)); |
| 230 | 228 | |
| 229 | + // 按省或市或地区查询区域内近12个自然月每月初诊人数、复诊人数 | |
| 230 | + query = new AreaDataQuery(); | |
| 231 | + List<AreaData> reportMonthList = statisticsService.queryMonthReports(query); | |
| 232 | + Map<String, Map<String, Integer>> reportMonthMap = new HashMap<>(); | |
| 233 | + Map<String, Integer> firstmap = new HashMap<>(); | |
| 234 | + Map<String, Integer> secondmap = new HashMap<>(); | |
| 235 | + for (AreaData areaData:reportMonthList) { | |
| 236 | + String month = buildMonth(areaData.getYear()); | |
| 237 | + if (firstmap.containsKey(month)) { | |
| 238 | + firstmap.put(month, firstmap.get(month) + areaData.getVal()); | |
| 239 | + } else { | |
| 240 | + firstmap.put(month, areaData.getVal()); | |
| 241 | + } | |
| 242 | + if (secondmap.containsKey(month)) { | |
| 243 | + secondmap.put(month, secondmap.get(month) + areaData.getVal()); | |
| 244 | + } else { | |
| 245 | + secondmap.put(month, areaData.getVal()); | |
| 246 | + } | |
| 247 | + } | |
| 248 | + reportMonthMap.put("初诊人数", firstmap); | |
| 249 | + reportMonthMap.put("复诊人数", secondmap); | |
| 250 | + Option reportMonthOption = buildLineOption("初诊&复诊人数", null, reportMonthMap, buildDefaultMonth(12)); | |
| 231 | 251 | |
| 232 | 252 | |
| 253 | + | |
| 233 | 254 | result.put("type", 1); |
| 234 | 255 | result.put("kvData", kvData); |
| 235 | 256 | result.put("mapsOption", option); |
| 236 | 257 | result.put("areaBarOption", areaBarOption); |
| 237 | 258 | result.put("riskOption", groupRiskOption); |
| 238 | 259 | result.put("patientMonthOption", patientMonthOption); |
| 260 | + result.put("reportMonthOption", reportMonthOption); | |
| 239 | 261 | ResultUtils.buildSuccessResultAndWrite(response, result); |
| 240 | 262 | } |
| 241 | 263 |