Commit b65cf797f264694fdef51eff735cc50182a1bd2c

Authored by liquanyu
1 parent 8dc769153e

宫高

Showing 1 changed file with 69 additions and 31 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ b65cf79
... ... @@ -2763,66 +2763,104 @@
2763 2763  
2764 2764 public BaseResponse getGongGaoLine(String patientId, Integer id) {
2765 2765  
2766   - Map<String, Object> map = new HashMap<>();
  2766 + Map<String,Object> map = new HashMap<>();
2767 2767  
2768 2768 List<String> titles = new ArrayList<>();
2769 2769 List<String> values = new ArrayList<>();
2770 2770  
2771 2771  
2772   - List<Map<String, String>> tables = new LinkedList<>();
  2772 + Patients patients = patientsService.findOnePatientById(patientId);
2773 2773  
  2774 + List<String> patientIds = new ArrayList<>();
  2775 +
  2776 + if (patients != null)
  2777 + {
  2778 + PatientsQuery patientsQuery = new PatientsQuery();
  2779 + patientsQuery.setYn(YnEnums.YES.getId());
  2780 + patientsQuery.setPid(patients.getPid());
  2781 + List<Patients> patientses = patientsService.queryPatient(patientsQuery);
  2782 + if (CollectionUtils.isNotEmpty(patientses))
  2783 + {
  2784 + for (Patients pat : patientses)
  2785 + {
  2786 + patientIds.add(pat.getId());
  2787 + }
  2788 + }
  2789 + }
  2790 + else
  2791 + {
  2792 + patientIds.add(patientId);
  2793 + }
  2794 +
  2795 + List<Map<String,String>> tables = new LinkedList<>();
  2796 +
2774 2797 AntExChuQuery antExChuQuery = new AntExChuQuery();
2775 2798 antExChuQuery.setYn(YnEnums.YES.getId());
2776   - antExChuQuery.setParentId(patientId);
2777   - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
2778   - if (CollectionUtils.isNotEmpty(antExChuModels)) {
2779   - AntExChuModel chumodel = antExChuModels.get(0);
2780   - if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) {
2781   - Map<String, String> item = new HashMap<>();
2782   - String value = "";
2783   - if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect())) {
2784   - if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) {
2785   - value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType());
2786   - } else {
2787   - value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect());
  2799 + antExChuQuery.setParentIds(patientIds);
  2800 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery,Sort.Direction.ASC, "created");
  2801 + if (CollectionUtils.isNotEmpty(antExChuModels))
  2802 + {
  2803 + for (AntExChuModel chumodel : antExChuModels)
  2804 + {
  2805 + if (StringUtils.isNotEmpty(chumodel.getGonggao()) || StringUtils.isNotEmpty(chumodel.getGonggaoSelect()))
  2806 + {
  2807 + Map<String,String> item = new HashMap<>();
  2808 + String value = "";
  2809 + if (StringUtils.isNotEmpty(chumodel.getGonggaoSelect()) )
  2810 + {
  2811 + if (StringUtils.isNotEmpty(chumodel.getGonggaoType())) {
  2812 + value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect()) + "," + GongJingEnums.getHengZhiNameById(chumodel.getGonggaoType());
  2813 + } else {
  2814 + value = GongJingEnums.getGongGaoNameById(chumodel.getGonggaoSelect());
  2815 + }
2788 2816 }
2789   - } else if (StringUtils.isNotEmpty(chumodel.getGonggao())) {
2790   - value = chumodel.getGonggao();
  2817 + else if (StringUtils.isNotEmpty(chumodel.getGonggao()))
  2818 + {
  2819 + value = chumodel.getGonggao();
  2820 + }
  2821 + item.put("value", value);
  2822 + item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
  2823 + if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches()))
  2824 + {
  2825 + titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
  2826 + values.add(chumodel.getGonggao());
  2827 + }
  2828 + tables.add(item);
2791 2829 }
2792   - item.put("value", value);
2793   - item.put("time", DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
2794   - if (StringUtils.isNotEmpty(chumodel.getGonggao()) && (StringUtils.isNumeric(chumodel.getGonggao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(chumodel.getGonggao()).matches())) {
2795   - titles.add(DateUtil.getyyyy_MM_dd(chumodel.getCheckTime()));
2796   - values.add(chumodel.getGonggao());
2797   - }
2798   - tables.add(item);
2799 2830 }
2800 2831 }
2801 2832  
2802 2833  
2803 2834 AntExQuery antExQuery = new AntExQuery();
2804   - antExQuery.setParentId(patientId);
  2835 + antExQuery.setParentIds(patientIds);
2805 2836 antExQuery.setYn(YnEnums.YES.getId());
2806 2837 List<AntenatalExaminationModel> examinationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.ASC, "created"));
2807   - if (CollectionUtils.isNotEmpty(examinationModelList)) {
2808   - for (AntenatalExaminationModel anmodel : examinationModelList) {
2809   - if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) {
2810   - Map<String, String> item = new HashMap<>();
  2838 + if (CollectionUtils.isNotEmpty(examinationModelList))
  2839 + {
  2840 + for (AntenatalExaminationModel anmodel : examinationModelList)
  2841 + {
  2842 + if (StringUtils.isNotEmpty(anmodel.getGongGao()) || StringUtils.isNotEmpty(anmodel.getGongGaoSelect()))
  2843 + {
  2844 + Map<String,String> item = new HashMap<>();
2811 2845  
2812 2846 String value = "";
2813   - if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect())) {
  2847 + if (StringUtils.isNotEmpty(anmodel.getGongGaoSelect()) )
  2848 + {
2814 2849 if (StringUtils.isNotEmpty(anmodel.getGongGaoType())) {
2815 2850 value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect()) + "," + GongJingEnums.getHengZhiNameById(anmodel.getGongGaoType());
2816 2851 } else {
2817 2852 value = GongJingEnums.getGongGaoNameById(anmodel.getGongGaoSelect());
2818 2853 }
2819   - } else if (StringUtils.isNotEmpty(anmodel.getGongGao())) {
  2854 + }
  2855 + else if (StringUtils.isNotEmpty(anmodel.getGongGao()))
  2856 + {
2820 2857 value = anmodel.getGongGao();
2821 2858 }
2822 2859  
2823 2860 item.put("value", value);
2824 2861 item.put("time", DateUtil.getyyyy_MM_dd(anmodel.getCheckDate()));
2825   - if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches())) {
  2862 + if (StringUtils.isNotEmpty(anmodel.getGongGao()) && (StringUtils.isNumeric(anmodel.getGongGao()) || Pattern.compile("^[-\\+]?[.\\d]*$").matcher(anmodel.getGongGao()).matches()))
  2863 + {
2826 2864 titles.add(DateUtil.getyyyy_MM_dd(anmodel.getCheckDate()));
2827 2865 values.add(anmodel.getGongGao());
2828 2866 }