Commit f001808528a34834237a4f91f685e7aaf9a3d456
1 parent
560a519c08
Exists in
master
and in
6 other branches
儿童服务开通
Showing 1 changed file with 65 additions and 62 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
f001808
... | ... | @@ -87,9 +87,9 @@ |
87 | 87 | hscQuery.setStatus(1); |
88 | 88 | |
89 | 89 | List<HospitalServiceContent> hospitalServiceContents = hospitalServiceContentService.queryHospitalServiceContent(hscQuery); |
90 | - Map<String,HospitalServiceContent> hscMap = new HashMap<>(); | |
91 | - for(HospitalServiceContent hsc:hospitalServiceContents){ | |
92 | - hscMap.put(hsc.getId(),hsc); | |
90 | + Map<String, HospitalServiceContent> hscMap = new HashMap<>(); | |
91 | + for (HospitalServiceContent hsc : hospitalServiceContents) { | |
92 | + hscMap.put(hsc.getId(), hsc); | |
93 | 93 | } |
94 | 94 | HospitalDoctServiceQuery hospitalDoctServiceQuery = new HospitalDoctServiceQuery(); |
95 | 95 | //状态 1--有效 |
96 | 96 | |
97 | 97 | |
... | ... | @@ -97,14 +97,14 @@ |
97 | 97 | hospitalDoctServiceQuery.setHospId(hospitalId); |
98 | 98 | List<HospitalDoctService> hospitalDoctServiceList = hospitalDoctService.queryHospitalDoctService(hospitalDoctServiceQuery); |
99 | 99 | //给医院服务加入医生的服务价格信息 |
100 | - for(HospitalDoctService hds:hospitalDoctServiceList){ | |
100 | + for (HospitalDoctService hds : hospitalDoctServiceList) { | |
101 | 101 | HospitalServiceContent hsc = hscMap.get(hds.getHospServiceId()); |
102 | - if(hsc!=null){ | |
102 | + if (hsc != null) { | |
103 | 103 | hsc.getDoctIds().add(hds.getDoctId()); |
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
107 | - map.put("hospSer",hospitalServiceContents); | |
107 | + map.put("hospSer", hospitalServiceContents); | |
108 | 108 | |
109 | 109 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(map); |
110 | 110 | } |
111 | 111 | |
... | ... | @@ -120,9 +120,9 @@ |
120 | 120 | |
121 | 121 | //查询档案信息 |
122 | 122 | Patients patients = patientsService.findOnePatientById(pid); |
123 | - if(patients!=null){ | |
123 | + if (patients != null) { | |
124 | 124 | //如果有数据源id,取主档案id |
125 | - if(StringUtils.isNotEmpty(patients.getSource())){ | |
125 | + if (StringUtils.isNotEmpty(patients.getSource())) { | |
126 | 126 | pid = patients.getSource(); |
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | 130 | |
131 | 131 | |
... | ... | @@ -195,21 +195,21 @@ |
195 | 195 | pser.setParentid(ps.getParentid()); |
196 | 196 | //设置服务对象类型 服务人类型(1-孕妇、2-儿童) |
197 | 197 | pser.setPerType(ps.getPerType()); |
198 | - if(ps.getPerType()!=null && ps.getPerType()==2){//儿童 | |
198 | + if (ps.getPerType() != null && ps.getPerType() == 2) {//儿童 | |
199 | 199 | BabyModel babyModel = babyService.getOneBabyById(ps.getParentid()); |
200 | 200 | if (babyModel != null) { |
201 | 201 | pser.setPid(babyModel.getPid()); |
202 | 202 | //如果有数据源id,取主档案id |
203 | - if(StringUtils.isNotEmpty(babyModel.getSource())){ | |
203 | + if (StringUtils.isNotEmpty(babyModel.getSource())) { | |
204 | 204 | pser.setParentid(babyModel.getSource()); |
205 | 205 | } |
206 | 206 | } |
207 | - }else{ | |
207 | + } else { | |
208 | 208 | Patients patients = patientsService.findOnePatientById(ps.getParentid()); |
209 | 209 | if (patients != null) { |
210 | 210 | pser.setPid(patients.getPid()); |
211 | 211 | //如果有数据源id,取主档案id |
212 | - if(StringUtils.isNotEmpty(patients.getSource())){ | |
212 | + if (StringUtils.isNotEmpty(patients.getSource())) { | |
213 | 213 | pser.setParentid(patients.getSource()); |
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
217 | 217 | |
... | ... | @@ -242,14 +242,14 @@ |
242 | 242 | |
243 | 243 | operateLogFacade.addAddOptLog(userId, Integer.valueOf(hospitalId), pser, OptActionEnums.ADD.getId(), "开通增值服务"); |
244 | 244 | |
245 | - if(ps.getPerType()!=null&&ps.getPerType() == 2){//儿童建档服务数据处理 | |
245 | + if (ps.getPerType() != null && ps.getPerType() == 2) {//儿童建档服务数据处理 | |
246 | 246 | |
247 | - }else{//孕妇建档服务数据处理 | |
248 | - if(PatientSerEnums.SerTypeEnums.yqjzzd.getId() == Integer.parseInt(serInfo.get("serType"))){//孕期精准指导同步到建档 | |
247 | + } else {//孕妇建档服务数据处理 | |
248 | + if (PatientSerEnums.SerTypeEnums.yqjzzd.getId() == Integer.parseInt(serInfo.get("serType"))) {//孕期精准指导同步到建档 | |
249 | 249 | YunBookbuildingAddRequest yunBookbuildingAddRequest = new YunBookbuildingAddRequest(); |
250 | 250 | yunBookbuildingAddRequest.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId()); |
251 | 251 | yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId()); |
252 | - bookbuildingFacade.updatePregnantById(ps.getParentid(),yunBookbuildingAddRequest, userId); | |
252 | + bookbuildingFacade.updatePregnantById(ps.getParentid(), yunBookbuildingAddRequest, userId); | |
253 | 253 | } |
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
257 | 257 | |
258 | 258 | |
... | ... | @@ -281,27 +281,30 @@ |
281 | 281 | //开通人为上一次的数据,因为系统端不能修改,但是小程序可以修改 |
282 | 282 | ps.setCreateUser(before.getCreateUser()); |
283 | 283 | |
284 | - if(before.getSerStatus()==PatientSerEnums.SerStatusEnums.td.getId()){//如果上一次是退订状态,重新开通,开通时间为当前时间 | |
284 | + if (before.getSerStatus() == PatientSerEnums.SerStatusEnums.td.getId()) {//如果上一次是退订状态,重新开通,开通时间为当前时间 | |
285 | 285 | ps.setCreateDate(new Date()); |
286 | 286 | } |
287 | 287 | |
288 | 288 | patientServiceService.updatePatientService(ps); |
289 | 289 | |
290 | - if(PatientSerEnums.SerTypeEnums.yqjzzd.getId() == ps.getSerType()){//孕期精准指导同步到建档 | |
291 | - YunBookbuildingAddRequest yunBookbuildingAddRequest = new YunBookbuildingAddRequest(); | |
292 | - yunBookbuildingAddRequest.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId()); | |
293 | - if(ps.getSerStatus() == PatientSerEnums.SerStatusEnums.kt.getId()){ | |
294 | - yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId()); | |
295 | - }else if(ps.getSerStatus() == PatientSerEnums.SerStatusEnums.td.getId()){ | |
296 | - yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.UNSUBSCRIBE.getId()); | |
297 | - }else if(ps.getSerStatus() == PatientSerEnums.SerStatusEnums.gq.getId()){ | |
298 | - yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OVERDUE.getId()); | |
299 | - }else if(ps.getSerStatus() == PatientSerEnums.SerStatusEnums.zt.getId()){ | |
300 | - yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.SUSPEND.getId()); | |
290 | + if (before.getPerType() != null && before.getPerType() == 2) {//儿童建档服务数据处理 | |
291 | + | |
292 | + } else {//孕妇建档服务数据处理 | |
293 | + if (PatientSerEnums.SerTypeEnums.yqjzzd.getId() == ps.getSerType()) {//孕期精准指导同步到建档 | |
294 | + YunBookbuildingAddRequest yunBookbuildingAddRequest = new YunBookbuildingAddRequest(); | |
295 | + yunBookbuildingAddRequest.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId()); | |
296 | + if (ps.getSerStatus() == PatientSerEnums.SerStatusEnums.kt.getId()) { | |
297 | + yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OPEN.getId()); | |
298 | + } else if (ps.getSerStatus() == PatientSerEnums.SerStatusEnums.td.getId()) { | |
299 | + yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.UNSUBSCRIBE.getId()); | |
300 | + } else if (ps.getSerStatus() == PatientSerEnums.SerStatusEnums.gq.getId()) { | |
301 | + yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.ADD_OVERDUE.getId()); | |
302 | + } else if (ps.getSerStatus() == PatientSerEnums.SerStatusEnums.zt.getId()) { | |
303 | + yunBookbuildingAddRequest.setServiceStatus(ServiceStatusEnums.SUSPEND.getId()); | |
304 | + } | |
305 | + bookbuildingFacade.updatePregnantById(ps.getParentid(), yunBookbuildingAddRequest, userId); | |
301 | 306 | } |
302 | - bookbuildingFacade.updatePregnantById(ps.getParentid(),yunBookbuildingAddRequest, userId); | |
303 | 307 | } |
304 | - | |
305 | 308 | PatientService after = patientServiceService.getPatientService(ps.getId()); |
306 | 309 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), before, after, OptActionEnums.UPDATE.getId(), "修复服务"); |
307 | 310 | BaseResponse baseResponse = new BaseResponse(); |
... | ... | @@ -356,7 +359,7 @@ |
356 | 359 | } catch (Exception e) { |
357 | 360 | result.setUpdateUser("产检医生"); |
358 | 361 | } |
359 | - }else { | |
362 | + } else { | |
360 | 363 | result.setUpdateUser("小程序开通"); |
361 | 364 | } |
362 | 365 | result.setParentid(ps.getParentid()); |
... | ... | @@ -566,7 +569,7 @@ |
566 | 569 | BaseListResponse baseResponse = new BaseListResponse(); |
567 | 570 | try { |
568 | 571 | JSONObject formDataJson = JSONObject.fromObject(formData); |
569 | - BasePageQueryRequest pageInfo = (BasePageQueryRequest) JSONObject.toBean(formDataJson,BasePageQueryRequest.class); | |
572 | + BasePageQueryRequest pageInfo = (BasePageQueryRequest) JSONObject.toBean(formDataJson, BasePageQueryRequest.class); | |
570 | 573 | PatientServiceQuery patientQuery = new PatientServiceQuery(); |
571 | 574 | patientQuery.setSynStatus(1); |
572 | 575 | patientQuery.setSort("create_date"); |
573 | 576 | |
... | ... | @@ -581,12 +584,12 @@ |
581 | 584 | for (PatientService ps : patientServices) { |
582 | 585 | JSONObject jsonObject = new JSONObject(); |
583 | 586 | jsonObject.put("id", ps.getId()); |
584 | - jsonObject.put("orderId", ps.getOrderId()==null?"":ps.getOrderId()); | |
587 | + jsonObject.put("orderId", ps.getOrderId() == null ? "" : ps.getOrderId()); | |
585 | 588 | jsonObject.put("parentid", ps.getParentid()); |
586 | 589 | jsonObject.put("pid", ps.getPid()); |
587 | 590 | jsonObject.put("serType", ps.getSerType()); |
588 | 591 | //指定医生 |
589 | - jsonObject.put("serDoct", ps.getSerDoct()==null?"":ps.getSerDoct()); | |
592 | + jsonObject.put("serDoct", ps.getSerDoct() == null ? "" : ps.getSerDoct()); | |
590 | 593 | //服务状态 |
591 | 594 | jsonObject.put("serStatus", ps.getSerStatus()); |
592 | 595 | jsonObject.put("hospitalId", ps.getHospitalId()); |
... | ... | @@ -657,6 +660,7 @@ |
657 | 660 | baseResponse.setErrormsg("成功"); |
658 | 661 | return baseResponse; |
659 | 662 | } |
663 | + | |
660 | 664 | /** |
661 | 665 | * 修改医院价格同步状态 |
662 | 666 | * |
663 | 667 | |
664 | 668 | |
665 | 669 | |
... | ... | @@ -682,25 +686,24 @@ |
682 | 686 | } |
683 | 687 | |
684 | 688 | |
685 | - | |
686 | 689 | /** |
687 | 690 | * 同步医院医生服务价格配置 |
688 | 691 | * |
689 | 692 | * @return |
690 | 693 | */ |
691 | - public BaseResponse syncHospitalService(){ | |
694 | + public BaseResponse syncHospitalService() { | |
692 | 695 | HospitalServiceContentQuery hospitalServiceContentQuery = new HospitalServiceContentQuery(); |
693 | 696 | hospitalServiceContentQuery.setStatus(1); |
694 | 697 | hospitalServiceContentQuery.setSyncStatus(0); |
695 | 698 | hospitalServiceContentQuery.setPage(1); |
696 | 699 | hospitalServiceContentQuery.setLimit(10); |
697 | 700 | //查询未同步的数据 |
698 | - List<HospitalServiceContent> hospitalServiceContents= hospitalServiceContentService.queryHospitalServiceContent(hospitalServiceContentQuery); | |
699 | - List hospitalService=new ArrayList(); | |
700 | - List hospitalDoctService=new ArrayList(); | |
701 | + List<HospitalServiceContent> hospitalServiceContents = hospitalServiceContentService.queryHospitalServiceContent(hospitalServiceContentQuery); | |
702 | + List hospitalService = new ArrayList(); | |
703 | + List hospitalDoctService = new ArrayList(); | |
701 | 704 | //判断是否有数据 |
702 | - if(CollectionUtils.isNotEmpty(hospitalServiceContents)){ | |
703 | - for(HospitalServiceContent hospitalServiceContent:hospitalServiceContents){ | |
705 | + if (CollectionUtils.isNotEmpty(hospitalServiceContents)) { | |
706 | + for (HospitalServiceContent hospitalServiceContent : hospitalServiceContents) { | |
704 | 707 | hospitalService.add(convert(hospitalServiceContent)); |
705 | 708 | } |
706 | 709 | } |
707 | 710 | |
708 | 711 | |
... | ... | @@ -711,17 +714,17 @@ |
711 | 714 | hospitalDoctServiceQuery.setStatus(1); |
712 | 715 | hospitalDoctServiceQuery.setSyncStatus(0); |
713 | 716 | |
714 | - List<HospitalDoctService> hospitalDoctServices=hospitalDoctServiceService.queryHospitalDoctService(hospitalDoctServiceQuery); | |
717 | + List<HospitalDoctService> hospitalDoctServices = hospitalDoctServiceService.queryHospitalDoctService(hospitalDoctServiceQuery); | |
715 | 718 | //判断是否有数据 |
716 | - if(CollectionUtils.isNotEmpty(hospitalDoctServices)) { | |
717 | - for(HospitalDoctService hospitalServiceContent:hospitalDoctServices){ | |
719 | + if (CollectionUtils.isNotEmpty(hospitalDoctServices)) { | |
720 | + for (HospitalDoctService hospitalServiceContent : hospitalDoctServices) { | |
718 | 721 | hospitalDoctService.add(convert(hospitalServiceContent)); |
719 | 722 | } |
720 | 723 | } |
721 | 724 | |
722 | 725 | Map map1 = new HashMap(); |
723 | - map1.put("hospitalDoctService",hospitalDoctService); | |
724 | - map1.put("hospitalService",hospitalService); | |
726 | + map1.put("hospitalDoctService", hospitalDoctService); | |
727 | + map1.put("hospitalService", hospitalService); | |
725 | 728 | |
726 | 729 | BaseObjectResponse baseObjectResponse = new BaseObjectResponse(); |
727 | 730 | baseObjectResponse.setData(map1); |
728 | 731 | |
... | ... | @@ -730,25 +733,25 @@ |
730 | 733 | return baseObjectResponse; |
731 | 734 | } |
732 | 735 | |
733 | - private Map convert(HospitalServiceContent serviceContent){ | |
734 | - Map map =new HashMap(); | |
735 | - map.put("create_date",serviceContent.getCreateDate().getTime()); | |
736 | - map.put("hospital_id",serviceContent.getHospitalId()); | |
737 | - map.put("id",serviceContent.getId()); | |
738 | - map.put("ser_price",serviceContent.getSerPrice()); | |
739 | - map.put("ser_type",serviceContent.getSerType()); | |
740 | - map.put("status",serviceContent.getStatus()); | |
736 | + private Map convert(HospitalServiceContent serviceContent) { | |
737 | + Map map = new HashMap(); | |
738 | + map.put("create_date", serviceContent.getCreateDate().getTime()); | |
739 | + map.put("hospital_id", serviceContent.getHospitalId()); | |
740 | + map.put("id", serviceContent.getId()); | |
741 | + map.put("ser_price", serviceContent.getSerPrice()); | |
742 | + map.put("ser_type", serviceContent.getSerType()); | |
743 | + map.put("status", serviceContent.getStatus()); | |
741 | 744 | return map; |
742 | 745 | } |
743 | 746 | |
744 | - private Map convert(HospitalDoctService hospitalDoctService){ | |
745 | - Map map =new HashMap(); | |
746 | - map.put("doct_id",hospitalDoctService.getDoctId()); | |
747 | - map.put("doct_price",hospitalDoctService.getDoctPrice()); | |
748 | - map.put("id",hospitalDoctService.getId()); | |
749 | - map.put("hosp_id",hospitalDoctService.getHospId()); | |
750 | - map.put("hosp_service_id",hospitalDoctService.getHospServiceId()); | |
751 | - map.put("status",hospitalDoctService.getStatus()); | |
747 | + private Map convert(HospitalDoctService hospitalDoctService) { | |
748 | + Map map = new HashMap(); | |
749 | + map.put("doct_id", hospitalDoctService.getDoctId()); | |
750 | + map.put("doct_price", hospitalDoctService.getDoctPrice()); | |
751 | + map.put("id", hospitalDoctService.getId()); | |
752 | + map.put("hosp_id", hospitalDoctService.getHospId()); | |
753 | + map.put("hosp_service_id", hospitalDoctService.getHospServiceId()); | |
754 | + map.put("status", hospitalDoctService.getStatus()); | |
752 | 755 | return map; |
753 | 756 | } |
754 | 757 |