Commit bf875e3bdd1b95c605e2d41af323033278b93f1b
1 parent
4fc95c4c00
Exists in
master
and in
6 other branches
儿童自动建档时,同时自动开通标准服务
Showing 6 changed files with 41 additions and 12 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/HosptialHighRiskFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
bf875e3
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
9 | 9 | import com.lyms.platform.common.utils.StringUtils; |
10 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
10 | 11 | import com.lyms.platform.operate.web.facade.PatientServiceFacade; |
11 | 12 | import com.lyms.platform.operate.web.request.BasePageQueryRequest; |
12 | 13 | import com.lyms.platform.permission.model.PatientService; |
... | ... | @@ -27,6 +28,8 @@ |
27 | 28 | |
28 | 29 | @Autowired |
29 | 30 | private PatientServiceFacade patientServiceFacade; |
31 | + @Autowired | |
32 | + private AutoMatchFacade autoMatchFacade; | |
30 | 33 | |
31 | 34 | /** |
32 | 35 | * 初始化接口 |
... | ... | @@ -99,7 +102,9 @@ |
99 | 102 | if (baseResponse.getErrorcode() != ErrorCodeConstants.SUCCESS) { |
100 | 103 | return baseResponse; |
101 | 104 | } |
102 | - return patientServiceFacade.addPatientService(ps, loginState.getId()); | |
105 | + //根据用户id获取医院ID | |
106 | + String hospitalId = autoMatchFacade.getHospitalId(loginState.getId()); | |
107 | + return patientServiceFacade.addPatientService(ps, loginState.getId(),hospitalId); | |
103 | 108 | } else { |
104 | 109 | return patientServiceFacade.updatePatientService(ps, loginState.getId()); |
105 | 110 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
bf875e3
... | ... | @@ -722,7 +722,7 @@ |
722 | 722 | patientService.setParentid(model.getId()); |
723 | 723 | patientService.setPid(model.getPid()); |
724 | 724 | try { |
725 | - patientServiceFacade.addPatientService(patientService, userId); | |
725 | + patientServiceFacade.addPatientService(patientService, userId,request.getHospitalId()); | |
726 | 726 | } catch (Exception e) { |
727 | 727 | System.out.println("儿童建档服务开通异常!"); |
728 | 728 | e.printStackTrace(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
bf875e3
... | ... | @@ -344,7 +344,7 @@ |
344 | 344 | patientService.setCreateDate(DateUtil.parseYMD(yunRequest.getBookbuildingDate())); |
345 | 345 | patientService.setParentid(p.getId()); |
346 | 346 | try { |
347 | - patientServiceFacade.addPatientService(patientService, userId); | |
347 | + patientServiceFacade.addPatientService(patientService, userId,yunRequest.getHospitalId()); | |
348 | 348 | } catch (Exception e) { |
349 | 349 | System.out.println("孕妇建档服务开通异常!"); |
350 | 350 | e.printStackTrace(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/HosptialHighRiskFacade.java
View file @
bf875e3
... | ... | @@ -71,7 +71,6 @@ |
71 | 71 | */ |
72 | 72 | public BaseResponse addHosptialHighRisk(HosptialHighRisk hosptialHighRisk, int userId) { |
73 | 73 | |
74 | - | |
75 | 74 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
76 | 75 | HosptialHighRiskQuery hosptialHighRiskQuery = new HosptialHighRiskQuery(); |
77 | 76 | hosptialHighRiskQuery.setHospitalId(hospitalId); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
bf875e3
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
16 | 16 | import com.lyms.platform.permission.model.Organization; |
17 | 17 | import com.lyms.platform.permission.model.OrganizationQuery; |
18 | +import com.lyms.platform.permission.model.PatientService; | |
18 | 19 | import com.lyms.platform.permission.model.Users; |
19 | 20 | import com.lyms.platform.permission.service.CouponService; |
20 | 21 | import com.lyms.platform.permission.service.OrganizationService; |
21 | 22 | |
... | ... | @@ -95,7 +96,10 @@ |
95 | 96 | @Autowired |
96 | 97 | private OperateLogFacade operateLogFacade; |
97 | 98 | |
99 | + @Autowired | |
100 | + private PatientServiceFacade patientServiceFacade; | |
98 | 101 | |
102 | + | |
99 | 103 | private static Map<Integer, String> ONE_ENUMS = new HashMap<>(); |
100 | 104 | |
101 | 105 | private static Map<String, List> babyMap = new HashMap<>(); |
... | ... | @@ -434,8 +438,8 @@ |
434 | 438 | babyModel.setDueDate(patients.getDueDate()); |
435 | 439 | babyModel.setDueType(patients.getDueType()); |
436 | 440 | babyModel.setBuildDoctor("a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29"); |
437 | - babyModel.setServiceStatus(patients.getServiceStatus()); | |
438 | - babyModel.setServiceType(patients.getServiceType()); | |
441 | + babyModel.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); | |
442 | + babyModel.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); | |
439 | 443 | babyModel.setCreated(new Date()); |
440 | 444 | babyModel.setModified(new Date()); |
441 | 445 | if (null != deliverAddRequest.getDueDate()) { |
442 | 446 | |
... | ... | @@ -647,13 +651,37 @@ |
647 | 651 | } |
648 | 652 | babyIds.add(babyService.addOneBaby(babyModel).getId()); |
649 | 653 | baby1.setId(babyModel.getId()); |
654 | + | |
655 | + //儿童分娩自动建档开通增值服务 | |
656 | + if (babyModel.getServiceType()!=null) { | |
657 | + PatientService patientService = new PatientService(); | |
658 | + patientService.setPerType(2); | |
659 | + List<Map<String, String>> serInfos = new ArrayList<>(); | |
660 | + Map<String, String> serMap = new HashMap<>(); | |
661 | + serMap.put("serType",String.valueOf(PatientSerEnums.SerTypeEnums.babyBzfw.getId())); | |
662 | + serInfos.add(serMap); | |
663 | + patientService.setSerInfos(serInfos); | |
664 | + patientService.setCreateUser(String.valueOf("a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29")); | |
665 | + //开通日期与建档日期一致 | |
666 | + patientService.setCreateDate(new Date()); | |
667 | + patientService.setParentid(babyModel.getId()); | |
668 | + patientService.setPid(babyModel.getPid()); | |
669 | + try { | |
670 | + patientServiceFacade.addPatientService(patientService, Integer.parseInt(patients.getBookbuildingDoctor()),babyModel.getHospitalId()); | |
671 | + } catch (Exception e) { | |
672 | + System.out.println("儿童建档服务开通异常!"); | |
673 | + e.printStackTrace(); | |
674 | + } | |
675 | + } | |
676 | + | |
677 | + | |
650 | 678 | if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { |
651 | 679 | ExceptionUtils.catchException("分娩---------->" + babyModel.getMphone() + ";name=" + babyModel.getName()); |
652 | 680 | //儿童建档 |
653 | 681 | // babyBookbuildingFacade.createBuildSms(babyModel); |
654 | 682 | babyBookbuildingFacade.createBuildMsg(babyModel); |
655 | - //业务推广短信 | |
656 | - babyBookbuildingFacade.createExtensionMsg(babyModel); | |
683 | + //业务推广短信,应为服务开通出会调用发送推广短信 | |
684 | + // babyBookbuildingFacade.createExtensionMsg(babyModel); | |
657 | 685 | } |
658 | 686 | |
659 | 687 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
bf875e3
... | ... | @@ -180,11 +180,8 @@ |
180 | 180 | * @param userId |
181 | 181 | * @return |
182 | 182 | */ |
183 | - public BaseResponse addPatientService(PatientService ps, Integer userId) throws Exception { | |
184 | - //根据用户id获取医院ID | |
185 | - String hospitalId = autoMatchFacade.getHospitalId(userId); | |
183 | + public BaseResponse addPatientService(PatientService ps, Integer userId,String hospitalId) throws Exception { | |
186 | 184 | List<Map<String, String>> serInfos = ps.getSerInfos(); |
187 | - | |
188 | 185 | for (Map<String, String> serInfo : serInfos) { |
189 | 186 | //先根据孕妇id和开通服务类型、开通医生进行查询,如果已经开通过则开通失败 |
190 | 187 | PatientServiceQuery patientQuery = new PatientServiceQuery(); |