Commit c2b7607405ec6d044088448637bdaff2af6f46ea

Authored by litao@lymsh.com
1 parent 735abf2753

改bug

Showing 4 changed files with 34 additions and 8 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java View file @ c2b7607
... ... @@ -77,6 +77,16 @@
77 77 this.dayWeigthsJson = dayWeigthsJson;
78 78 }
79 79  
  80 + private Date modified;
  81 +
  82 + public Date getModified() {
  83 + return modified;
  84 + }
  85 +
  86 + public void setModified(Date modified) {
  87 + this.modified = modified;
  88 + }
  89 +
80 90 private String id;
81 91  
82 92 private String pid;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RemoteFacade.java View file @ c2b7607
... ... @@ -51,7 +51,7 @@
51 51 String bpStatus = getBpStatus(entry.getValue().get("ssy").toString(), entry.getValue().get("szy").toString());
52 52 if(StringUtils.isNotEmpty(bpStatus)) {
53 53 patients = (patients == null ? mongoTemplate.findById(bloodPressure.getParentId(), Patients.class) : patients);
54   - setTempInfo(bloodPressure.getId() + ID_SEPARATOR + entry.getKey(), temp, patients,
  54 + setTempInfo(bloodPressure.getId() + ID_SEPARATOR + entry.getKey() + ID_SEPARATOR + bloodPressure.getModified().getTime(), temp, patients,
55 55 entry.getValue().get("ssy") + "/" + entry.getValue().get("szy"), bpStatus, "(收缩压:90-140 舒张压:60-90)", ErrorPatientEnums.BLOOD_PRESSURE, bloodPressure.getModified());
56 56 }
57 57 }
... ... @@ -84,7 +84,7 @@
84 84 Map<String, Object> temp = new HashMap<>();
85 85 temp.put("name", BloodSugarEnums.getName(bloodSugar.getBloodSugarType()));
86 86 bloodSugarCache.put(bloodSugar.getId(), temp);
87   - setTempInfo(bloodSugar.getId(), temp, mongoTemplate.findById(bloodSugar.getParentId(), Patients.class), bloodSugar.getBloodSugar(), Double.parseDouble(bloodSugar.getBloodSugar()) > max ? "高血糖" : "低血糖",
  87 + setTempInfo(bloodSugar.getId() + ID_SEPARATOR + bloodSugar.getModified().getTime(), temp, mongoTemplate.findById(bloodSugar.getParentId(), Patients.class), bloodSugar.getBloodSugar(), Double.parseDouble(bloodSugar.getBloodSugar()) > max ? "高血糖" : "低血糖",
88 88 "(" + min +"-" + max + ")", ErrorPatientEnums.BLOOD_SUGAR, bloodSugar.getModified());
89 89 }
90 90 }
... ... @@ -109,7 +109,8 @@
109 109 Double low = lowMap.get(week);
110 110 Double high = highMap.get(week);
111 111 if(addWeight < low || addWeight > high) {
112   - setTempInfo(patientWeight.getId() + ID_SEPARATOR + entry.getKey(), temp, patients, null, addWeight < low ? "增重过少" : "增重过多",
  112 + setTempInfo(patientWeight.getId() + ID_SEPARATOR + entry.getKey() + ID_SEPARATOR, temp, patients, (patientWeight.getModified() == null ? "" : patientWeight.getModified().getTime() + ""), addWeight < low ? "增重过少" : "增重过多",
  113 +// setTempInfo(patientWeight.getId() + ID_SEPARATOR + entry.getKey() + ID_SEPARATOR + patientWeight.getModified().getTime(), temp, patients, null, addWeight < low ? "增重过少" : "增重过多",
113 114 "(" + lowMap.get(0) + "~" + highMap.get(0) + ")", ErrorPatientEnums.PATIENT_WEIGHT, patientWeight.getCreated());
114 115 temp.put("beforeWeight", patientWeight.getBeforeWeight());
115 116 temp.put("nowWeight", patientWeight.getNowWeight());
... ... @@ -132,7 +133,7 @@
132 133 if(DateUtil.parseYMD(entry.getKey()).getTime() >= yesterday.getTime()) {
133 134 if(entry.getValue() < 36D || entry.getValue() > 38.5D ) {
134 135 patients = (patients == null ? mongoTemplate.findById(tempModel.getParentId(), Patients.class) : patients);
135   - setTempInfo(tempModel.getId() + ID_SEPARATOR + entry.getKey(), temp, patients, entry.getValue() + "", entry.getValue() < 36D ? "低热" : "高热",
  136 + setTempInfo(tempModel.getId() + ID_SEPARATOR + entry.getKey() + ID_SEPARATOR + tempModel.getModified().getTime(), temp, patients, entry.getValue() + "", entry.getValue() < 36D ? "低热" : "高热",
136 137 "(36-37.4)", ErrorPatientEnums.TEMP, tempModel.getModified());
137 138 }
138 139 }
... ... @@ -146,7 +147,7 @@
146 147  
147 148 private void setTempInfo(String id, Map<String, Object> temp, Patients patients, String value, String desc, String ckz, ErrorPatientEnums errorPatientEnums, Date modified) {
148 149 if(patients == null) return;
149   - temp.put("id", id + ID_SEPARATOR + DateUtil.getymd());
  150 + temp.put("id", id + ID_SEPARATOR);
150 151 temp.put("username", patients.getUsername());
151 152 temp.put("lastMenses", patients.getLastMenses().getTime()/1000);
152 153 temp.put("pid", patients.getPid());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java View file @ c2b7607
... ... @@ -106,10 +106,12 @@
106 106 List<String> ids = new ArrayList<>();
107 107 if(CollectionUtils.isNotEmpty(patients)) {
108 108 for (Patients patient : patients) {
109   - ids.add(patient.getId());
  109 +// ids.add(patient.getId());
  110 + ids.add(patient.getPid());
110 111 }
111 112 }
112   - criteria.and("parentId").in(ids);
  113 +// criteria.and("parentId").in(ids);
  114 + criteria.and("pid").in(ids);
113 115 PageResult pageResult = findMongoPage(BloodPressure.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit);
114 116 List<BloodPressure> bloodPressures = (List<BloodPressure>) pageResult.getGrid();
115 117 List<Map<String, Object>> restList = new ArrayList<>();
... ... @@ -211,7 +213,12 @@
211 213 temp.put("pulse", bloodPressure.getPulse());
212 214 temp.put("timestamp", DateUtil.getyyyy_MM_dd_hms(new Date()));
213 215 temp.put("hospitalId", hospitalId);
214   - BloodPressure bp = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodPressure.getParentId()).and("yn").ne(0)), BloodPressure.class);
  216 +
  217 + Patients p = mongoTemplate.findById(bloodPressure.getParentId(), Patients.class);
  218 + BloodPressure bp = null;
  219 + if(p != null) {
  220 + bp = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(p.getPid())), BloodPressure.class);
  221 + }
