From 81069fe4a3288c1e26de715d1157fdcbc92599f2 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Wed, 4 Apr 2018 13:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=AB=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/service/AntenatalExaminationService.java | 4 ++ .../web/facade/AntenatalExaminationFacade.java | 76 +++++++++++++++------- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java index f29bd7c..cc61240 100644 --- a/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java +++ b/platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java @@ -324,6 +324,10 @@ public class AntenatalExaminationService { return iAntExChuDao.query(antExChuQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); } + public List queryAntExChu(AntExChuQuery antExChuQuery,Sort.Direction direction,String field) { + return iAntExChuDao.query(antExChuQuery.convertToQuery().addOrder(Sort.Direction.DESC, field)); + } + public List queryAntExChu(MongoQuery mongoQuery) { return iAntExChuDao.query(mongoQuery); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java index 7e156f8..6e20abc 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java @@ -123,6 +123,9 @@ public class AntenatalExaminationFacade { @Autowired private DiagnoseConfigService diagnoseConfigService; + @Autowired + private PersonService personService; + /** * 处理区域隐藏建档 * @@ -2565,45 +2568,70 @@ public class AntenatalExaminationFacade { List values = new ArrayList<>(); + Patients patients = patientsService.findOnePatientById(patientId); + + List patientIds = new ArrayList<>(); + + if (patients != null) + { + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setYn(YnEnums.YES.getId()); + patientsQuery.setPid(patients.getPid()); + List patientses = patientsService.queryPatient(patientsQuery); + if (CollectionUtils.isNotEmpty(patientses)) + { + for (Patients pat : patientses) + { + patientIds.add(pat.getId()); + } + } + } + else + { + patientIds.add(patientId); + } + List> tables = new LinkedList<>(); AntExChuQuery antExChuQuery = new AntExChuQuery(); antExChuQuery.setYn(YnEnums.YES.getId()); - antExChuQuery.setParentId(patientId); - List antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); + antExChuQuery.setParentIds(patientIds); + List antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery,Sort.Direction.ASC, "created"); if (CollectionUtils.isNotEmpty(antExChuModels)) { - AntExChuModel chumodel = antExChuModels.get(0); - if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) + for (AntExChuModel chumodel : antExChuModels) { - Map item = new HashMap<>(); - String value = ""; - if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect()) ) + if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) { - if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) { - value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType()); - } else { - value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()); + Map item = new HashMap<>(); + String value = ""; + if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect()) ) + { + if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) { + value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType()); + } else { + value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()); + } } + else if (StringUtils.isNotEmpty(chumodel.getGonggao())) + { + value = chumodel.getGonggao(); + } + item.put("value", value); + item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime())); + if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches())) + { + titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime())); + values.add(chumodel.getGonggao()); + } + tables.add(item); } - else if (StringUtils.isNotEmpty(chumodel.getGonggao())) - { - value = chumodel.getGonggao(); - } - item.put("value", value); - item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime())); - if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches())) - { - titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime())); - values.add(chumodel.getGonggao()); - } - tables.add(item); } } AntExQuery antExQuery = new AntExQuery(); - antExQuery.setParentId(patientId); + antExQuery.setParentIds(patientIds); antExQuery.setYn(YnEnums.YES.getId()); List examinationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.ASC, "created")); if (CollectionUtils.isNotEmpty(examinationModelList)) -- 1.8.3.1