Commit 97fdc9660edcbcd8973e27fe3c036946331fa967
1 parent
9be1d2127a
Exists in
master
and in
8 other branches
增加是否通知
Showing 4 changed files with 195 additions and 9 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientBaseResult.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
97fdc96
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 8 | 8 | import com.lyms.platform.operate.web.facade.PatientFacade; |
| 9 | 9 | import com.lyms.platform.operate.web.facade.PuerperaManagerFacade; |
| 10 | +import com.lyms.platform.operate.web.request.PatientQueryRequest; | |
| 10 | 11 | import com.lyms.platform.operate.web.request.PuerperaManagerQueryRequest; |
| 11 | 12 | import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest; |
| 12 | 13 | import com.lyms.platform.operate.web.request.RiskPatientsQueryRequest; |
| ... | ... | @@ -84,7 +85,7 @@ |
| 84 | 85 | @RequestMapping(value = "/hPuer", method = RequestMethod.GET) |
| 85 | 86 | @ResponseBody |
| 86 | 87 | public BaseResponse queryHighRiskPuerpera(@Valid RiskPatientsQueryRequest patientsQueryRequest) { |
| 87 | - return patientFacade.queryHighRisk(patientsQueryRequest, Boolean.TRUE,1); | |
| 88 | + return patientFacade.queryHighRisk(patientsQueryRequest, Boolean.TRUE, 1); | |
| 88 | 89 | } |
| 89 | 90 | /** |
| 90 | 91 | *全部孕妇管理 |
| ... | ... | @@ -96,6 +97,16 @@ |
| 96 | 97 | @ResponseBody |
| 97 | 98 | public BaseResponse queryAllPuerpera(@Valid RiskPatientsQueryRequest patientsQueryRequest) { |
| 98 | 99 | return patientFacade.queryHighRisk(patientsQueryRequest,null,1); |
| 100 | + } | |
| 101 | + /** | |
| 102 | + * 获取产妇基本信息 | |
| 103 | + * | |
| 104 | + * @return 返回结果 | |
| 105 | + */ | |
| 106 | + @RequestMapping(value = "/findp", method = RequestMethod.GET) | |
| 107 | + @ResponseBody | |
| 108 | + public BaseResponse getPatent(@Valid PatientQueryRequest request){ | |
| 109 | + return patientFacade.findPatient(request); | |
| 99 | 110 | } |
| 100 | 111 | |
| 101 | 112 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
97fdc96
| ... | ... | @@ -8,14 +8,8 @@ |
| 8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 9 | import com.lyms.platform.common.utils.Assert; |
| 10 | 10 | import com.lyms.platform.common.utils.DateUtil; |
| 11 | -import com.lyms.platform.operate.web.request.PuerperaManagerQueryRequest; | |
| 12 | -import com.lyms.platform.operate.web.request.PuerperaManagerUpdateRequest; | |
| 13 | -import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest; | |
| 14 | -import com.lyms.platform.operate.web.request.RiskPatientsQueryRequest; | |
| 15 | -import com.lyms.platform.operate.web.result.PuerperaResult; | |
| 16 | -import com.lyms.platform.operate.web.result.QuanChanResult; | |
| 17 | -import com.lyms.platform.operate.web.result.QuanPatientsResult; | |
| 18 | -import com.lyms.platform.operate.web.result.RiskPatientsResult; | |
| 11 | +import com.lyms.platform.operate.web.request.*; | |
| 12 | +import com.lyms.platform.operate.web.result.*; | |
| 19 | 13 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 20 | 14 | import com.lyms.platform.pojo.BabyModel; |
| 21 | 15 | import com.lyms.platform.pojo.CommunityConfig; |
| ... | ... | @@ -224,6 +218,19 @@ |
| 224 | 218 | return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data); |
| 225 | 219 | } |
| 226 | 220 | |
| 221 | + public BaseResponse findPatient(PatientQueryRequest patientQueryRequest){ | |
| 222 | + PatientsQuery patientsQuery=new PatientsQuery(); | |
| 223 | + | |
| 224 | + patientsQuery.setId(patientQueryRequest.getId()); | |
| 225 | + patientsQuery.setPhone(patientQueryRequest.getPhone()); | |
| 226 | + patientsQuery.setCardNo(patientQueryRequest.getCardNo()); | |
| 227 | + Patients patients= patientsService.findOnePatientByCardNo(patientsQuery); | |
| 228 | + PatientBaseResult patientBaseResult=new PatientBaseResult(); | |
| 229 | + if(null!=patients){ | |
| 230 | + patientBaseResult.convert(patients); | |
| 231 | + } | |
| 232 | + return new BaseObjectResponse().setData(patientBaseResult).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 233 | + } | |
| 227 | 234 | /** |
| 228 | 235 | * 转成全部产妇的返回数据 |
| 229 | 236 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientQueryRequest.java
View file @
97fdc96
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Created by Administrator on 2016/7/10 0010. | |
| 5 | + */ | |
| 6 | +public class PatientQueryRequest { | |
| 7 | + private String id; | |
| 8 | + private String phone; | |
| 9 | + private String cardNo; | |
| 10 | + | |
| 11 | + public String getCardNo() { | |
| 12 | + return cardNo; | |
| 13 | + } | |
| 14 | + | |
| 15 | + public void setCardNo(String cardNo) { | |
| 16 | + this.cardNo = cardNo; | |
| 17 | + } | |
| 18 | + | |
| 19 | + public String getId() { | |
| 20 | + return id; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public void setId(String id) { | |
| 24 | + this.id = id; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public String getPhone() { | |
| 28 | + return phone; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setPhone(String phone) { | |
| 32 | + this.phone = phone; | |
| 33 | + } | |
| 34 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientBaseResult.java
View file @
97fdc96
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.utils.DateUtil; | |
| 4 | +import com.lyms.platform.pojo.Patients; | |
| 5 | + | |
| 6 | +import java.util.Date; | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * Created by Administrator on 2016/7/10 0010. | |
| 11 | + */ | |
| 12 | +public class PatientBaseResult { | |
| 13 | + private String id; | |
| 14 | + //名字 | |
| 15 | + private String name; | |
| 16 | + //年龄 | |
| 17 | + private Integer age; | |
| 18 | + //孕周 | |
| 19 | + private String dueWeek; | |
| 20 | + //预产期 | |
| 21 | + private String yChanQi; | |
| 22 | + //手机号 | |
| 23 | + private String phone; | |
| 24 | + //高危因素 | |
| 25 | + private List riskFactor; | |
| 26 | + //高危评分 | |
| 27 | + private String riskScore; | |
| 28 | + //备注 | |
| 29 | + private String remarks; | |
| 30 | + //末次月经 | |
| 31 | + private String lastMenses; | |
| 32 | + | |
| 33 | + public Integer getAge() { | |
| 34 | + return age; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setAge(Integer age) { | |
| 38 | + this.age = age; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public String getDueWeek() { | |
| 42 | + return dueWeek; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setDueWeek(String dueWeek) { | |
| 46 | + this.dueWeek = dueWeek; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getId() { | |
| 50 | + return id; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setId(String id) { | |
| 54 | + this.id = id; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getLastMenses() { | |
| 58 | + return lastMenses; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setLastMenses(String lastMenses) { | |
| 62 | + this.lastMenses = lastMenses; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public String getName() { | |
| 66 | + return name; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setName(String name) { | |
| 70 | + this.name = name; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public String getPhone() { | |
| 74 | + return phone; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setPhone(String phone) { | |
| 78 | + this.phone = phone; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getRemarks() { | |
| 82 | + return remarks; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setRemarks(String remarks) { | |
| 86 | + this.remarks = remarks; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public List getRiskFactor() { | |
| 90 | + return riskFactor; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setRiskFactor(List riskFactor) { | |
| 94 | + this.riskFactor = riskFactor; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public String getRiskScore() { | |
| 98 | + return riskScore; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setRiskScore(String riskScore) { | |
| 102 | + this.riskScore = riskScore; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public String getyChanQi() { | |
| 106 | + return yChanQi; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public void setyChanQi(String yChanQi) { | |
| 110 | + this.yChanQi = yChanQi; | |
| 111 | + } | |
| 112 | + public PatientBaseResult convert(Patients patients){ | |
| 113 | + setId(patients.getId()); | |
| 114 | + try { | |
| 115 | + if(null!=patients.getBirth()){ | |
| 116 | + setAge(DateUtil.getAge(patients.getBirth())); | |
| 117 | + } | |
| 118 | + }catch (Exception e){ | |
| 119 | + } | |
| 120 | + setName(patients.getUsername()); | |
| 121 | + setPhone(patients.getPhone()); | |
| 122 | + setRemarks(patients.getMremark()); | |
| 123 | + setRiskScore("60"); | |
| 124 | + | |
| 125 | + int days= DateUtil.daysBetween(patients.getLastMenses(),new Date()); | |
| 126 | + String week= (days/7)+""; | |
| 127 | + int day = (days%7); | |
| 128 | + this.dueWeek="孕"+week+"周" +(day>0?"+"+day+"天":""); | |
| 129 | + if(null!=patients.getLastMenses()){ | |
| 130 | + setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses())); | |
| 131 | + } | |
| 132 | + return this; | |
| 133 | + } | |
| 134 | +} |