Commit 7bf7d0291e3880acc8fdd742bcd94a0f1db90e6a

Authored by liquanyu

Merge remote-tracking branch 'origin/master'

Showing 20 changed files

platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java View file @ 7bf7d02
... ... @@ -16,6 +16,7 @@
16 16  
17 17 private String id;
18 18 private String parentId;
  19 + private String pid;
19 20 //预产期
20 21 private Date dueDate;
21 22 //末次月经
... ... @@ -88,6 +89,14 @@
88 89 private Date created;
89 90 private String hospitalId;
90 91 private String bp;
  92 +
  93 + public String getPid() {
  94 + return pid;
  95 + }
  96 +
  97 + public void setPid(String pid) {
  98 + this.pid = pid;
  99 + }
91 100  
92 101 public String getBp() {
93 102 return bp;
platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java View file @ 7bf7d02
... ... @@ -15,6 +15,7 @@
15 15 public class AntenatalExaminationModel {
16 16  
17 17 private String id;
  18 + private String pid;
18 19 private String parentId;
19 20 /* //名字
20 21 private String name;
... ... @@ -91,6 +92,14 @@
91 92 private Date modified;
92 93 private String hospitalId;
93 94 private String cDueWeek;
  95 +
  96 + public String getPid() {
  97 + return pid;
  98 + }
  99 +
  100 + public void setPid(String pid) {
  101 + this.pid = pid;
  102 + }
94 103  
95 104 public String getcDueWeek() {
96 105 return cDueWeek;
platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java View file @ 7bf7d02
... ... @@ -17,6 +17,7 @@
17 17 private String id;
18 18 //产妇id
19 19 private String parentId;
  20 + private String pid;
20 21 //分娩时间
21 22 private String dueDate;
22 23 //分娩孕周
... ... @@ -122,6 +123,14 @@
122 123  
123 124 public void setModified(Date modified) {
124 125 this.modified = modified;
  126 + }
  127 +
  128 + public String getPid() {
  129 + return pid;
  130 + }
  131 +
  132 + public void setPid(String pid) {
  133 + this.pid = pid;
125 134 }
126 135  
127 136 public static class Baby {
platform-dal/src/main/java/com/lyms/platform/pojo/PostReviewModel.java View file @ 7bf7d02
... ... @@ -17,6 +17,8 @@
17 17 //产妇id
18 18 private String parentId;
19 19  
  20 + private String pid;
  21 +
20 22 //分娩天数
21 23 private String day;
22 24 //健康情况
... ... @@ -88,6 +90,14 @@
88 90 private Date created;
89 91 private Date modified;
90 92 private String hospitalId;
  93 +
  94 + public String getPid() {
  95 + return pid;
  96 + }
  97 +
  98 + public void setPid(String pid) {
  99 + this.pid = pid;
  100 + }
91 101  
92 102 public String getHospitalId() {
93 103 return hospitalId;
platform-dal/src/main/java/com/lyms/platform/pojo/SieveApplyOrderModel.java View file @ 7bf7d02
... ... @@ -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 @ 7bf7d02
... ... @@ -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/AntExChuQuery.java View file @ 7bf7d02
... ... @@ -25,6 +25,16 @@
25 25 private Date nextCheckTimeStart;
26 26 private Date nextCheckTimeEnd;
27 27  
  28 + private String pid;
  29 +
  30 + public String getPid() {
  31 + return pid;
  32 + }
  33 +
  34 + public void setPid(String pid) {
  35 + this.pid = pid;
  36 + }
  37 +
28 38 public String getHospitalId() {
29 39 return hospitalId;
30 40 }
... ... @@ -99,6 +109,9 @@
99 109  
100 110 if(null!=hospitalId){
101 111 condition=condition.and("hospitalId",hospitalId,MongoOper.IS);
  112 + }
  113 + if(null!=pid){
  114 + condition=condition.and("pid",pid,MongoOper.IS);
102 115 }
103 116  
104 117 boolean isAddStart = Boolean.FALSE;
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java View file @ 7bf7d02
... ... @@ -18,6 +18,7 @@
18 18 private String parentId;
19 19 private Integer yn;
20 20 private String id;
  21 + private String pid;
21 22 //创建时间
22 23 private Date start;
23 24  
24 25  
... ... @@ -39,11 +40,22 @@
39 40 this.start = start;
40 41 }
41 42  
  43 + public String getPid() {
  44 + return pid;
  45 + }
  46 +
  47 + public void setPid(String pid) {
  48 + this.pid = pid;
  49 + }
  50 +
42 51 @Override
43 52 public MongoQuery convertToQuery() {
44 53 MongoCondition condition=MongoCondition.newInstance();
45 54 if(null!=parentId){
46 55 condition= condition.and("parentId",parentId, MongoOper.IS);
  56 + }
  57 + if(null!=pid){
  58 + condition= condition.and("pid",pid, MongoOper.IS);
47 59 }
48 60 if(null!=yn){
49 61 condition= condition.and("yn",yn, MongoOper.IS);
platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java View file @ 7bf7d02
... ... @@ -17,15 +17,28 @@
17 17 private String parentId;
18 18 private String vcCardNo;
19 19 private String cardNo;
  20 + private String pid;
20 21 /**
21 22 * 是否有效
22 23 */
23 24 private Integer yn;
  25 +
  26 + public String getPid() {
  27 + return pid;
  28 + }
  29 +
  30 + public void setPid(String pid) {
  31 + this.pid = pid;
  32 + }
  33 +
24 34 @Override
25 35 public MongoQuery convertToQuery() {
26 36 MongoCondition condition=MongoCondition.newInstance();
27 37 if(null!=id){
28 38 condition=condition.and("id",id, MongoOper.IS);
  39 + }
  40 + if(null!=pid){
  41 + condition=condition.and("pid",pid, MongoOper.IS);
29 42 }
30 43 if(null!=vcCardNo){
31 44 condition=condition.and("vcCardNo",vcCardNo,MongoOper.IS);
platform-dal/src/main/java/com/lyms/platform/query/PostReviewQuery.java View file @ 7bf7d02
... ... @@ -20,7 +20,16 @@
20 20 private Date start;
21 21  
22 22 private Date end;
  23 + private String pid;
23 24  
  25 + public String getPid() {
  26 + return pid;
  27 + }
  28 +
  29 + public void setPid(String pid) {
  30 + this.pid = pid;
  31 + }
  32 +
24 33 public Date getEnd() {
25 34 return end;
26 35 }
... ... @@ -69,6 +78,9 @@
69 78 }
70 79 if(null!=id){
71 80 mongoCondition= mongoCondition.and("id",id, MongoOper.IS);
  81 + }
  82 + if(null!=pid){
  83 + mongoCondition= mongoCondition.and("pid",pid, MongoOper.IS);
72 84 }
73 85 if(null!=parentId){
74 86 mongoCondition= mongoCondition.and("parentId",parentId, MongoOper.IS);
platform-dal/src/main/java/com/lyms/platform/query/SieveApplyOrderQuery.java View file @ 7bf7d02
... ... @@ -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 @ 7bf7d02
... ... @@ -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 @ 7bf7d02
... ... @@ -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 @ 7bf7d02
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 }
58 64  
... ... @@ -62,9 +68,11 @@
62 68 * @return
63 69 */
64 70 @ResponseBody
  71 + @TokenRequired
65 72 @RequestMapping(value = "/cqsieve",method = RequestMethod.POST)
66   - public BaseResponse addOneChanQianDiaSieve(@RequestBody @Valid ChanQianDiaAddRequest chanQianDiaAddRequest) {
67   - return sieveFacade.addOneChanQianDiaSieve(chanQianDiaAddRequest);
  73 + public BaseResponse addOneChanQianDiaSieve(@RequestBody @Valid ChanQianDiaAddRequest chanQianDiaAddRequest,HttpServletRequest request) {
  74 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  75 + return sieveFacade.addOneChanQianDiaSieve(chanQianDiaAddRequest/*,loginState.getId()*/);
68 76 }
69 77  
70 78 /**
... ... @@ -74,8 +82,10 @@
74 82 */
75 83 @ResponseBody
76 84 @RequestMapping(value = "/cqsieve",method = RequestMethod.GET)
77   - public BaseResponse getOneChanQianDiaSieve(@RequestParam("id")String id) {
78   - return sieveFacade.getOneChanQianDiaSieve(id);
  85 + @TokenRequired
  86 + public BaseResponse getOneChanQianDiaSieve(@RequestParam("id")String id,HttpServletRequest request) {
  87 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  88 + return sieveFacade.getOneChanQianDiaSieve(id/*,loginState.getId()*/);
79 89 }
80 90  
81 91  
... ... @@ -153,8 +163,10 @@
153 163 */
154 164 @ResponseBody
155 165 @RequestMapping(value = "/cqsieves",method = RequestMethod.GET)
156   - public BaseResponse queryChanQianSieve(@Valid CqSieveQueryRequest cqSieveQueryRequest){
157   - return sieveFacade.queryList(cqSieveQueryRequest);
  166 + @TokenRequired
  167 + public BaseResponse queryChanQianSieve(@Valid CqSieveQueryRequest cqSieveQueryRequest,HttpServletRequest request){
  168 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  169 + return sieveFacade.queryList(cqSieveQueryRequest,loginState.getId());
158 170 }
159 171 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 7bf7d02
... ... @@ -79,6 +79,7 @@
79 79 if (CollectionUtils.isNotEmpty(list)) {
80 80 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("同一天只能建一次复诊");
81 81 }
  82 + model.setPid( patientsService.findOnePatientById(antExAddRequest.getParentId()).getPid());
82 83 antenatalExaminationService.addOneBabyAnt(model);
83 84 updateApplyOrder(model, antExAddRequest.getParentId());
84 85 }
85 86  
... ... @@ -114,17 +115,16 @@
114 115 antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId());
115 116 } else {
116 117 List list1 = autoMatchFacade.matchOrgId(userId);
  118 + Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId());
  119 + PatientsQuery patientsQuery = new PatientsQuery();
  120 + patientsQuery.setPid(patients.getPid());
  121 + patientsQuery.setYn(YnEnums.YES.getId());
117 122 if (CollectionUtils.isNotEmpty(list1)) {
118 123 antExChuModel.setHospitalId(list1.get(0) + "");
119 124 AntExChuQuery antExChuQuery = new AntExChuQuery();
120 125 antExChuQuery.setYn(YnEnums.YES.getId());
121 126 antExChuQuery.setHospitalId(list1.get(0) + "");
122 127  
123   - Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId());
124   - PatientsQuery patientsQuery = new PatientsQuery();
125   - patientsQuery.setPid(patients.getPid());
126   - patientsQuery.setYn(YnEnums.YES.getId());
127   -
128 128 List<Patients> list = patientsService.queryPatient(patientsQuery);
129 129 antExChuQuery.setStart(list.get(0).getCreated());
130 130 antExChuQuery.setParentId(excAddRequest.getParentId());
... ... @@ -133,6 +133,7 @@
133 133 return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("您本次妊娠中已在本医院建档");
134 134 }
135 135 }
  136 + antExChuModel.setPid(patients.getPid());
136 137 antExChuModel.setYn(YnEnums.YES.getId());
137 138 antenatalExaminationService.addOneAntEx(antExChuModel);
138 139 }
... ... @@ -159,7 +160,7 @@
159 160 List list1 = JsonUtil.toList(model.getRiskFactor(), List.class);
160 161 highScoreResult = queryRisk(list1);
161 162 }
162   - if (null != model &&!"{}".equals(model.getOtherRisk())) {
  163 + if (null != model && !"{}".equals(model.getOtherRisk())) {
163 164 Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class);
164 165  
165 166 //风险因素
... ... @@ -227,7 +228,7 @@
227 228 for (Patients patients : list) {
228 229 HighScoreResult highScoreResult = findLastRisk(patients.getId());
229 230 antexListResult.setRiskFactor(highScoreResult.getHighRisk());
230   - antexListResult.setRiskScore(highScoreResult.getScore()+"");
  231 + antexListResult.setRiskScore(highScoreResult.getScore() + "");
231 232 List<StopPregModel> stopPregs = null;
232 233 List<AntData> data = new ArrayList<>();
233 234 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
... ... @@ -256,7 +257,8 @@
256 257 }
257 258 }
258 259 PostReviewQuery postReviewQuery = new PostReviewQuery();
259   - ;postReviewQuery.setYn(YnEnums.YES.getId());
  260 + ;
  261 + postReviewQuery.setYn(YnEnums.YES.getId());
