From f89c2ad36f6c0533593edfb65f2b78a2ab5d6fb7 Mon Sep 17 00:00:00 2001 From: zhangchao Date: Tue, 7 May 2024 14:40:22 +0800 Subject: [PATCH] =?UTF-8?q?#fix:=E4=BC=98=E5=8C=96=E5=8C=BB=E4=BF=A1?= =?UTF-8?q?=E7=85=A7=E6=8A=A4his=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=EF=BC=8C=E6=A0=B9=E6=8D=AE=E4=BA=A7=E5=A6=87=E3=80=81=E5=AD=95?= =?UTF-8?q?=E5=A6=87=E7=B1=BB=E5=9E=8B=E8=87=AA=E5=8A=A8=E5=BC=80=E9=80=9A?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=9C=8D=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/PatientServiceController.java | 111 +++++++++++++-------- 1 file changed, 67 insertions(+), 44 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java index c256232..00fd9e4 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java @@ -164,62 +164,85 @@ public class PatientServiceController extends BaseController { String bookbuildingDoctor = patients.getBookbuildingDoctor(); //续期,增加 if(yxzhVO.getRenew() == 1){ + //1孕妇 2儿童 3 产妇 PatientServiceQuery patientServiceQuery = new PatientServiceQuery(); - patientServiceQuery.setParentid(patients.getId()); - patientServiceQuery.setPerType(1); - patientServiceQuery.setSerType(1); - List patientServices = patientServiceService.queryPatientService(patientServiceQuery); - if(CollectionUtils.isNotEmpty(patientServices)){ - PatientService patientService = patientServices.get(0); - PatientService ps = new PatientService(); - - ps.setId(patientService.getId()); - ps.setParentid(patientService.getParentid()); - ps.setSerStatus(1); - ps.setServiceWeek(yxzhVO.getWeeks()); - ps.setSerType(1); - patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); - + List patientServices=new ArrayList<>(); + if (patients.getType()==1){ + patientServiceQuery.setParentid(patients.getId()); + patientServiceQuery.setPerType(1); + patientServiceQuery.setSerType(1); + patientServices = patientServiceService.queryPatientService(patientServiceQuery); + if(CollectionUtils.isNotEmpty(patientServices)){ + PatientService patientService = patientServices.get(0); + PatientService ps = new PatientService(); + ps.setId(patientService.getId()); + ps.setParentid(patientService.getParentid()); + ps.setSerStatus(1); + ps.setServiceWeek(yxzhVO.getWeeks()); + ps.setSerType(1); + patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); + + } + patientServiceQuery.setSerType(6); + patientServices = patientServiceService.queryPatientService(patientServiceQuery); + if(CollectionUtils.isNotEmpty(patientServices)){ + PatientService patientService = patientServices.get(0); + PatientService ps = new PatientService(); + ps.setId(patientService.getId()); + ps.setParentid(patientService.getParentid()); + ps.setSerStatus(1); + ps.setServiceWeek(yxzhVO.getWeeks()); + ps.setSerType(6); + baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); + + } + }else if (patients.getType()==3){ + patientServiceQuery.setPerType(3); + patientServiceQuery.setSerType(20); + patientServices = patientServiceService.queryPatientService(patientServiceQuery); + if(CollectionUtils.isNotEmpty(patientServices)){ + PatientService patientService = patientServices.get(0); + PatientService ps = new PatientService(); + ps.setId(patientService.getId()); + ps.setParentid(patientService.getParentid()); + ps.setSerStatus(1); + ps.setServiceWeek(yxzhVO.getWeeks()); + ps.setSerType(20); + baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); + + } } - patientServiceQuery.setSerType(6); - patientServices = patientServiceService.queryPatientService(patientServiceQuery); - if(CollectionUtils.isNotEmpty(patientServices)){ - PatientService patientService = patientServices.get(0); - PatientService ps = new PatientService(); - - ps.setId(patientService.getId()); - ps.setParentid(patientService.getParentid()); - ps.setSerStatus(1); - ps.setServiceWeek(yxzhVO.getWeeks()); - ps.setSerType(6); - baseResponse = patientServiceFacade.updatePatientService(ps,Integer.valueOf(bookbuildingDoctor)); - - } - return baseResponse; }else{ - + List> list = new ArrayList<>(); PatientService ps = new PatientService(); ps.setSerStatus(1); - ps.setPerType(1); ps.setParentid(patients.getId()); ps.setCreateUser(bookbuildingDoctor); ps.setCreateDate(new Date()); - - List> list = new ArrayList<>(); - Map m1 = new HashMap<>(); - m1.put("serType","1"); - m1.put("serviceWeek",yxzhVO.getWeeks()+""); - Map m2 = new HashMap<>(); - m2.put("serType","6"); - m2.put("serviceWeek",yxzhVO.getWeeks()+""); - list.add(m1); - list.add(m2); + //1孕妇 2儿童 3 产妇 + if (patients.getType()==1){ + //开通围产、精准服务 + ps.setPerType(1); + Map m1 = new HashMap<>(); + m1.put("serType","1"); + m1.put("serviceWeek",yxzhVO.getWeeks()+""); + Map m2 = new HashMap<>(); + m2.put("serType","6"); + m2.put("serviceWeek",yxzhVO.getWeeks()+""); + list.add(m1); + list.add(m2); + }else if (patients.getType()==3){ + //开通产后康复服务 + ps.setPerType(3); + Map m3 = new HashMap<>(); + m3.put("serType","20"); + m3.put("serviceWeek",yxzhVO.getWeeks()+""); + list.add(m3); + } ps.setSerInfos(list); return patientServiceFacade.addPatientService(ps, Integer.valueOf(bookbuildingDoctor),hospitalId); } - - }catch (Exception e){ e.printStackTrace(); baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); -- 1.8.3.1