Commit 39e9244e682d78e9cce12993c412bc91d0f03623

Authored by zhangchao
1 parent f8936a66a1
Exists in dev

#fix:优化大同小程序预约建档

Showing 10 changed files with 61 additions and 31 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java View file @ 39e9244
... ... @@ -31,14 +31,7 @@
31 31  
32 32 //孕妇建档时生成孕检追访信息
33 33 public Patients addPregnantBookbuilding(Patients patient) {
34   -
35   - if (StringUtils.isNotEmpty(patient.getId())){
36   - update(patient,patient.getId());
37   - return patient;
38   - }else {
39   - return yunBookBuildingDao.addYunBookbuilding(patient);
40   - }
41   -
  34 + return yunBookBuildingDao.addYunBookbuilding(patient);
42 35 }
43 36 public void deletePregnantById(String id) {
44 37 Patients obj = new Patients();
platform-dal/src/main/java/com/lyms/platform/pojo/ArchiveData.java View file @ 39e9244
... ... @@ -24,10 +24,20 @@
24 24 private String assistUserId;
25 25 //大同本院职工 0为否 1为是
26 26 private Integer userType;
  27 + //大同特殊处理 1为不展示 0为正常逻辑
  28 + private String type;
27 29  
28 30 //建档成功时间
29 31 private Date buildDate;
30 32  
  33 +
  34 + public String getType() {
  35 + return type;
  36 + }
  37 +
  38 + public void setType(String type) {
  39 + this.type = type;
  40 + }
31 41  
32 42 public Integer getUserType() {
33 43 return userType;
platform-dal/src/main/java/com/lyms/platform/pojo/PostpartumReportModel.java View file @ 39e9244
... ... @@ -5,11 +5,16 @@
5 5 import org.springframework.data.mongodb.core.mapping.Document;
6 6  
7 7 import java.util.Date;
  8 +import java.util.List;
  9 +import java.util.Map;
8 10  
9 11 @Document(collection = "lyms_postpartum_report_model")
10 12 public class PostpartumReportModel extends BaseModel {
11 13 private static final long serialVersionUID = SerialIdEnum.PostpartumReport.getCid();
12 14 private String id;
  15 + private List<Map> risks;
  16 + //高危因素id
  17 + private List<String> riskFactorId;
13 18 //医院ID
14 19 private String hospitalId;
15 20 private Integer yn;
... ... @@ -22,6 +27,22 @@
22 27 //内容
23 28 private String context;
24 29 private Date created;
  30 +
  31 + public List<Map> getRisks() {
  32 + return risks;
  33 + }
  34 +
  35 + public void setRisks(List<Map> risks) {
  36 + this.risks = risks;
  37 + }
  38 +
  39 + public List<String> getRiskFactorId() {
  40 + return riskFactorId;
  41 + }
  42 +
  43 + public void setRiskFactorId(List<String> riskFactorId) {
  44 + this.riskFactorId = riskFactorId;
  45 + }
25 46  
26 47 public String getId() {
27 48 return id;
platform-dal/src/main/java/com/lyms/platform/query/ArchiveDataQuery.java View file @ 39e9244
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.platform.common.dao.operator.MongoCondition;
6 6 import com.lyms.platform.common.dao.operator.MongoOper;
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.common.utils.StringUtils;
8 9 import org.springframework.data.mongodb.core.query.Criteria;
9 10  
10 11 import java.util.Date;
11 12  
... ... @@ -29,7 +30,17 @@
29 30 private Date buildDateEnd;
30 31  
31 32 private Boolean hasBuildDate;
  33 + //大同预约建档特殊处理 只查询不等于1的
  34 + private String type;
32 35  
  36 + public String getType() {
  37 + return type;
  38 + }
  39 +
  40 + public void setType(String type) {
  41 + this.type = type;
  42 + }
  43 +
33 44 public Boolean isHasBuildDate() {
34 45 return hasBuildDate;
35 46 }
... ... @@ -144,6 +155,9 @@
144 155 }
145 156 if(null!=phone){
146 157 condition= condition.and("phone",phone, MongoOper.IS);
  158 + }
  159 + if (StringUtils.isNotEmpty(type)){
  160 + condition= condition.and("type","1", MongoOper.NE);
147 161 }
148 162  
149 163 Criteria c = null;
platform-dal/src/main/java/com/lyms/platform/query/PostpartumReportQuery.java View file @ 39e9244
... ... @@ -64,6 +64,7 @@
64 64 this.num = num;
65 65 }
66 66  
  67 + //分娩方式 1为顺产 2为剖腹产
67 68 private Integer deliveryModel;
68 69  
69 70 public Integer getDeliveryModel() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PostpartumReportController.java View file @ 39e9244
... ... @@ -147,11 +147,12 @@
147 147 @RequestMapping(method = RequestMethod.GET, value = "/model/getListType")
148 148 @ResponseBody
149 149 @TokenRequired
150   - public BaseResponse getPostpartumReportModelListType(Integer deliveryModel, Integer num,
  150 + public BaseResponse getPostpartumReportModelListType(Integer deliveryModel, Integer num,String riskFactorId,
151 151 HttpServletRequest request) {
152 152 PostpartumReportQuery postpartumReportQuery=new PostpartumReportQuery();
153 153 postpartumReportQuery.setDeliveryModel(deliveryModel);
154 154 postpartumReportQuery.setNum(num);
  155 + postpartumReportQuery.setrFactorList(StringUtils.covertToList(riskFactorId, String.class));
155 156 return postpartumReportFacade.queryModelByType(postpartumReportQuery,getUserId(request));
156 157 }
157 158  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java View file @ 39e9244
... ... @@ -239,6 +239,10 @@
239 239 query.setCreatedStart(start);
240 240 query.setCreatedEnd(end);
241 241 }
  242 + //大同做特殊处理只查询type为1的
  243 + if ("2100002419".equals(hospitalId)){
  244 + query.setType("true");
  245 + }
242 246  
243 247 query.setNeed("true");
244 248 query.setPage(page);
... ... @@ -293,7 +297,8 @@
293 297 String cardNum,
294 298 String phone,
295 299 @RequestParam(required = false)String userType,
296   - @RequestParam(required = false)String assistUserId) {
  300 + @RequestParam(required = false)String assistUserId,
  301 + @RequestParam(required = false)String type) {
297 302 try {
298 303 ArchiveData data = new ArchiveData();
299 304 data.setId(hospitalId + ":" + idCard);
... ... @@ -308,6 +313,7 @@
308 313 data.setJsonData(jsonData);
309 314 data.setCreated(new Date());
310 315 data.setAssistUserId(assistUserId);
  316 + data.setType(type);
311 317 System.out.println("============小程序预约建档==================");
312 318 System.out.println("============idCard=================="+idCard);
313 319 System.out.println("============小程序预约建档==================");
... ... @@ -512,7 +518,6 @@
512 518 final String assistUserId = StringUtils.isNotEmpty(archiveUsers.getAssistUserId())?archiveUsers.getAssistUserId():getArchiveId();
513 519 //组装建档保存参数
514 520 YunBookbuildingAddRequest request = new YunBookbuildingAddRequest();
515   - request.setWxType(1);
516 521 request.setHospitalId(archiveUsers.getHospitalId());
517 522 request.setPregnantName(archiveUsers.getName());
518 523 request.setPregnantCertificateNum(idCard);
... ... @@ -555,9 +560,6 @@
555 560 public void run() {
556 561 System.out.println("start auto generate antexc......");
557 562 try {
558   - if ("2100002419".equals(hospitalId)){
559   - return;
560   - }
561 563 //查询预约建档信息
562 564 ArchiveDataQuery query = new ArchiveDataQuery();
563 565 query.setIdCard(idCard);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 39e9244
... ... @@ -267,9 +267,6 @@
267 267 // patientsQuery.setHospitalId(null);
268 268 //判断该身份证号码是否有孕妇建档 在该医院
269 269 List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
270   - if (CollectionUtils.isNotEmpty(patients)){
271   - id=patients.get(0).getId();
272   - }
273 270 if (yunRequest.getLastMenstrualPeriod() != null && !yunRequest.getLastMenstrualPeriod().equals("")) {//todowtt
274 271 if (CollectionUtils.isNotEmpty(patients) && patients.get(0).getLastMenses().getTime() < DateUtil.parseYMD(yunRequest.getLastMenstrualPeriod()).getTime()) {
275 272 br.setErrorcode(ErrorCodeConstants.DATA_EXIST);
... ... @@ -594,9 +591,9 @@
594 591 List<ArchiveData> list = archiveDataServicer.query(query, Sort.Direction.DESC, "created");
595 592  
596 593 ArchiveData archiveData = new ArchiveData();
597   - if(yunRequest.getWxType()==null){
598   - archiveData.setBuildDate(new Date());
599   - }
  594 +
  595 + archiveData.setBuildDate(new Date());
  596 +
600 597 archiveData.setId(tempP.getHospitalId() + ":" + tempP.getCardNo());
601 598  
602 599 if (CollectionUtils.isNotEmpty(list)) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java View file @ 39e9244
... ... @@ -95,15 +95,6 @@
95 95 private String dept;
96 96  
97 97 private String lowerHairOgr;//母子手册发放机构
98   - private Integer wxType;//小程序预约建档
99   -
100   - public Integer getWxType() {
101   - return wxType;
102   - }
103   -
104   - public void setWxType(Integer wxType) {
105   - this.wxType = wxType;
106   - }
107 98  
108 99 public String getLowerHairOgr() {
109 100 return lowerHairOgr;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java View file @ 39e9244
... ... @@ -1090,12 +1090,12 @@
1090 1090 bloodSugarQuery.setParentId(parentId);
1091 1091 List<BloodSugar> bloodSugars = bloodSugarService.queryBloodSugarList(bloodSugarQuery, Sort.Direction.DESC, "reportDate");
1092 1092 if (CollectionUtils.isNotEmpty(bloodSugars)) {
1093   -
  1093 + Patients patients = mongoTemplate.findById(parentId, Patients.class);
1094 1094 for (BloodSugar bloodSugar : bloodSugars) {
1095 1095 Map<String, Object> reusltMap = new HashMap<>();
1096 1096 reusltMap.put("id", bloodSugar.getId());
1097 1097  
1098   - Patients patients = mongoTemplate.findById(bloodSugar.getParentId(), Patients.class);
  1098 +
1099 1099 int week = DateUtil.getWeek2(patients.getLastMenses(), bloodSugar.getReportDate());
1100 1100  
1101 1101 reusltMap.put("title", "孕" + week + "周血糖报告");