260 262 if (StringUtils.isNotEmpty(dueDate)) {
261 263 Date date = DateUtil.parseYMD(dueDate);
262 264 //初诊记录
... ... @@ -358,7 +360,7 @@
358 360 * @param vcCardNo
359 361 * @return
360 362 */
361   - public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId,Integer type) {
  363 + public Patients findOnePatient(String cardNo, String vcCardNo, String id, String hospitalId, Integer type) {
362 364 PatientsQuery patientsQuery = new PatientsQuery();
363 365 if (StringUtils.isNotEmpty(cardNo)) {
364 366 patientsQuery.setCardNo(cardNo);
... ... @@ -397,7 +399,7 @@
397 399 return "0";
398 400 }
399 401 int day = DateUtil.getDays(date, new Date());
400   - int start = 15 * 7+3;
  402 + int start = 15 * 7 + 3;
401 403 int end = 20 * 7 + 6;
402 404 if (day >= start && day <= end) {
403 405 SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery();
... ... @@ -438,8 +440,10 @@
438 440 hospital = list1.get(0) + "";
439 441 }
440 442 //查询产妇数据
441   - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital,1);
442   - patients1 = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null,1);
  443 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospital, 1);
  444 + if (null == patients) {
  445 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, null, 1);
  446 + }
