Commit 89410124f9f046b05e72040277f4c6acc964703a
1 parent
957aacf80d
Exists in
master
and in
6 other branches
bug
Showing 2 changed files with 29 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java
View file @
8941012
| ... | ... | @@ -37,6 +37,16 @@ |
| 37 | 37 | |
| 38 | 38 | private String dayWeigthsJson; |
| 39 | 39 | |
| 40 | + private String dayWeights2Json; | |
| 41 | + | |
| 42 | + public String getDayWeights2Json() { | |
| 43 | + return dayWeights2Json; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setDayWeights2Json(String dayWeights2Json) { | |
| 47 | + this.dayWeights2Json = dayWeights2Json; | |
| 48 | + } | |
| 49 | + | |
| 40 | 50 | private String created2; |
| 41 | 51 | |
| 42 | 52 | public String getCreated2() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
8941012
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 17 | 17 | import com.lyms.platform.pojo.PatientWeight; |
| 18 | 18 | import com.lyms.platform.pojo.Patients; |
| 19 | +import net.sf.json.JSONArray; | |
| 19 | 20 | import net.sf.json.JSONObject; |
| 20 | 21 | import org.apache.commons.collections.MapUtils; |
| 21 | 22 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -424,6 +425,7 @@ |
| 424 | 425 | m.put("nowWeight", nowWeight); |
| 425 | 426 | dayWeights2.add(m); |
| 426 | 427 | } |
| 428 | + pw.setDayWeights2(dayWeights2); | |
| 427 | 429 | patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); |
| 428 | 430 | return RespBuilder.buildSuccess(pw); |
| 429 | 431 | } |
| ... | ... | @@ -454,6 +456,7 @@ |
| 454 | 456 | } |
| 455 | 457 | patientWeight.setYn("1"); |
| 456 | 458 | patientWeight.setPid(patients.getPid()); |
| 459 | + pw.setDayWeights2(dayWeights2); | |
| 457 | 460 | patientWeightService2.add(patientWeight); |
| 458 | 461 | return RespBuilder.buildSuccess(patientWeight); |
| 459 | 462 | } |
| 460 | 463 | |
| ... | ... | @@ -469,7 +472,23 @@ |
| 469 | 472 | map.put(entry.getKey() + "", entry.getValue() + ""); |
| 470 | 473 | } |
| 471 | 474 | patientWeight.setDayWeights(map); |
| 475 | + | |
| 476 | + JSONArray dayWeights2 = JSONArray.fromObject(patientWeight.getDayWeights2Json()); | |
| 477 | + List<Map<String, Object>> dayWeights2List = new ArrayList<>(); | |
| 478 | + Iterator iterator = dayWeights2.iterator(); | |
| 479 | + while (iterator.hasNext()) { | |
| 480 | + JSONObject jsonObject = JSONObject.fromObject(iterator.next().toString()); | |
| 481 | + Map<String, Object> temp = new HashMap<>(); | |
| 482 | + temp.put("hospitalId", jsonObject.getString("hospitalId")); | |
| 483 | + temp.put("hospitalName", jsonObject.getString("hospitalName")); | |
| 484 | + temp.put("date", jsonObject.getString("date")); | |
| 485 | + temp.put("nowWeight", jsonObject.getString("nowWeight")); | |
| 486 | + dayWeights2List.add(temp); | |
| 487 | + } | |
| 488 | + | |
| 472 | 489 | patientWeight.setDayWeigthsJson(null); |
| 490 | + patientWeight.setDayWeights2Json(null); | |
| 491 | + patientWeight.setDayWeights2(dayWeights2); | |
| 473 | 492 | patientWeight.setCreated(new Date(Long.parseLong(patientWeight.getCreated2()))); |
| 474 | 493 | patientWeight.setCreated2(null); |
| 475 | 494 |