Commit 864b6d34a17bd5964bc268b30b7714007bb03470

Authored by dongqin
1 parent 3b1d7b70f4

添加建档id

Showing 2 changed files with 25 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CommonRequest.java View file @ 864b6d3
... ... @@ -33,6 +33,19 @@
33 33 */
34 34 private String type;
35 35  
  36 + /**
  37 + * 建档id
  38 + */
  39 + private String parentId;
  40 +
  41 + public String getParentId() {
  42 + return parentId;
  43 + }
  44 +
  45 + public void setParentId(String parentId) {
  46 + this.parentId = parentId;
  47 + }
  48 +
36 49 public String getType() {
37 50 return type;
38 51 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CommonServerImpl.java View file @ 864b6d3
... ... @@ -23,11 +23,7 @@
23 23 import com.lyms.platform.operate.web.utils.CollectionUtils;
24 24 import com.lyms.platform.operate.web.utils.CommonsHelper;
25 25 import com.lyms.platform.permission.dao.master.FolviteMapper;
26   -import com.lyms.platform.permission.dao.master.FolviteReceiveMapper;
27 26 import com.lyms.platform.permission.model.FolviteQuery;
28   -import com.lyms.platform.permission.model.FolviteRecordQuery;
29   -import com.lyms.platform.pojo.BasicConfig;
30   -import com.lyms.platform.pojo.FolviteReceiveRecordModel;
31 27 import com.lyms.platform.pojo.FolviteRecordModel;
32 28 import com.lyms.platform.pojo.MaternalDeliverModel;
33 29 import com.lyms.platform.pojo.Patients;
... ... @@ -81,6 +77,7 @@
81 77 MaternalDeliverModel maternalDeliverModel = models.get(0);
82 78 result.setMataFollowId(maternalDeliverModel.getId());
83 79 }
  80 + getParentIdByPid(result, personModel);
84 81 }
85 82 ResidentsArchiveModel archiveModel = mongoTemplate.findOne(Query.query(Criteria.where("certificateNum").is(cardNo)), ResidentsArchiveModel.class);
86 83 if (archiveModel != null) {
87 84  
... ... @@ -105,7 +102,9 @@
105 102 if (CollectionUtils.isNotEmpty(models)) {
106 103 MaternalDeliverModel maternalDeliverModel = models.get(0);
107 104 result.setMataFollowId(maternalDeliverModel.getId());
  105 + result.setParentId(maternalDeliverModel.getParentId());
108 106 }
  107 + getParentIdByPid(result, personModel);
109 108 }
110 109 baseResponse.setObject(result);
111 110 return baseResponse;
... ... @@ -125,6 +124,7 @@
125 124 MaternalDeliverModel maternalDeliverModel = models.get(0);
126 125 result.setMataFollowId(maternalDeliverModel.getId());
127 126 }
  127 + getParentIdByPid(result, personModel);
128 128 }
129 129 }
130 130 baseResponse.setObject(result);
... ... @@ -132,6 +132,14 @@
132 132 }
133 133  
134 134 return new BaseResponse("参数缺失",ErrorCodeConstants.PARAMETER_ERROR);
  135 + }
  136 +
  137 + private void getParentIdByPid(CommonRequest result, PersonModel personModel) {
  138 + List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModel.getId())).with(new Sort(Sort.Direction.DESC, "created")), Patients.class);
  139 + if (CollectionUtils.isNotEmpty(patients)) {
  140 + Patients patient = patients.get(0);
  141 + result.setParentId(patient.getId());
  142 + }
135 143 }
136 144  
137 145 /**