Commit 57deb29f38c228528399d5c3ca24bf515b14c4e8

Authored by yangfei
1 parent 75853c1304

服务同步

Showing 1 changed file with 21 additions and 6 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceSysFacade.java View file @ 57deb29
1 1 package com.lyms.platform.operate.web.facade;
2 2  
  3 +import com.lyms.platform.biz.service.BabyService;
3 4 import com.lyms.platform.biz.service.PatientsService;
4 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
5 6 import com.lyms.platform.common.enums.PatientSerEnums;
... ... @@ -8,6 +9,7 @@
8 9 import com.lyms.platform.permission.model.PatientService;
9 10 import com.lyms.platform.permission.model.PatientServiceQuery;
10 11 import com.lyms.platform.permission.service.PatientServiceService;
  12 +import com.lyms.platform.pojo.BabyModel;
11 13 import com.lyms.platform.pojo.Patients;
12 14 import net.sf.json.JSONArray;
13 15 import net.sf.json.JSONObject;
... ... @@ -30,6 +32,8 @@
30 32 private PatientServiceService patientServiceService;
31 33 @Autowired
32 34 private PatientsService patientsService;
  35 + @Autowired
  36 + private BabyService babyService;
33 37  
34 38 @Override
35 39 public BaseResponse execute(String synForm) {
... ... @@ -44,12 +48,23 @@
44 48 return baseResponse;
45 49 }
46 50  
47   - //查询档案信息
48   - Patients patients = patientsService.findOnePatientById(patientService.getParentid());
49   - if(patients!=null){
50   - //如果有数据源id,取主档案id
51   - if(StringUtils.isNotEmpty(patients.getSource())){
52   - patientService.setParentid(patients.getSource());
  51 + if (patientService.getPerType() != null && patientService.getPerType() == 2) {//儿童
  52 + BabyModel babyModel = babyService.getOneBabyById(patientService.getParentid());
  53 + if (babyModel != null) {
  54 + patientService.setPid(babyModel.getPid());
  55 + //如果有数据源id,取主档案id
  56 + if (StringUtils.isNotEmpty(babyModel.getSource())) {
  57 + patientService.setParentid(babyModel.getSource());
  58 + }
  59 + }
  60 + } else {
  61 + Patients patients = patientsService.findOnePatientById(patientService.getParentid());
  62 + if (patients != null) {
  63 + patientService.setPid(patients.getPid());
  64 + //如果有数据源id,取主档案id
  65 + if (StringUtils.isNotEmpty(patients.getSource())) {
  66 + patientService.setParentid(patients.getSource());
  67 + }
53 68 }
54 69 }
55 70