443 447 }
444 448  
445 449 if (null == patients) {
... ... @@ -448,7 +452,7 @@
448 452  
449 453 AntexListResult antexListResult = new AntexListResult();
450 454 AntExChuQuery antExChuQuery = new AntExChuQuery();
451   - antExChuQuery.setParentId(patients1.getId());
  455 + antExChuQuery.setPid(patients.getPid());
452 456 antExChuQuery.setYn(YnEnums.YES.getId());
453 457 //获取初诊记录
454 458 List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery);
455 459  
... ... @@ -457,8 +461,11 @@
457 461 antExChuModel = antExChulist.get(0);
458 462 }*/
459 463 HighScoreResult highScoreResult = findLastRisk(patients.getId());
  464 + AntExQuery antExQuery=new AntExQuery();
  465 + antExQuery.setYn(YnEnums.YES.getId());
  466 + antExQuery.setPid(patients.getPid());
460 467 //查询产前检查记录
461   - List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(patients.getId());
  468 + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
462 469 /* List data = new ArrayList();
463 470 if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) {
464 471 List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
465 472  
466 473  
467 474  
468 475  
469 476  
... ... @@ -475,26 +482,26 @@
475 482 data.add();
476 483 }*/
477 484 antexListResult.convertToResult(list, patients, antExChulist);
478   - antexListResult.setData(handlAntData(antExChulist,list));
  485 + antexListResult.setData(handlAntData(antExChulist, list));
