From 55fb56253864ce2996504a74ee56e77b6de7f1b3 Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Mon, 24 Jul 2017 11:05:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E6=A3=80=E4=BA=BA=E6=95=B0=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=9F=A5=E7=9C=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/ReportServiceImpl.java | 81 +++++++++++----------- 1 file changed, 41 insertions(+), 40 deletions(-) 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 d32bf1c..1f5ff8c 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 @@ -1274,50 +1274,51 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService Users users = usersService.getUsers(Integer.parseInt(prodDoctor)); tempMap.put("DOCTOR_NAME", users == null ? null : users.getName()); } - } - } else { - for (Patients patient : patients) { - /** 查出所有符合条件的patients */ - Criteria criteria = Criteria.where("hospitalId").is(hospitalId).and("yn").ne("0"); - if(startDate != null && endDate != null) { - criteria.and("bookbuildingDate").gte(startDate).lt(DateUtil.addDay(endDate, 1)); - } - if(startWeek != null && endWeek != null) { /** 末次月经 到 现在相隔的周数 */ - criteria.and("lastMenses").lte(DateUtil.getWeekDay(startWeek)).gte(DateUtil.getWeekDay(-endWeek)); - } - if(childBirth != null) { - criteria.and("type").is(childBirth); - } - List p = mongoUtil.findField(Patients.class, criteria,"id", "bookbuildingDate", "fmDate", "pid"); - List patientIds = CollectionUtils.getId(p, "id", String.class); - - /** 初诊数据 */ - Criteria c = Criteria.where("hospitalId").is(hospitalId).and("parentId").in(patientIds).and("pid").is(pid); - Long antExChuModelCount = mongoTemplate.count(Query.query(c), AntExChuModel.class); - Long antExModelCount = mongoTemplate.count(Query.query(c), AntenatalExaminationModel.class); - if(antExChuModelCount.intValue() + antExModelCount.intValue() == number) { - tempMap.put("NAME", patient.getUsername()); - tempMap.put("YUNZHOU", DateUtil.getWeek(patient.getLastMenses(), patient.getLastCTime())); - String riskLevelId = patient.getRiskLevelId(); - if(StringUtils.isNotBlank(riskLevelId)) { - List basicIds = JSON.parseArray(riskLevelId, String.class); - String HIGH_RISK_GRADE = ""; - for (String basicId : basicIds) { - HIGH_RISK_GRADE = HIGH_RISK_GRADE + mongoUtil.findName(basicId) + ","; + } else { + for (Patients patient : patients) { + /** 查出所有符合条件的patients */ + Criteria criteria = Criteria.where("hospitalId").is(hospitalId).and("yn").ne("0"); + if(startDate != null && endDate != null) { + criteria.and("bookbuildingDate").gte(startDate).lt(DateUtil.addDay(endDate, 1)); + } + if(startWeek != null && endWeek != null) { /** 末次月经 到 现在相隔的周数 */ + criteria.and("lastMenses").lte(DateUtil.getWeekDay(startWeek)).gte(DateUtil.getWeekDay(-endWeek)); + } + if(childBirth != null) { + criteria.and("type").is(childBirth); + } + List p = mongoUtil.findField(Patients.class, criteria,"id", "bookbuildingDate", "fmDate", "pid"); + List patientIds = CollectionUtils.getId(p, "id", String.class); + + /** 初诊数据 */ + Criteria c = Criteria.where("hospitalId").is(hospitalId).and("parentId").in(patientIds).and("pid").is(pid); + Long antExChuModelCount = mongoTemplate.count(Query.query(c), AntExChuModel.class); + Long antExModelCount = mongoTemplate.count(Query.query(c), AntenatalExaminationModel.class); + if(antExChuModelCount.intValue() + antExModelCount.intValue() == number) { + tempMap.put("NAME", patient.getUsername()); + tempMap.put("YUNZHOU", DateUtil.getWeek(patient.getLastMenses(), patient.getLastCTime())); + String riskLevelId = patient.getRiskLevelId(); + if(StringUtils.isNotBlank(riskLevelId)) { + List basicIds = JSON.parseArray(riskLevelId, String.class); + String HIGH_RISK_GRADE = ""; + for (String basicId : basicIds) { + HIGH_RISK_GRADE = HIGH_RISK_GRADE + mongoUtil.findName(basicId) + ","; + } + tempMap.put("HIGH_RISK_GRADE", HIGH_RISK_GRADE.substring(0, HIGH_RISK_GRADE.length() - 1)); /** 高危等级 */ + } + tempMap.put("HIGH_RISK_FACTOR", patient.getoRiskFactor()); /** 风险因素 */ + tempMap.put("EDD_DATE", patient.getDueDate()); + tempMap.put("LAST_EXAMINE_DATE", DateUtil.getyyyy_MM_dd(patient.getLastCTime())); + String prodDoctor = patient.getBookbuildingDoctor(); + if(StringUtils.isNotBlank(prodDoctor)) { + Users users = usersService.getUsers(Integer.parseInt(prodDoctor)); + tempMap.put("DOCTOR_NAME", users == null ? null : users.getName()); + } } - tempMap.put("HIGH_RISK_GRADE", HIGH_RISK_GRADE.substring(0, HIGH_RISK_GRADE.length() - 1)); /** 高危等级 */ - } - tempMap.put("HIGH_RISK_FACTOR", patient.getoRiskFactor()); /** 风险因素 */ - tempMap.put("EDD_DATE", patient.getDueDate()); - tempMap.put("LAST_EXAMINE_DATE", DateUtil.getyyyy_MM_dd(patient.getLastCTime())); - String prodDoctor = patient.getBookbuildingDoctor(); - if(StringUtils.isNotBlank(prodDoctor)) { - Users users = usersService.getUsers(Integer.parseInt(prodDoctor)); - tempMap.put("DOCTOR_NAME", users == null ? null : users.getName()); } - } } } + rest.add(tempMap); } pageResult.setGrid(rest); -- 1.8.3.1