Commit 8d925a62fa3c8fe439792310e3332cb278336b2d

Authored by litao@lymsh.com
1 parent 565acab9b5

gai bug

Showing 2 changed files with 32 additions and 12 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java View file @ 8d925a6
... ... @@ -167,7 +167,6 @@
167 167 temp.put("ssy", infos.containsKey(date) ? infos.get(date).get("ssy") : "--");
168 168 temp.put("szy", infos.containsKey(date) ? infos.get(date).get("szy") : "--");
169 169  
170   -
171 170 xAxis.add(date.replace("-", "/"));
172 171 ssy.add(infos.containsKey(date) ? infos.get(date).get("ssy") : 0);
173 172 szy.add(infos.containsKey(date) ? infos.get(date).get("szy") : 0);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 8d925a6
... ... @@ -86,7 +86,7 @@
86 86  
87 87 // 绑定医生和患者的关系
88 88 String patSerSyncUrl = Config.getItem("patSer_sync_url", "0");
89   - Map<String, String> param = new LinkedHashMap<>();
  89 + Map<String, String> param = new HashMap<>();
90 90 param.put("doctorName", couponMapper.findUserName(userId + ""));
91 91 param.put("patientId", patients.getId());
92 92 param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId));
... ... @@ -134,7 +134,7 @@
134 134 }
135 135 }
136 136 if(flag) {
137   - Map<String, Object> m = new LinkedHashMap<>();
  137 + Map<String, Object> m = new HashMap<>();
138 138 m.put("hospitalId", hospitalId);
139 139 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
140 140 m.put("date", ymdDate);
... ... @@ -163,7 +163,7 @@
163 163 // mongoTemplate.save(patientWeight);
164 164  
165 165  
166   - Map<String, Object> m = new LinkedHashMap<>();
  166 + Map<String, Object> m = new HashMap<>();
167 167 m.put("hospitalId", hospitalId);
168 168 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
169 169 m.put("date", DateUtil.getyyyy_MM_dd(new Date()));
... ... @@ -280,6 +280,7 @@
280 280 map.put("bim", patientWeight.getBmi()); // 体质指数(BMI)=体重(kg)÷身高^2(m)
281 281  
282 282 Map<String, String> dayWeights = patientWeight.getDayWeights();
  283 + dayWeights = sortMapByKey(dayWeights);
283 284 Map<Integer, String> weights = new LinkedHashMap<>();
284 285 if (MapUtils.isNotEmpty(dayWeights)) {
285 286 Set<Map.Entry<String, String>> entries = dayWeights.entrySet();
... ... @@ -296,6 +297,26 @@
296 297 return RespBuilder.buildSuccess();
297 298 }
298 299  
  300 + private Map<String, String> sortMapByKey(Map<String, String> dayWeights) {
  301 + if(MapUtils.isNotEmpty(dayWeights)) {
  302 + Map<String, String> temp = new TreeMap<>(new Comparator<String>() {
  303 + @Override
  304 + public int compare(String o1, String o2) {
  305 + return o1.compareTo(o2);
  306 + }
  307 + });
  308 + for (Map.Entry<String, String> entry : dayWeights.entrySet()) {
  309 + temp.put(entry.getKey(), entry.getValue());
  310 + }
  311 + return temp;
  312 + }
  313 + return dayWeights;
  314 + }
  315 +
  316 + public static void main(String[] args) {
  317 + System.out.println("2017-12-16".compareTo("2017-12-18"));
  318 + }
  319 +
299 320 @Override
300 321 public BaseResponse edit(String id) {
301 322 PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class);
... ... @@ -303,7 +324,7 @@
303 324 List<Map<String, Object>> weightInfo = new ArrayList<>();
304 325 List<String> betweenDay = DateUtil.getBetweenDay(7);
305 326 for (String date : betweenDay) {
306   - Map<String, Object> temp = new LinkedHashMap<>();
  327 + Map<String, Object> temp = new HashMap<>();
307 328 weightInfo.add(temp);
308 329 temp.put("id", date);
309 330 for (Map<String, Object> map : patientWeight.getDayWeights2()) {
... ... @@ -389,7 +410,7 @@
389 410 Map<String, Object> map = new LinkedHashMap<>();
390 411 map.put("beforeWeight", patientWeight.getBeforeWeight());
391 412 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
392   - Map<String, String> dayWeights = patientWeight.getDayWeights();
  413 + Map<String, String> dayWeights = sortMapByKey(patientWeight.getDayWeights());
393 414 Map<Integer, String> weights = new LinkedHashMap<>();
394 415 if (MapUtils.isNotEmpty(dayWeights)) {
395 416 Set<Map.Entry<String, String>> entries = dayWeights.entrySet();
... ... @@ -450,7 +471,7 @@
450 471 }
451 472 }
452 473 if(flag) {
453   - Map<String, Object> m = new LinkedHashMap<>();
  474 + Map<String, Object> m = new HashMap<>();
454 475 m.put("hospitalId", hospitalId);
455 476 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
456 477 m.put("date", ymdDate);
... ... @@ -464,7 +485,7 @@
464 485 }
465 486  
466 487 if(StringUtils.isNotEmpty(nowWeight)) {
467   - Map<String, Object> m = new LinkedHashMap<>();
  488 + Map<String, Object> m = new HashMap<>();
468 489 m.put("hospitalId", hospitalId);
469 490 m.put("hospitalName", couponMapper.getHospitalName(hospitalId));
470 491 m.put("date", ymdDate);
... ... @@ -494,7 +515,7 @@
494 515 String dayWeigthsJson = patientWeight.getDayWeigthsJson();
495 516 JSONObject dayWeights = JSONObject.fromObject(dayWeigthsJson);
496 517 Set<Map.Entry> set = dayWeights.entrySet();
497   - Map<String, String> map = new LinkedHashMap<>();
  518 + Map<String, String> map = new HashMap<>();
498 519 for (Map.Entry entry : set) {
499 520 map.put(entry.getKey() + "", entry.getValue() + "");
500 521 }
... ... @@ -532,7 +553,7 @@
532 553 }
533 554  
534 555  
535   - return RespBuilder.buildSuccess(patientWeight.getId());
  556 + return RespBuilder.buildSuccess(patientWeight.getId());
536 557 }
537 558  
538 559 @Override
... ... @@ -550,7 +571,7 @@
550 571  
551 572 // 绑定医生和患者的关系
552 573 String patSerSyncUrl = Config.getItem("patSer_sync_url", "0");
553   - Map<String, String> param = new LinkedHashMap<>();
  574 + Map<String, String> param = new HashMap<>();
554 575 param.put("doctorName", couponMapper.findUserName(userId + ""));
555 576 param.put("patientId", patientWeight.getPatientId());
556 577 param.put("hospitalName", couponMapper.findHospitalNameById(hospitalId));
... ... @@ -601,7 +622,7 @@
601 622 new Thread(new Runnable() {
602 623 @Override
603 624 public void run() {
604   - Map<String, String> param = new LinkedHashMap<>();
  625 + Map<String, String> param = new HashMap<>();
605 626 param.put("userId", userId + "");
606 627 param.put("id", id);
607 628 param.put("beforeWeight", beforeWeight);