Commit 756aac7919e8817f852dc852ec8db8e9930d25c5
1 parent
ff0b0b2f47
Exists in
master
and in
6 other branches
修复bug
Showing 1 changed file with 22 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodSugarServiceImpl.java
View file @
756aac7
... | ... | @@ -403,10 +403,29 @@ |
403 | 403 | } |
404 | 404 | data.put("weekRange", weekRange); |
405 | 405 | |
406 | - TemporaryBloodSugar temporaryBloodSugar = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(lbsId)), TemporaryBloodSugar.class); | |
406 | + // 添加报告解读人 | |
407 | + List<TemporaryBloodSugar> bloodSugars = mongoTemplate.find(Query.query(Criteria.where("pid").is(id).and("created").gt(DateUtil.getYMDTime())), TemporaryBloodSugar.class); | |
408 | + List<Date> dateList = new ArrayList<>(); | |
409 | + if (CollectionUtils.isNotEmpty(bloodSugars)){ | |
410 | + for (TemporaryBloodSugar sugar: bloodSugars){ | |
411 | + Date created = sugar.getCreated(); | |
412 | + if (created != null){ | |
413 | + String dbCreated = DateUtil.getyyyy_MM_dd(created); | |
414 | + String currentDate = DateUtil.getyyyy_MM_dd(new Date()); | |
415 | + if (dbCreated.equals(currentDate)){ | |
416 | + dateList.add(created); | |
417 | + } | |
418 | + } | |
419 | + } | |
420 | + } | |
407 | 421 | String doctorId = ""; |
408 | - if (temporaryBloodSugar != null){ | |
409 | - doctorId = temporaryBloodSugar.getDoctorId(); | |
422 | + if (CollectionUtils.isNotEmpty(dateList)){ | |
423 | + Date maxDate = Collections.max(dateList); | |
424 | + List<TemporaryBloodSugar> sugarList = mongoTemplate.find(Query.query(Criteria.where("pid").is(id).and("created").is(maxDate)), TemporaryBloodSugar.class); | |
425 | + if (CollectionUtils.isNotEmpty(sugarList)){ | |
426 | + TemporaryBloodSugar bloodSugar = sugarList.get(0); | |
427 | + doctorId = bloodSugar.getDoctorId(); | |
428 | + } | |
410 | 429 | } |
411 | 430 | |
412 | 431 | healthChargeFacade.addHealthCharge(hospitalId, 2, id, 1, 2, userId, doctorId, false); |