Commit 649cad715252193de3d0d4328b64fa28f88ea384

Authored by litao
1 parent 6d2a556185

增加pcerteTypeId

Showing 2 changed files with 32 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java View file @ 649cad7
... ... @@ -76,6 +76,7 @@
76 76 Patients p = mongoTemplate.findById(model.getParentId(), Patients.class);
77 77 tempMap.put("id", model.getId());
78 78 tempMap.put("vcCardNo", p.getVcCardNo());
  79 + tempMap.put("pcerteTypeId", p.getPcerteTypeId());
79 80 tempMap.put("checkTime", model.getCheckTime() == null ? null : DateUtil.getyyyy_MM_dd(model.getCheckTime())); /** 复查日期 */
80 81 tempMap.put("hcertificateNum", p == null ? null : p.getCardNo()); /** 证件号 */
81 82 tempMap.put("username", p == null ? null : p.getUsername()); /** 姓名 */
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 649cad7
... ... @@ -1180,6 +1180,9 @@
1180 1180  
1181 1181 /** 组装数据 */
1182 1182 doMerge(datas, antExChuModels, antExModels, patients);
  1183 +
  1184 + /** 拼装好产检次数 */
  1185 + List<Map<String, Object>> grid = getCheckNumerGrid(datas);
1183 1186 }
1184 1187  
1185 1188 // List<AntExChuModel> antExChuModels = mongoTemplate.find(antexcQuery, AntExChuModel.class);
1186 1189  
... ... @@ -1199,12 +1202,33 @@
1199 1202 return rest;
1200 1203 }
1201 1204  
  1205 + private List<Map<String,Object>> getCheckNumerGrid(List<Map<String, Object>> datas) {
  1206 + /** key = pid, value = 初诊复诊记录 */
  1207 + Map<String, List<Map<String, Object>>> userCheckInfo = new HashMap<>();
  1208 + for (Map<String, Object> data : datas) {
  1209 + String patientId = (String) data.get("patientId");
  1210 + if(userCheckInfo.containsKey(patientId)) {
  1211 + List<Map<String, Object>> maps = userCheckInfo.get(patientId);
  1212 + maps.add(data);
  1213 + } else {
  1214 + List<Map<String, Object>> maps = new ArrayList<>();
  1215 + maps.add(data);
  1216 + userCheckInfo.put(patientId, maps);
  1217 + }
  1218 + }
  1219 + System.out.println("===========");
  1220 + for (Map.Entry<String, List<Map<String, Object>>> map : userCheckInfo.entrySet()) {
  1221 + System.out.println(map.getKey() + " : " + map.getValue());
  1222 + }
  1223 + return null;
  1224 + }
  1225 +
1202 1226 private void doMerge(List<Map<String, Object>> datas, List<AntExChuModel> antExChuModels, List<AntenatalExaminationModel> antExModels, List<Patients> patients) {
1203 1227 for (AntExChuModel antExChuModel : antExChuModels) {
1204 1228 for (Patients patient : patients) {
1205 1229 if(patient.getId().equals(antExChuModel.getParentId())) {
1206 1230 Map<String, Object> temp = new HashMap<>();
1207   - temp.put("pid", antExChuModel.getPid());
  1231 + temp.put("pid", patient.getPid());
1208 1232 temp.put("checkTime", antExChuModel.getCheckTime());
1209 1233 temp.put("patientId", patient.getId());
1210 1234 temp.put("bookbuildingDate", patient.getBookbuildingDate());
... ... @@ -1219,7 +1243,7 @@
1219 1243 for (Patients patient : patients) {
1220 1244 if(patient.getId().equals(antExModel.getParentId())) {
1221 1245 Map<String, Object> temp = new HashMap<>();
1222   - temp.put("pid", antExModel.getPid());
  1246 + temp.put("pid", patient.getPid());
1223 1247 temp.put("checkTime", antExModel.getCheckDate());
1224 1248 temp.put("patientId", antExModel.getId());
1225 1249 temp.put("bookbuildingDate", patient.getBookbuildingDate());
... ... @@ -1233,7 +1257,11 @@
1233 1257 System.out.println(antExModels.size());
1234 1258 System.out.println(datas.size());
1235 1259 for (Map<String, Object> data : datas) {
1236   - System.out.println(data);
  1260 + Set<Map.Entry<String, Object>> entries = data.entrySet();
  1261 + for (Map.Entry<String, Object> entry : entries) {
  1262 + System.out.print(entry.getKey() + " = " + (entry.getValue() instanceof Date ? ((Date) entry.getValue()).toLocaleString(): entry.getValue()) + "\t");
  1263 + }
  1264 + System.out.println();
1237 1265 }
1238 1266 }
1239 1267