Commit 59a11ceaafc7a3723af28f90672fc6d1aebf91e3

Authored by jiangjiazhi
1 parent 2b35b538a4

孕妇分娩后 变成产妇

Showing 9 changed files with 84 additions and 14 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/SieveApplyOrderModel.java View file @ 59a11ce
... ... @@ -24,9 +24,18 @@
24 24 private String applyDoctor;
25 25 //标识是否同步过数据 0 表示未同步 1表示已同步
26 26 private Integer status;
  27 + private String hospitalId;
27 28 private Integer yn;
28 29  
29 30 private Date modified;
  31 +
  32 + public String getHospitalId() {
  33 + return hospitalId;
  34 + }
  35 +
  36 + public void setHospitalId(String hospitalId) {
  37 + this.hospitalId = hospitalId;
  38 + }
30 39  
31 40 public Date getModified() {
32 41 return modified;
platform-dal/src/main/java/com/lyms/platform/pojo/SieveModel.java View file @ 59a11ce
... ... @@ -16,6 +16,8 @@
16 16 private String id;
17 17 //患者id
18 18 private String parentId;
  19 +
  20 + private String hospitalId;
19 21 //姓名
20 22 private String name;
21 23 //末次月经
... ... @@ -47,6 +49,14 @@
47 49 private Date created;
48 50 private Date modified;
49 51 private Integer yn;
  52 +
  53 + public String getHospitalId() {
  54 + return hospitalId;
  55 + }
  56 +
  57 + public void setHospitalId(String hospitalId) {
  58 + this.hospitalId = hospitalId;
  59 + }
50 60  
51 61 public Integer getYn() {
52 62 return yn;
platform-dal/src/main/java/com/lyms/platform/query/SieveApplyOrderQuery.java View file @ 59a11ce
... ... @@ -18,7 +18,16 @@
18 18 private Integer yn;
19 19  
20 20 private String id;
  21 + private String hospitalId;
21 22  
  23 + public String getHospitalId() {
  24 + return hospitalId;
  25 + }
  26 +
  27 + public void setHospitalId(String hospitalId) {
  28 + this.hospitalId = hospitalId;
  29 + }
  30 +
22 31 public String getId() {
23 32 return id;
24 33 }
... ... @@ -48,6 +57,9 @@
48 57 MongoCondition condition = MongoCondition.newInstance();
49 58 if(null!=parentId){
50 59 condition= condition.and("parentId",parentId, MongoOper.IS);
  60 + }
  61 + if(null!=hospitalId){
  62 + condition= condition.and("hospitalId",hospitalId, MongoOper.IS);
51 63 }
52 64 if(null!=yn){
53 65 condition= condition.and("yn",yn, MongoOper.IS);
platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java View file @ 59a11ce
... ... @@ -17,6 +17,7 @@
17 17 public class SieveQuery extends BaseQuery implements IConvertToNativeQuery {
18 18  
19 19 private String id;
  20 + private String hospitalId;
20 21 //患者id
21 22 private String parentId;
22 23 //姓名
... ... @@ -49,6 +50,14 @@
49 50 //是否通知
50 51 private Integer isNotify;
51 52  
  53 + public String getHospitalId() {
  54 + return hospitalId;
  55 + }
  56 +
  57 + public void setHospitalId(String hospitalId) {
  58 + this.hospitalId = hospitalId;
  59 + }
  60 +
52 61 public Integer getIsNotify() {
53 62 return isNotify;
54 63 }
... ... @@ -94,6 +103,9 @@
94 103 MongoCondition condition = MongoCondition.newInstance();
95 104 if (null != id) {
96 105 condition = condition.and("id", id, MongoOper.IS);
  106 + }
  107 + if (null != hospitalId) {
  108 + condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
97 109 }
98 110 if (null != parentId) {
99 111 condition = condition.and("parentId", parentId, MongoOper.IS);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java View file @ 59a11ce
... ... @@ -65,8 +65,9 @@
65 65 @ResponseBody
66 66 @TokenRequired
67 67 //增加产筛申请单
68   - public BaseResponse addSieveApplyOrder(@Valid @RequestBody SieveApplyOrderAddRequest applyOrderAddRequest) {
69   - return applyOrderFacade.addOneSieveApplyOrder(applyOrderAddRequest);
  68 + public BaseResponse addSieveApplyOrder(@Valid @RequestBody SieveApplyOrderAddRequest applyOrderAddRequest,HttpServletRequest request) {
  69 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  70 + return applyOrderFacade.addOneSieveApplyOrder(applyOrderAddRequest,loginState.getId());
70 71 }
71 72 @RequestMapping(method = RequestMethod.GET,value = "/sieveapply")
72 73 @ResponseBody
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java View file @ 59a11ce
1 1 package com.lyms.platform.operate.web.controller;
2 2  
  3 +import com.lyms.platform.common.annotation.TokenRequired;
  4 +import com.lyms.platform.common.base.LoginContext;
3 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
4 6 import com.lyms.platform.common.enums.ChanQResultEnums;
5 7 import com.lyms.platform.common.enums.FuZhongEnums;
... ... @@ -15,6 +17,7 @@
15 17 import org.springframework.stereotype.Controller;
16 18 import org.springframework.web.bind.annotation.*;
17 19  
  20 +import javax.servlet.http.HttpServletRequest;
18 21 import javax.validation.Valid;
19 22 import java.util.ArrayList;
20 23 import java.util.HashMap;
... ... @@ -39,8 +42,10 @@
39 42 */
40 43 @ResponseBody
41 44 @RequestMapping(value = "/sieve",method = RequestMethod.POST)
42   - public BaseResponse addOneSieve(@RequestBody @Valid SieveAddRequest sieveAddRequest) {
43   - return sieveFacade.addOneSieve(sieveAddRequest);
  45 + @TokenRequired
  46 + public BaseResponse addOneSieve(@RequestBody @Valid SieveAddRequest sieveAddRequest,HttpServletRequest request) {
  47 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  48 + return sieveFacade.addOneSieve(sieveAddRequest,loginState.getId());
44 49 }
45 50  
46 51  
... ... @@ -52,6 +57,7 @@
52 57 */
53 58 @ResponseBody
54 59 @RequestMapping(value = "/sieves",method = RequestMethod.GET)
  60 + @TokenRequired
55 61 public BaseResponse getOneSieve(@RequestParam("parentId")String parentId) {
56 62 return sieveFacade.getOneSieve(parentId);
57 63 }
... ... @@ -63,8 +69,9 @@
63 69 */
64 70 @ResponseBody
65 71 @RequestMapping(value = "/cqsieve",method = RequestMethod.POST)
66   - public BaseResponse addOneChanQianDiaSieve(@RequestBody @Valid ChanQianDiaAddRequest chanQianDiaAddRequest) {
67   - return sieveFacade.addOneChanQianDiaSieve(chanQianDiaAddRequest);
  72 + public BaseResponse addOneChanQianDiaSieve(@RequestBody @Valid ChanQianDiaAddRequest chanQianDiaAddRequest,HttpServletRequest request) {
  73 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  74 + return sieveFacade.addOneChanQianDiaSieve(chanQianDiaAddRequest/*,loginState.getId()*/);
68 75 }
69 76  
70 77 /**
... ... @@ -74,8 +81,9 @@
74 81 */
75 82 @ResponseBody
76 83 @RequestMapping(value = "/cqsieve",method = RequestMethod.GET)
77   - public BaseResponse getOneChanQianDiaSieve(@RequestParam("id")String id) {
78   - return sieveFacade.getOneChanQianDiaSieve(id);
  84 + public BaseResponse getOneChanQianDiaSieve(@RequestParam("id")String id,HttpServletRequest request) {
  85 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  86 + return sieveFacade.getOneChanQianDiaSieve(id/*,loginState.getId()*/);
79 87 }
80 88  
81 89  
... ... @@ -153,8 +161,9 @@
153 161 */
154 162 @ResponseBody
155 163 @RequestMapping(value = "/cqsieves",method = RequestMethod.GET)
156   - public BaseResponse queryChanQianSieve(@Valid CqSieveQueryRequest cqSieveQueryRequest){
157   - return sieveFacade.queryList(cqSieveQueryRequest);
  164 + public BaseResponse queryChanQianSieve(@Valid CqSieveQueryRequest cqSieveQueryRequest,HttpServletRequest request){
  165 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  166 + return sieveFacade.queryList(cqSieveQueryRequest,loginState.getId());
158 167 }
159 168 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ 59a11ce
... ... @@ -108,9 +108,11 @@
108 108 * @param sieveApplyOrderAddRequest
109 109 * @return
110 110 */
111   - public BaseResponse addOneSieveApplyOrder(SieveApplyOrderAddRequest sieveApplyOrderAddRequest) {
  111 + public BaseResponse addOneSieveApplyOrder(SieveApplyOrderAddRequest sieveApplyOrderAddRequest,Integer userId) {
112 112 SieveApplyOrderModel sieveApplyOrderModel = sieveApplyOrderAddRequest.convertToDataModel();
113 113 sieveApplyOrderModel.setCreated(new Date());
  114 + String hospitalId= autoMatchFacade.getHospitalId(userId);
  115 + sieveApplyOrderModel.setHospitalId(hospitalId);
114 116 //增加产筛
115 117 applyOrderService.addOneSieveApplyOrder(sieveApplyOrderModel);
116 118  
... ... @@ -127,6 +129,7 @@
127 129 Patients patients = patientsService.findOnePatientById(orderModel.getParentId());
128 130 if (null != patients) {
129 131 SieveModel sieveModel = patientsService.convertToModel(patients);
  132 + sieveModel.setHospitalId(orderModel.getHospitalId());
130 133 sieveService.addChanQianSieve(sieveModel);
131 134 }
132 135 idList.add(orderModel.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java View file @ 59a11ce
... ... @@ -86,5 +86,13 @@
86 86 }
87 87 return data;
88 88 }
  89 + public String getHospitalId(Integer userId){
  90 + List<Integer> list = matchOrgId(userId);
  91 + if(null==list
  92 + ){
  93 + return null;
  94 + }
  95 + return list.get(0)+"";
  96 + }
89 97 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java View file @ 59a11ce
... ... @@ -37,22 +37,28 @@
37 37 private SieveService sieveService;
38 38 @Autowired
39 39 private PatientsService patientsService;
  40 + @Autowired
  41 + private AutoMatchFacade autoMatchFacade;
40 42  
  43 +
41 44 /**
42 45 * 增加一条产筛结果记录
43 46 *
44 47 * @param sieveAddRequest
45 48 * @return
46 49 */
47   - public BaseResponse addOneSieve(SieveAddRequest sieveAddRequest) {
  50 + public BaseResponse addOneSieve(SieveAddRequest sieveAddRequest,Integer userId) {
48 51  
49 52 sieveService.addSieve(sieveAddRequest.convertToDataModel());
50 53 SieveQuery sieveQuery=new SieveQuery();
51 54 sieveQuery.setParentId(sieveAddRequest.getParentId());
  55 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  56 + sieveQuery.setHospitalId(hospitalId);
52 57 List<SieveModel> list = sieveService.queryList(sieveQuery);
53 58 SieveModel sieveModel=new SieveModel();
54 59 sieveModel.setStatus(3);
55 60 sieveModel.setId(list.get(0).getId());
  61 + sieveModel.setHospitalId(hospitalId);
56 62 sieveService.updateOneChanQianDiaSieve(sieveModel);
57 63 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
58 64 }
... ... @@ -111,7 +117,7 @@
111 117 * @param cqSieveQueryRequest
112 118 * @return
113 119 */
114   - public BaseResponse queryList(CqSieveQueryRequest cqSieveQueryRequest) {
  120 + public BaseResponse queryList(CqSieveQueryRequest cqSieveQueryRequest,Integer userId) {
115 121 SieveQuery sieveQuery = new SieveQuery();
116 122 sieveQuery.setYn(YnEnums.YES.getId());
117 123 sieveQuery.setPhone(cqSieveQueryRequest.getPhone());
... ... @@ -127,7 +133,7 @@
127 133 sieveQuery.setPage(cqSieveQueryRequest.getPage());
128 134 sieveQuery.setLimit(cqSieveQueryRequest.getLimit());
129 135 sieveQuery.setNeed("1");
130   -
  136 + sieveQuery.setHospitalId(autoMatchFacade.getHospitalId(userId));
131 137 //查询产筛list
132 138 List<SieveModel> list = sieveService.queryList(sieveQuery);
133 139 List<SieveListResult> data = new ArrayList<>();