diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java index 35a0d5d..b047ade 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PostReviewServiceImpl.java @@ -76,6 +76,7 @@ public class PostReviewServiceImpl extends BaseServiceImpl implements IPostRevie Patients p = mongoTemplate.findById(model.getParentId(), Patients.class); tempMap.put("id", model.getId()); tempMap.put("vcCardNo", p.getVcCardNo()); + tempMap.put("pcerteTypeId", p.getPcerteTypeId()); tempMap.put("checkTime", model.getCheckTime() == null ? null : DateUtil.getyyyy_MM_dd(model.getCheckTime())); /** 复查日期 */ tempMap.put("hcertificateNum", p == null ? null : p.getCardNo()); /** 证件号 */ tempMap.put("username", p == null ? null : p.getUsername()); /** 姓名 */ diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java index f15bc3b..be6a781 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java @@ -1180,6 +1180,9 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService /** 组装数据 */ doMerge(datas, antExChuModels, antExModels, patients); + + /** 拼装好产检次数 */ + List> grid = getCheckNumerGrid(datas); } // List antExChuModels = mongoTemplate.find(antexcQuery, AntExChuModel.class); @@ -1199,12 +1202,33 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService return rest; } + private List> getCheckNumerGrid(List> datas) { + /** key = pid, value = 初诊复诊记录 */ + Map>> userCheckInfo = new HashMap<>(); + for (Map data : datas) { + String patientId = (String) data.get("patientId"); + if(userCheckInfo.containsKey(patientId)) { + List> maps = userCheckInfo.get(patientId); + maps.add(data); + } else { + List> maps = new ArrayList<>(); + maps.add(data); + userCheckInfo.put(patientId, maps); + } + } + System.out.println("==========="); + for (Map.Entry>> map : userCheckInfo.entrySet()) { + System.out.println(map.getKey() + " : " + map.getValue()); + } + return null; + } + private void doMerge(List> datas, List antExChuModels, List antExModels, List patients) { for (AntExChuModel antExChuModel : antExChuModels) { for (Patients patient : patients) { if(patient.getId().equals(antExChuModel.getParentId())) { Map temp = new HashMap<>(); - temp.put("pid", antExChuModel.getPid()); + temp.put("pid", patient.getPid()); temp.put("checkTime", antExChuModel.getCheckTime()); temp.put("patientId", patient.getId()); temp.put("bookbuildingDate", patient.getBookbuildingDate()); @@ -1219,7 +1243,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService for (Patients patient : patients) { if(patient.getId().equals(antExModel.getParentId())) { Map temp = new HashMap<>(); - temp.put("pid", antExModel.getPid()); + temp.put("pid", patient.getPid()); temp.put("checkTime", antExModel.getCheckDate()); temp.put("patientId", antExModel.getId()); temp.put("bookbuildingDate", patient.getBookbuildingDate()); @@ -1233,7 +1257,11 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService System.out.println(antExModels.size()); System.out.println(datas.size()); for (Map data : datas) { - System.out.println(data); + Set> entries = data.entrySet(); + for (Map.Entry entry : entries) { + System.out.print(entry.getKey() + " = " + (entry.getValue() instanceof Date ? ((Date) entry.getValue()).toLocaleString(): entry.getValue()) + "\t"); + } + System.out.println(); } }