Commit 53929002a838e0c6b9fd73fa08d44dc5d771f534

Authored by litao@lymsh.com
1 parent cce4e954e8

12333

Showing 1 changed file with 48 additions and 15 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TrackDownServiceImpl.java View file @ 5392900
1 1 package com.lyms.platform.operate.web.service.impl;
2 2  
3 3 import com.lyms.platform.biz.service.TrackDownService;
  4 +import com.lyms.platform.common.enums.FmTypeEnums;
4 5 import com.lyms.platform.common.enums.YnEnums;
5 6 import com.lyms.platform.common.result.BaseResponse;
6 7 import com.lyms.platform.common.result.PageResult;
... ... @@ -11,9 +12,7 @@
11 12 import com.lyms.platform.operate.web.service.ITrackDownService;
12 13 import com.lyms.platform.operate.web.utils.CollectionUtils;
13 14 import com.lyms.platform.operate.web.utils.MongoUtil;
14   -import com.lyms.platform.pojo.Patients;
15   -import com.lyms.platform.pojo.ResidentsArchiveModel;
16   -import com.lyms.platform.pojo.TrackDown;
  15 +import com.lyms.platform.pojo.*;
17 16 import org.springframework.beans.factory.annotation.Autowired;
18 17 import org.springframework.data.mongodb.core.MongoTemplate;
19 18 import org.springframework.data.mongodb.core.query.Criteria;
20 19  
21 20  
22 21  
... ... @@ -65,22 +64,56 @@
65 64 temp.put("id", patient.getId());
66 65 temp.put("cardNo", patient.getCardNo());
67 66 temp.put("username", patient.getUsername());
  67 + temp.put("phone", patient.getPhone());
68 68 temp.put("age", DateUtil.getAge(patient.getBirth()));
69   - temp.put("resident", "--"); // 妇女建档
70   - temp.put("residentDate", "2017-10-11"); // 妇女建档日期
71   - temp.put("check", "--"); // 婚检
72   - temp.put("bookbuild", ""); // 孕期建档 1=勾勾 2=叉叉
73   - temp.put("bookbuildDte", DateUtil.getyyyy_MM_dd(patient.getBookbuildingDate()));
74   - temp.put("yjcount", 0); // 孕检次数
75   - temp.put("cqsc", ""); // 产前筛查 1=勾勾 2=叉叉
76   - temp.put("fm", ""); // 分娩 1=勾勾 2=叉叉
77   - temp.put("fmType", ""); // 分娩方式 1=顺产, 2=剖宫产
78   - temp.put("chfc", ""); // 产后复查 1=勾勾 2=叉叉
79   - temp.put("chfcCount", ""); // 复查次数
  69 + temp.put("bookbuild", 2); // 孕期建档 1=勾勾 2=叉叉 3=--
  70 + temp.put("bookbuildDate", DateUtil.getyyyy_MM_dd(patient.getBookbuildingDate()));
  71 + temp.put("yjcount", getChuzhenCount(patient.getId())); // 孕检次数 = 初诊 + 复诊
  72 + temp.put("cqsc", 1); // 产前筛查 1=勾勾 2=叉叉 3=--
  73 + temp.put("fm", 3); // 分娩 1=勾勾 2=叉叉 3=--
  74 + temp.put("fmType", FmTypeEnums.getFmNameById(patient.getFmType())); // 分娩方式
  75 + temp.put("chfc", 3); // 产后复查 1=勾勾 2=叉叉 3=--
  76 + temp.put("chfcCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(patient.getId()).and("yn").is(1)), PostReviewModel.class)); // 复查次数
80 77 restList.add(temp);
81 78 }
82   -
  79 + for (ResidentsArchiveModel archiveModel : residentsArchiveModels) {
  80 + for (Map<String, Object> map : restList) {
  81 + if(archiveModel.getVcCardNo().toString().equals(map.get("cardNo").toString())) {
  82 + map.put("resident", 2); // 妇女建档
  83 + map.put("residentDate", DateUtil.getyyyy_MM_dd(archiveModel.getBuildDay()));
  84 + map.put("check", 3); // 婚检
  85 + continue;
  86 + }
  87 + }
  88 + Map<String, Object> temp = new HashMap<>();
  89 + temp.put("id", archiveModel.getId());
  90 + temp.put("cardNo", archiveModel.getCertificateNum());
  91 + temp.put("username", archiveModel.getUsername());
  92 + temp.put("phone", archiveModel.getPhone());
  93 + temp.put("age", DateUtil.getAge(archiveModel.getBirthday()));
  94 + temp.put("resident", 3); // 妇女建档
  95 + temp.put("residentDate", DateUtil.getyyyy_MM_dd(archiveModel.getBuildDay())); // 妇女建档日期
  96 + temp.put("check", 2); // 婚检
  97 + temp.put("bookbuild", null); // 孕期建档 1=勾勾 2=叉叉
  98 + temp.put("bookbuildDate", null);
  99 + temp.put("yjcount", 0); // 孕检次数 = 初诊 + 复诊
  100 + temp.put("cqsc", 3); // 产前筛查 1=勾勾 2=叉叉
  101 + temp.put("fm", 3); // 分娩 1=勾勾 2=叉叉
  102 + temp.put("fmType", null); // 分娩方式
  103 + temp.put("chfc", 3); // 产后复查 1=勾勾 2=叉叉
  104 + temp.put("chfcCount", null); // 复查次数
  105 + restList.add(temp);
  106 + }
83 107 return RespBuilder.buildSuccess(new PageResult(restList.size(), page, limit, CollectionUtils.getPageIds(restList, page, limit)));
  108 + }
  109 +
  110 + /**
  111 + * 获取产检次数
  112 + */
  113 + private long getChuzhenCount(String patientId) {
  114 + long antexcCount = mongoTemplate.count(Query.query(Criteria.where("parentId").is(patientId).and("yn").is(1)), AntExChuModel.class);
  115 + long antexCount = mongoTemplate.count(Query.query(Criteria.where("parentid").is(patientId).and("yn").is(1)), AntenatalExaminationModel.class);
  116 + return antexcCount + antexCount;
84 117 }
85 118  
86 119 public BaseResponse add(Integer userId, TrackDown trackDown) {