From b65cf797f264694fdef51eff735cc50182a1bd2c Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 19 Apr 2018 10:10:52 +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 --- .../web/facade/AntenatalExaminationFacade.java | 100 ++++++++++++++------- 1 file changed, 69 insertions(+), 31 deletions(-) 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 352770a..30f377b 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 @@ -2763,66 +2763,104 @@ public class AntenatalExaminationFacade { public BaseResponse getGongGaoLine(String patientId, Integer id) { - Map map = new HashMap<>(); + Map map = new HashMap<>(); List titles = new ArrayList<>(); List values = new ArrayList<>(); - List> tables = new LinkedList<>(); + 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); - if (CollectionUtils.isNotEmpty(antExChuModels)) { - AntExChuModel chumodel = antExChuModels.get(0); - if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(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()); + antExChuQuery.setParentIds(patientIds); + List antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery,Sort.Direction.ASC, "created"); + if (CollectionUtils.isNotEmpty(antExChuModels)) + { + for (AntExChuModel chumodel : antExChuModels) + { + if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(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()); + 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); } - 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)) { - for (AntenatalExaminationModel anmodel : examinationModelList) { - if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) { - Map item = new HashMap<>(); + if (CollectionUtils.isNotEmpty(examinationModelList)) + { + for (AntenatalExaminationModel anmodel : examinationModelList) + { + if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) + { + Map item = new HashMap<>(); String value = ""; - if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) { + if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect()) ) + { if (StringUtils.isNotEmpty(anmodel.getGongGaoType())) { value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect()) + "," + GongJingEnums.getHengZhiNameById(anmodel.getGongGaoType()); } else { value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect()); } - } else if (StringUtils.isNotEmpty(anmodel.getGongGao())) { + } + else if (StringUtils.isNotEmpty(anmodel.getGongGao())) + { value = anmodel.getGongGao(); } item.put("value", value); item.put("time", DateUtil.getyyyy_MM_dd(anmodel.getCheckDate())); - if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches())) { + if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches())) + { titles.add(DateUtil.getyyyy_MM_dd(anmodel.getCheckDate())); values.add(anmodel.getGongGao()); } -- 1.8.3.1