479 486 antexListResult.setIsSieve(cap(patients.getLastMenses(), patients.getId()));
480 487 antexListResult.setRiskFactor(highScoreResult.getHighRisk());
481   - antexListResult.setRiskScore(highScoreResult.getScore()+"");
  488 + antexListResult.setRiskScore(highScoreResult.getScore() + "");
482 489 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult);
483 490 }
484 491  
485   - public List handlAntData(List<AntExChuModel> antExChulist,List<AntenatalExaminationModel> list){
  492 + public List handlAntData(List<AntExChuModel> antExChulist, List<AntenatalExaminationModel> list) {
486 493 List<AntData> dataList = new ArrayList<>();
487   - Organization organization=null;
488   - if(CollectionUtils.isNotEmpty(antExChulist)){
489   - for(AntExChuModel antExChuModel1:antExChulist){
  494 + Organization organization = null;
  495 + if (CollectionUtils.isNotEmpty(antExChulist)) {
  496 + for (AntExChuModel antExChuModel1 : antExChulist) {
490 497 if (null != antExChuModel1.getHospitalId()) {
491 498 organization = organizationService.getOrganization(Integer.valueOf(antExChuModel1.getHospitalId()));
492 499 }
493   - dataList.add(new AntData(antExChuModel1,null != organization ? organization.getName() : ""));
  500 + dataList.add(new AntData(antExChuModel1, null != organization ? organization.getName() : ""));
494 501 }
495 502 }
496   - if(CollectionUtils.isNotEmpty(list)){
497   - for(AntenatalExaminationModel model:list){
  503 + if (CollectionUtils.isNotEmpty(list)) {
  504 + for (AntenatalExaminationModel model : list) {
498 505 if (null != model.getHospitalId()) {
499 506 organization = organizationService.getOrganization(Integer.valueOf(model.getHospitalId()));
500 507 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ 7bf7d02
... ... @@ -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 @ 7bf7d02
... ... @@ -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/MatDeliverFacade.java View file @ 7bf7d02
... ... @@ -9,6 +9,7 @@
9 9 import com.lyms.platform.common.utils.JsonUtil;
10 10 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
11 11 import com.lyms.platform.operate.web.request.MatDeliverQueryRequest;
  12 +import com.lyms.platform.operate.web.result.HighScoreResult;
12 13 import com.lyms.platform.operate.web.result.MatDeliverListResult;
13 14 import com.lyms.platform.operate.web.result.MaternalDeliverResult;
14 15 import com.lyms.platform.permission.model.Organization;
... ... @@ -51,7 +52,6 @@
51 52 @Autowired
52 53 private PersonService personService;
53 54  
54   -
55 55 /**
56 56 * 增加或者修改分娩记录
57 57 *
... ... @@ -62,6 +62,13 @@
62 62 List<MaternalDeliverModel.Baby> babyList = new ArrayList<>();
63 63 //增加
64 64 if (StringUtils.isEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) {
  65 + MatDeliverQuery matDeliverQuery=new MatDeliverQuery();
  66 + matDeliverQuery.setParentId(deliverAddRequest.getParentId());
  67 + matDeliverQuery.setYn(YnEnums.YES.getId());
  68 + List<MaternalDeliverModel> list2= matDeliverService.query(matDeliverQuery);
  69 + if(CollectionUtils.isNotEmpty(list2)){
  70 + return new BaseResponse().setErrormsg("您已分娩").setErrorcode(ErrorCodeConstants.DATA_EXIST);
  71 + }
65 72 MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel();
66 73 //获取到小孩信息
67 74 List<MatDeliverAddRequest.Baby> list = deliverAddRequest.getBabies();
... ... @@ -71,6 +78,9 @@
71 78 patientsQuery.setId(parentId);
72 79 List<Patients> patients = patientsService.queryPatient(patientsQuery);
73 80 Patients patients1 = null;
  81 + if (CollectionUtils.isNotEmpty(patients)){
  82 + maternalDeliverModel.setPid(patients.get(0).getPid());
  83 + }
74 84 if (CollectionUtils.isNotEmpty(list)) {
75 85 String userName = "";
76 86 if (CollectionUtils.isNotEmpty(patients)) {
... ... @@ -230,6 +240,9 @@
230 240 personModel.setYn(YnEnums.YES.getId());
231 241 personModel.setBirth(DateUtil.parseYMD(deliverAddRequest.getDueDate()));
232 242 personModel.setModified(new Date());
  243 + personModel.setPhone(babyModel.getMphone());
  244 + personModel.setCardNo(babyModel.getMcertNo());
  245 + personModel.setName(babyModel.getName());
233 246 babyModel.setPid(personService.addPerson(personModel).getId());
234 247 }
235 248 babyIds.add(babyService.addOneBaby(babyModel).getId());
... ... @@ -256,7 +269,7 @@
256 269 return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR);
257 270 }
258 271 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
259   - matDeliverQuery.setParentId(patients.getId());
  272 + matDeliverQuery.setPid(patients.getPid());
260 273 matDeliverQuery.setYn(YnEnums.YES.getId());
261 274 List<MaternalDeliverModel> list = matDeliverService.query(matDeliverQuery);
262 275 MatDeliverListResult matDeliverListResult = new MatDeliverListResult();
263 276  
... ... @@ -265,14 +278,15 @@
265 278 antExQuery.setParentId(patients.getId());
266 279 antExQuery.setYn(YnEnums.YES.getId());
267 280 List<AntenatalExaminationModel> examinationModel = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
  281 + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId());
268 282 try {
269 283 String tTireNumber = "";
270 284 List data = new ArrayList();
271 285 if (CollectionUtils.isNotEmpty(examinationModel)) {
272 286 if (null != examinationModel && StringUtils.isNotEmpty(examinationModel.get(0).getRiskFactor())) {
273 287 tTireNumber = examinationModel.get(0).getTireNumber();
274   - List l = JsonUtil.toList(examinationModel.get(0).getRiskFactor(), List.class);
275   - findBasicConfig(l,data);
  288 + /* List l = JsonUtil.toList(examinationModel.get(0).getRiskFactor(), List.class);
  289 + findBasicConfig(l,data);*/
276 290 }
277 291 } else {
278 292 AntExChuQuery antExChuQuery = new AntExChuQuery();
279 293  
280 294  
... ... @@ -281,26 +295,17 @@
281 295 List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
282 296 if (CollectionUtils.isNotEmpty(antExChuModels)) {
283 297 tTireNumber = antExChuModels.get(0).getTireNumber();
284   - List l = JsonUtil.toList(antExChuModels.get(0).getHighrisk(), List.class);
285   - findBasicConfig(l,data);
  298 + /* List l = JsonUtil.toList(antExChuModels.get(0).getHighrisk(), List.class);
  299 + findBasicConfig(l,data);*/
286 300 }
287 301 }
288 302  
289   - matDeliverListResult.setRiskFactor(data);
  303 + matDeliverListResult.setRiskFactor(highScoreResult.getHighRisk());
  304 + matDeliverListResult.setRiskScore(highScoreResult.getScore()+"");
290 305 matDeliverListResult.setTireNumber1(tTireNumber);
291 306 } catch (Exception e) {
292 307 }
293 308 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(matDeliverListResult);
294   - }
295   -
296   - private void findBasicConfig(List l,List data){
297   - for (int i = 0; i < l.size(); i++) {
298   - String key = (String) l.get(i);
299   - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key);
300   - if (null != basicConfig) {
301   - data.add(basicConfig.getName());
302   - }
303   - }
304 309 }
305 310  
306 311 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java View file @ 7bf7d02
... ... @@ -53,6 +53,7 @@
53 53 if(CollectionUtils.isNotEmpty(list1)){
54 54 postReviewModel.setHospitalId(list1.get(0)+"");
55 55 }
  56 + postReviewModel.setPid(patientsService.findOnePatientById(postReviewRequest.getParentId()).getPid());
56 57 postReviewService.addPostReview(postReviewModel);
57 58 } else {
58 59 postReviewService.updatePostById(postReviewRequest.convertToDataModel(), postReviewRequest.getId());
59 60  
... ... @@ -69,11 +70,11 @@
69 70 PostReviewListResult postReviewListResult = new PostReviewListResult();
70 71 if (null != patientsList) {
71 72 PostReviewQuery postReviewQuery = new PostReviewQuery();
72   - postReviewQuery.setParentId(patientsList.getId());
  73 + postReviewQuery.setPid(patientsList.getPid());
73 74 postReviewQuery.setYn(YnEnums.YES.getId());
74 75 List<PostReviewModel> postReviewModels = postReviewService.findWithList(postReviewQuery);
75 76 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
76   - matDeliverQuery.setParentId(patientsList.getId());
  77 + matDeliverQuery.setPid(patientsList.getPid());
77 78 matDeliverQuery.setYn(YnEnums.YES.getId());
78 79  
79 80 List<MaternalDeliverModel> list = matDeliverService.query(matDeliverQuery);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java View file @ 7bf7d02
... ... @@ -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<>();