Commit 75da28ccac6449554308431b1a06166601f305bb
1 parent
c312897fa7
Exists in
master
and in
6 other branches
bbbbbb
Showing 1 changed file with 16 additions and 14 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
75da28c
... | ... | @@ -230,10 +230,14 @@ |
230 | 230 | titleList.add(DateUtil.getyyyy_mm(map.get("cname"))); |
231 | 231 | } |
232 | 232 | Map<String, Map<String, Integer>> tempMap = new HashMap<>(); |
233 | - for (Patients patient : patients) { | |
233 | + for (Patients patient : patients) {/* | |
234 | + if(patient.getHospitalId().equals("1000000012")) { | |
235 | + System.out.println(1); | |
236 | + }*/ | |
234 | 237 | if(tempMap.containsKey(patient.getHospitalId())) { |
235 | 238 | Map<String, Integer> map = tempMap.get(patient.getHospitalId()); |
236 | 239 | for (Map<String, Date> dateMap : range) { |
240 | +// System.out.println(patient.getBookbuildingDate().toLocaleString() + " " + dateMap.get("start").toLocaleString() + "" + dateMap.get("end").toLocaleString()); | |
237 | 241 | String cname = DateUtil.getyyyy_mm(dateMap.get("cname")); |
238 | 242 | if(patient.getBookbuildingDate().getTime() >= dateMap.get("start").getTime() |
239 | 243 | && patient.getBookbuildingDate().getTime() <= dateMap.get("end").getTime()) { |
240 | 244 | |
... | ... | @@ -541,12 +545,13 @@ |
541 | 545 | if(patients == null) { |
542 | 546 | return RespBuilder.buildSuccess(); |
543 | 547 | } |
544 | - Patients p = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(patients.getPid())).with(new Sort(Sort.Direction.DESC, "created")), Patients.class); | |
545 | - if(p == null) { | |
548 | + List<Patients> p = mongoTemplate.find(Query.query(Criteria.where("pid").is(patients.getPid()).and("lastMenses").is(patients.getLastMenses())), Patients.class); | |
549 | + if(CollectionUtils.isEmpty(p)) { | |
546 | 550 | return RespBuilder.buildSuccess(); |
547 | 551 | } |
548 | - List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(p.getPid()).and("yn").is(1).and("checkTime").gte(p.getLastMenses())).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
549 | - List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(p.getPid()).and("yn").is(1).and("checkDate").gte(p.getLastMenses())).with(new Sort(Sort.Direction.DESC, "checkDate")), AntenatalExaminationModel.class); | |
552 | + List<String> parentids = CollectionUtils.getId(p, "id", String.class); | |
553 | + List<AntExChuModel> antExChuModels = mongoTemplate.find(Query.query(Criteria.where("parentId").in(parentids).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
554 | + List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("parentId").in(parentids).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "checkDate")), AntenatalExaminationModel.class); | |
550 | 555 | |
551 | 556 | Map<String, Object> xyMap = new HashMap<>(); |
552 | 557 | List<Integer> szyMin = new ArrayList<>(); |
553 | 558 | |
... | ... | @@ -574,9 +579,9 @@ |
574 | 579 | |
575 | 580 | for (AntenatalExaminationModel antexModel : antexModels) { |
576 | 581 | Map<String, Object> temp = new HashMap<>(); |
577 | - Integer week = DateUtil.getWeek2(p.getLastMenses(), antexModel.getCheckDate()); | |
582 | + Integer week = DateUtil.getWeek2(p.get(0).getLastMenses(), antexModel.getCheckDate()); | |
578 | 583 | temp.put("checkTime", DateUtil.getyyyy_MM_dd(antexModel.getCheckDate())); |
579 | - temp.put("week", DateUtil.getWeekDesc(p.getLastMenses(), antexModel.getCheckDate())); | |
584 | + temp.put("week", DateUtil.getWeekDesc(p.get(0).getLastMenses(), antexModel.getCheckDate())); | |
580 | 585 | temp.put("weight", antexModel.getWeight()); |
581 | 586 | temp.put("bp", parseNull(JSONObject.parseObject(antexModel.getBp()).getString("ssy"), "--") + "/" + parseNull(JSONObject.parseObject(antexModel.getBp()).getString("szy"), "--")); |
582 | 587 | temp.put("gonggao", antexModel.getGongGao()); |
... | ... | @@ -610,7 +615,7 @@ |
610 | 615 | ssy.set(week, parseNull(JSONObject.parseObject(antexModel.getBp()).getString("ssy"), 0)); |
611 | 616 | szy.set(week, parseNull(JSONObject.parseObject(antexModel.getBp()).getString("szy"), 0)); |
612 | 617 | if(tzFlag && antexModel.getWeight() != null) { |
613 | - weights.put(DateUtil.getWeek2(p.getLastMenses(), antexModel.getCheckDate()), antexModel.getWeight() + ""); | |
618 | + weights.put(DateUtil.getWeek2(p.get(0).getLastMenses(), antexModel.getCheckDate()), antexModel.getWeight() + ""); | |
614 | 619 | } |
615 | 620 | |
616 | 621 | restList.add(temp); |
... | ... | @@ -621,8 +626,8 @@ |
621 | 626 | for (AntExChuModel antExChuModel : antExChuModels) { |
622 | 627 | Map<String, Object> temp = new HashMap<>(); |
623 | 628 | temp.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); |
624 | - Integer week = DateUtil.getWeek2(p.getLastMenses(), antExChuModel.getCheckTime()); | |
625 | - temp.put("week", DateUtil.getWeekDesc(p.getLastMenses(), antExChuModel.getCheckTime())); | |
629 | + Integer week = DateUtil.getWeek2(p.get(0).getLastMenses(), antExChuModel.getCheckTime()); | |
630 | + temp.put("week", DateUtil.getWeekDesc(p.get(0).getLastMenses(), antExChuModel.getCheckTime())); | |
626 | 631 | temp.put("weight", antExChuModel.getWeight()); |
627 | 632 | temp.put("bp", parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("ssy"), "--") + "/" + parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("szy"), "--")); |
628 | 633 | temp.put("gonggao", antExChuModel.getGonggao()); |
... | ... | @@ -667,9 +672,6 @@ |
667 | 672 | |
668 | 673 | } |
669 | 674 | |
670 | - | |
671 | - | |
672 | - | |
673 | 675 | /*if (MapUtils.isNotEmpty(dayWeights)) { |
674 | 676 | Set<Map.Entry<String, String>> entries = dayWeights.entrySet(); |
675 | 677 | for (Map.Entry<String, String> entry : entries) { |
... | ... | @@ -2585,7 +2587,7 @@ |
2585 | 2587 | return RespBuilder.buildSuccess(pg); |
2586 | 2588 | } |
2587 | 2589 | List<Map<String,Object>> userSendInfo = couponMapper.findUserSendInfoByUids(param2); |
2588 | - System.out.println(userIds); | |
2590 | +// System.out.println(userIds); | |
2589 | 2591 | // Integer count = couponMapper.findUserSendInfoCount(param); |
2590 | 2592 | for (Map<String, Object> map : userSendInfo) { |
2591 | 2593 | String userId = (String) map.get("user_id"); |