Commit ac59b4f72295be083b584421b339c96ae3eb62b8

Authored by jiangjiazhi
1 parent c11a3e09c0

修改产检删除

Showing 4 changed files with 39 additions and 9 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java View file @ ac59b4f
... ... @@ -152,7 +152,7 @@
152 152 public AntExRecordModel convert(AntenatalExaminationModel antEx) {
153 153 AntExRecordModel antExRecordModel = new AntExRecordModel();
154 154 antExRecordModel.setParentId(antEx.getParentId());
155   -// antExRecordModel.setId(antEx.getId());
  155 + antExRecordModel.setfId(antEx.getId());
156 156 antExRecordModel.setType(1);
157 157 antExRecordModel.setHospitalId(antEx.getHospitalId());
158 158 antExRecordModel.setCheckDoctor(antEx.getCheckDoctor());
... ... @@ -187,6 +187,7 @@
187 187 antExRecordModel.setHospitalId(antExChuModel.getHospitalId());
188 188 antExRecordModel.setParentId(antExChuModel.getParentId());
189 189 antExRecordModel.setType(2);
  190 + antExRecordModel.setfId(antExChuModel.getId());
190 191 antExRecordModel.setPid(antExChuModel.getPid());
191 192 antExRecordModel.setModified(new Date());
192 193 Patients patients = patientsService.findOnePatientById(antExChuModel.getParentId());
... ... @@ -253,6 +254,7 @@
253 254 * @param antExRecordQuery
254 255 */
255 256 public void batchUpdate(AntExRecordModel record, AntExRecordQuery antExRecordQuery) {
  257 + record.setModified(new Date());
256 258 antExRecordDao.batchUpdateRecord(record, antExRecordQuery.convertToQuery());
257 259 }
258 260  
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntenatalExaminationService.java View file @ ac59b4f
... ... @@ -12,6 +12,7 @@
12 12 import com.lyms.platform.query.AntExChuQuery;
13 13 import com.lyms.platform.query.AntExRecordQuery;
14 14 import com.lyms.platform.query.VisitQuery;
  15 +import org.apache.commons.collections.CollectionUtils;
15 16 import org.springframework.beans.factory.annotation.Autowired;
16 17 import org.springframework.data.domain.Sort;
17 18 import org.springframework.stereotype.Service;
18 19  
... ... @@ -103,16 +104,20 @@
103 104 AntExChuModel chu = findOne(id);
104 105 antExRecordModel = antExRecordService.convert(chu);
105 106 }
106   -
107   -
108 107 if (null != antExRecordModel) {
109 108 AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
110   - antExRecordQuery.setParentId(antExRecordModel.getParentId());
111   - antExRecordQuery.setcId(antExRecordModel.getCheckDoctor());
112   - Integer count = antExRecordService.count(antExRecordQuery);
113   - if (null == count || 0 == count) {
114   - antExRecordModel.setCreated(new Date());
115   - antExRecordService.addOneRecord(antExRecordModel);
  109 + antExRecordQuery.setfId(id);
  110 + List<AntExRecordModel> list = antExRecordService.queryAntExRecords(antExRecordQuery);
  111 + if (CollectionUtils.isNotEmpty(list)) {
  112 + antExRecordService.batchUpdate(antExRecordModel,antExRecordQuery);
  113 + } else {
  114 + antExRecordQuery.setParentId(antExRecordModel.getParentId());
  115 + antExRecordQuery.setcId(antExRecordModel.getCheckDoctor());
  116 + Integer count = antExRecordService.count(antExRecordQuery);
  117 + if (null == count || 0 == count) {
  118 + antExRecordModel.setCreated(new Date());
  119 + antExRecordService.addOneRecord(antExRecordModel);
  120 + }
116 121 }
117 122 }
118 123 }
platform-dal/src/main/java/com/lyms/platform/pojo/AntExRecordModel.java View file @ ac59b4f
... ... @@ -16,6 +16,8 @@
16 16 public class AntExRecordModel extends BaseModel {
17 17  
18 18 private String id;
  19 + //原始表的id
  20 + private String fId;
19 21  
20 22 private String parentId;
21 23  
... ... @@ -49,6 +51,14 @@
49 51 private Date modified;
50 52  
51 53 private Date created;
  54 +
  55 + public String getfId() {
  56 + return fId;
  57 + }
  58 +
  59 + public void setfId(String fId) {
  60 + this.fId = fId;
  61 + }
52 62  
53 63 public Date getModified() {
54 64 return modified;
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java View file @ ac59b4f
... ... @@ -16,6 +16,8 @@
16 16 public class AntExRecordQuery extends BaseQuery implements IConvertToNativeQuery {
17 17 private String parentId;
18 18 private String id;
  19 + private String fId;
  20 +
19 21 //创建时间
20 22 private String hospitalId;
21 23 //孕妇状态
... ... @@ -32,6 +34,14 @@
32 34 private Date gteCreated;
33 35 private String pid;
34 36  
  37 + public String getfId() {
  38 + return fId;
  39 + }
  40 +
  41 + public void setfId(String fId) {
  42 + this.fId = fId;
  43 + }
  44 +
35 45 public String getcId() {
36 46 return cId;
37 47 }
... ... @@ -145,6 +155,9 @@
145 155 }
146 156 if (null != cId) {
147 157 condition = condition.and("checkDoctor", cId, MongoOper.IS);
  158 + }
  159 + if (null != cId) {
  160 + condition = condition.and("fId", fId, MongoOper.IS);
148 161 }
149 162  
150 163 if (null != hospitalId) {