Commit 23bce14cb22661c2c86c2f2cd548c195f9971d15
1 parent
5dd3e6d763
Exists in
master
and in
8 other branches
增加是否通知
Showing 2 changed files with 41 additions and 18 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java
View file @
23bce14
... | ... | @@ -48,7 +48,16 @@ |
48 | 48 | @TokenRequired |
49 | 49 | public BaseResponse addReferralApplyOrder(@Valid @RequestBody ReferralApplyOrderAddRequest applyOrderAddRequest,HttpServletRequest request) { |
50 | 50 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
51 | - return applyOrderFacade.addOneReferralApplyOrder(applyOrderAddRequest, loginState.getId()); | |
51 | + return applyOrderFacade.addOneReferralApplyOrder(applyOrderAddRequest, loginState.getId(),2); | |
52 | + } | |
53 | + | |
54 | + //增加转诊申请单 | |
55 | + @RequestMapping(method = RequestMethod.POST,value = "/referrbapply") | |
56 | + @ResponseBody | |
57 | + @TokenRequired | |
58 | + public BaseResponse addReferralBaApplyOrder(@Valid @RequestBody ReferralApplyOrderAddRequest applyOrderAddRequest,HttpServletRequest request) { | |
59 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
60 | + return applyOrderFacade.addOneReferralApplyOrder(applyOrderAddRequest, loginState.getId(),1); | |
52 | 61 | } |
53 | 62 | |
54 | 63 | @RequestMapping(method = RequestMethod.POST,value = "/sieveapply") |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
View file @
23bce14
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.ApplyOrderService; |
4 | +import com.lyms.platform.biz.service.BabyService; | |
4 | 5 | import com.lyms.platform.biz.service.PatientsService; |
5 | 6 | import com.lyms.platform.biz.service.SieveService; |
6 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
... | ... | @@ -18,10 +19,7 @@ |
18 | 19 | import com.lyms.platform.operate.web.result.SieveApplyOrderResult; |
19 | 20 | import com.lyms.platform.permission.model.Organization; |
20 | 21 | import com.lyms.platform.permission.service.OrganizationService; |
21 | -import com.lyms.platform.pojo.Patients; | |
22 | -import com.lyms.platform.pojo.ReferralApplyOrderModel; | |
23 | -import com.lyms.platform.pojo.SieveApplyOrderModel; | |
24 | -import com.lyms.platform.pojo.SieveModel; | |
22 | +import com.lyms.platform.pojo.*; | |
25 | 23 | import com.lyms.platform.query.PatientsQuery; |
26 | 24 | import com.lyms.platform.query.ReferralApplyOrderQuery; |
27 | 25 | import com.lyms.platform.query.SieveApplyOrderQuery; |
28 | 26 | |
29 | 27 | |
30 | 28 | |
31 | 29 | |
32 | 30 | |
33 | 31 | |
... | ... | @@ -50,34 +48,50 @@ |
50 | 48 | private SieveService sieveService; |
51 | 49 | @Autowired |
52 | 50 | private OrganizationService organizationService; |
51 | + @Autowired | |
52 | + private BabyService babyService; | |
53 | 53 | |
54 | 54 | /** |
55 | 55 | * 增加转诊申请 |
56 | 56 | * |
57 | 57 | * @param referralApplyOrderAddRequest |
58 | + * @param type 2 孕妇 1 儿童 | |
58 | 59 | * @return |
59 | 60 | */ |
60 | - public BaseResponse addOneReferralApplyOrder(ReferralApplyOrderAddRequest referralApplyOrderAddRequest, Integer userId) { | |
61 | + public BaseResponse addOneReferralApplyOrder(ReferralApplyOrderAddRequest referralApplyOrderAddRequest, Integer userId,Integer type) { | |
61 | 62 | ReferralApplyOrderModel referralApplyOrderModel = referralApplyOrderAddRequest.convertToDataModel(); |
62 | 63 | referralApplyOrderModel.setCreated(new Date()); |
63 | 64 | referralApplyOrderModel.setStatus(0); |
64 | 65 | PatientsQuery patientsQuery = new PatientsQuery(); |
65 | 66 | patientsQuery.setId(referralApplyOrderModel.getParentId()); |
66 | - //查询产妇信息 | |
67 | - List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
68 | - Patients patients = null; | |
69 | - if (CollectionUtils.isNotEmpty(patientses)) { | |
70 | - patients = patientses.get(0); | |
71 | - } | |
67 | + if(2==type){ | |
68 | + //查询产妇信息 | |
69 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
70 | + Patients patients = null; | |
71 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
72 | + patients = patientses.get(0); | |
73 | + } | |
72 | 74 | |
73 | - if (null != patients) { | |
74 | - referralApplyOrderModel.setCardNo(patients.getCardNo()); | |
75 | - referralApplyOrderModel.setAge(patients.getAge()); | |
76 | - referralApplyOrderModel.setDueDate(patients.getDueDate()); | |
77 | - referralApplyOrderModel.setName(patients.getUsername()); | |
75 | + if (null != patients) { | |
76 | + referralApplyOrderModel.setCardNo(patients.getCardNo()); | |
77 | + referralApplyOrderModel.setAge(patients.getAge()); | |
78 | + referralApplyOrderModel.setDueDate(patients.getDueDate()); | |
79 | + referralApplyOrderModel.setName(patients.getUsername()); | |
80 | + } | |
81 | + }else{ | |
82 | + BabyModel babyModel= babyService.getOneBabyById(referralApplyOrderModel.getParentId()); | |
83 | + if(null!=babyModel){ | |
84 | + referralApplyOrderModel.setCardNo(babyModel.getCardNo()); | |
85 | + if(null!=babyModel.getBirth()){ | |
86 | + referralApplyOrderModel.setAge(DateUtil.getAge(babyModel.getBirth())); | |
87 | + } | |
88 | + referralApplyOrderModel.setDueDate(babyModel.getDueDate()); | |
89 | + referralApplyOrderModel.setName(babyModel.getName()); | |
90 | + } | |
78 | 91 | } |
92 | + | |
79 | 93 | //孕妇 |
80 | - referralApplyOrderModel.setType(2); | |
94 | + referralApplyOrderModel.setType(type); | |
81 | 95 | List<Integer> areaId = autoMatchFacade.matchOrgId(userId); |
82 | 96 | referralApplyOrderModel.setOutHospitalId(areaId.get(0) + ""); |
83 | 97 | applyOrderService.addOneReferralApplyOrder(referralApplyOrderModel); |