Commit 0e28dcd5e28976c847deeb9798e979bd58cf65df

Authored by litao@lymsh.com
1 parent 9c72982cb4

产检次数详情统计

Showing 2 changed files with 15 additions and 8 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ 0e28dcd
... ... @@ -114,7 +114,6 @@
114 114 String name, Integer currentPage, Integer pageSize, HttpServletRequest request) {
115 115 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
116 116 return reportService.checkInfo(childBirth, startDate, endDate, startWeek, endWeek, number, name, loginState.getId(), currentPage, pageSize);
117   -// return reportService.checkInfo(childBirth, startDate, endDate, startWeek, endWeek, number, name, 753, currentPage, pageSize);
118 117 }
119 118  
120 119 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 0e28dcd
... ... @@ -1194,7 +1194,9 @@
1194 1194  
1195 1195 /** 拼装好产检次数 */
1196 1196 List<Object> yData = new ArrayList<>();
1197   - List<Map<String, Object>> grid = getCheckNumerGrid(datas, yData);
  1197 + Map<Integer, List<String>> pidMap = new HashMap<>(); /** key=次数(0~13) value=具体的ids 详情直接采用这个数据来查 */
  1198 + List<Map<String, Object>> grid = getCheckNumerGrid(datas, yData, pidMap);
  1199 + restMap.put("pidMap", pidMap);
1198 1200 restMap.put("grid", grid);
1199 1201 restMap.put("xAxis", Arrays.asList("1次", "2次", "3次", "4次", "5次", "6次", "7次", "8次", "9次", "10次", "11次", "12次", "≥13次"));
1200 1202 restMap.put("yAxis", yData);
... ... @@ -1203,7 +1205,7 @@
1203 1205 return rest;
1204 1206 }
1205 1207  
1206   - private List<Map<String,Object>> getCheckNumerGrid(List<Map<String, Object>> datas, List<Object> yData) {
  1208 + private List<Map<String,Object>> getCheckNumerGrid(List<Map<String, Object>> datas, List<Object> yData, Map<Integer, List<String>> pidMap) {
1207 1209 /** key = pid, value = 初诊复诊记录 */
1208 1210 Map<String, List<Map<String, Object>>> userCheckInfo = new HashMap<>();
1209 1211 for (Map<String, Object> data : datas) {
1210 1212  
1211 1213  
1212 1214  
... ... @@ -1218,19 +1220,20 @@
1218 1220 }
1219 1221 }
1220 1222 Map<Integer, Integer> countMap = new HashMap<>();
  1223 + pidMap.put(0, new ArrayList<String>());
1221 1224 for (int i = 1; i < 14; i++) {
1222 1225 countMap.put(i, 0);
  1226 + pidMap.put(i, new ArrayList<String>());
1223 1227 }
1224 1228 Set<Map.Entry<String, List<Map<String, Object>>>> entries = userCheckInfo.entrySet();
1225 1229 for (Map.Entry<String, List<Map<String, Object>>> entry : entries) {
1226 1230 List<Map<String, Object>> value = entry.getValue();
1227 1231 if(value.size() == 1) {
1228 1232 countMap.put(1, countMap.get(1) + 1);
  1233 + pidMap.get(1).add(entry.getKey());
1229 1234 } else {
1230   - /** 按照分娩时间分组 */
1231   - /** key=pid value=count */
1232   - Map<Date, Integer> tempMap = new HashMap<>();
1233   - Integer other = 0;
  1235 + Map<Date, Integer> tempMap = new HashMap<>();/** 按照分娩时间分组 */
  1236 + Integer other = 0; /** 分娩时间为null的次数 */
1234 1237 for (Map<String, Object> map : value) {
1235 1238 Date fmDate = (Date) map.get("fmDate");
1236 1239 if(fmDate == null) {
1237 1240  
1238 1241  
... ... @@ -1243,11 +1246,13 @@
1243 1246 tempMap.put(fmDate, 1);
1244 1247 }
1245 1248 }
1246   - if(other != 0) { /** 处理大于或等于13次 没有分娩时间的数据 */
  1249 + if(other != 0) { /** 处理没有分娩时间的数据 */
1247 1250 if(other >= 13) {
1248 1251 countMap.put(13, countMap.get(13) + 1);
  1252 + pidMap.get(13).add(entry.getKey());
1249 1253 } else {
1250 1254 countMap.put(other, countMap.get(other) + 1);
  1255 + pidMap.get(other).add(entry.getKey());
1251 1256 }
1252 1257 }
1253 1258  
1254 1259  
... ... @@ -1256,8 +1261,10 @@
1256 1261 Integer v = en.getValue();
1257 1262 if(v >= 13) {
1258 1263 countMap.put(13, countMap.get(13) + 1);
  1264 + pidMap.get(13).add(entry.getKey());
1259 1265 } else {
1260 1266 countMap.put(v, countMap.get(v) + 1);
  1267 + pidMap.get(v).add(entry.getKey());
1261 1268 }
1262 1269  
1263 1270 }
... ... @@ -1267,6 +1274,7 @@
1267 1274 Integer count = 0;
1268 1275 for (int i = 1; i < 14; i++) {
1269 1276 count += countMap.get(i);
  1277 + pidMap.get(0).addAll(pidMap.get(i));
1270 1278 }
1271 1279 countMap.put(0, count);
1272 1280