215 222 bloodPressure.setModified(new Date());
216 223 if(bp == null) {
217 224 String parentId = mongoUtil.doHidePatient(bloodPressure.getParentId(), hospitalId);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ c2b7607
... ... @@ -105,6 +105,7 @@
105 105 patients.setSource(patientWeight.getPatientId());
106 106 patients.setCreated(new Date());
107 107 // mongoTemplate.save(patients);
  108 + patients.setModified(new Date());
108 109 patientsService.addPatient(patients);
109 110 patientWeight.setPatientId(patients.getId());
110 111 }
... ... @@ -141,6 +142,7 @@
141 142 dayWeights2.add(m);
142 143 }
143 144 pw.setDayWeights2(dayWeights2);
  145 + pw.setModified(new Date());
144 146 patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw);
145 147 return RespBuilder.buildSuccess(pw.getId());
146 148 }
... ... @@ -169,6 +171,7 @@
169 171 dayWeights2.add(m);
170 172 patientWeight.setDayWeights2(dayWeights2);
171 173  
  174 + patientWeight.setModified(new Date());
172 175 patientWeightService2.add(patientWeight);
173 176  
174 177 operateLogFacade.addAddOptLog(userId, Integer.valueOf(hospitalId), patientWeight, OptActionEnums.ADD.getId(), "添加孕体重");
... ... @@ -186,6 +189,7 @@
186 189 return RespBuilder.buildSuccess(patientWeight.getId());
187 190 } else {
188 191 patientWeight.setOperaterId(userId.toString());
  192 + patientWeight.setModified(new Date());
189 193 patientWeightService2.update(Query.query(Criteria.where("id").is(patientWeight.getId())), patientWeight);
190 194 return RespBuilder.buildSuccess(patientWeight.getId());
191 195 }
... ... @@ -454,6 +458,7 @@
454 458 dayWeights2.add(m);
455 459 }
456 460 pw.setDayWeights2(dayWeights2);
  461 + pw.setModified(new Date());
457 462 patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw);
458 463 return RespBuilder.buildSuccess(pw);
459 464 }
... ... @@ -478,6 +483,7 @@
478 483 patientWeight.setPid(patients.getPid());
479 484 patientWeight.setDayWeights(dayWeights);
480 485 patientWeight.setId(null);
  486 + patientWeight.setModified(new Date());
481 487 patientWeightService2.add(patientWeight);
482 488 return RespBuilder.buildSuccess(patientWeight);
483 489  
... ... @@ -493,6 +499,7 @@
493 499 map.put(entry.getKey() + "", entry.getValue() + "");
494 500 }
495 501 patientWeight.setDayWeights(map);
  502 + patientWeight.setModified(new Date());
496 503  
497 504 JSONArray dayWeights2 = JSONArray.fromObject(patientWeight.getDayWeights2Json());
498 505 /*List<Map<String, Object>> dayWeights2List = new ArrayList<>();
... ... @@ -584,6 +591,7 @@
584 591 patientWeight.setBmi(getBmi(beforeWeight, beforeHeight));
585 592 }
586 593 }
  594 + patientWeight.setModified(new Date());
587 595 patientWeightService2.update(Query.query(Criteria.where("id").is(id)), patientWeight);
588 596  
589 597 if(sync) {