Commit 2bda9455f4f543a02b45e5055dea8a6a0ac75d75

Authored by liquanyu
1 parent 37763c71e0

code update

Showing 5 changed files with 19 additions and 2 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBabyCheckDao.java View file @ 2bda945
... ... @@ -18,5 +18,7 @@
18 18 public List<BabyCheckModel> queryBabyCheckRecord(MongoQuery query);
19 19  
20 20 List<BabyCheckModel> queryLastCheck(List<String> ids);
  21 +
  22 + List<BabyCheckModel> queryLastDiagnoseCheck(List<String> ids);
21 23 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyCheckDaoImpl.java View file @ 2bda945
... ... @@ -53,6 +53,16 @@
53 53 AggregationResults<BabyCheckModel> result = this.mongoTemplate.aggregate(aggregation, "lyms_babycheck", BabyCheckModel.class);
54 54 return result.getMappedResults();
55 55 }
  56 + @Override
  57 + public List<BabyCheckModel> queryLastDiagnoseCheck(List<String> ids) {
  58 +
  59 + AggregationOperation match = Aggregation.match(Criteria.where("buildId").in(ids).and("yn").is(1));
  60 + AggregationOperation group = Aggregation.group("_id","diagnose").max("created").as("created");
  61 + AggregationOperation fields = Aggregation.project("_id", "diagnose");
  62 + Aggregation aggregation = Aggregation.newAggregation(match, group,fields);
  63 + AggregationResults<BabyCheckModel> result = this.mongoTemplate.aggregate(aggregation, "lyms_babycheck", BabyCheckModel.class);
  64 + return result.getMappedResults();
  65 + }
56 66  
57 67  
58 68 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyCheckService.java View file @ 2bda945
... ... @@ -81,5 +81,10 @@
81 81 public List<BabyCheckModel> queryLastCheck(List<String> ids) {
82 82 return babyCheckDao.queryLastCheck(ids);
83 83 }
  84 +
  85 + public List<BabyCheckModel> queryLastDiagnoseCheck(List<String> ids) {
  86 + return babyCheckDao.queryLastDiagnoseCheck(ids);
  87 +
  88 + }
84 89 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 2bda945
... ... @@ -1441,7 +1441,7 @@
1441 1441 for (BabyModel model : models) {
1442 1442 BabyManageListResult result = new BabyManageListResult();
1443 1443 result.setId(model.getId());
1444   - if (model.getHighRisk() == null || model.getHighRisk() == 0) {
  1444 + if (model.getLastHighRisk() == null || model.getLastHighRisk() == 0) {
1445 1445 result.setHighRisk("健康");
1446 1446 } else {
1447 1447 result.setHighRisk("高危");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ 2bda945
... ... @@ -629,7 +629,7 @@
629 629 }
630 630 if (CollectionUtils.isNotEmpty(ids))
631 631 {
632   - List<BabyCheckModel> checkModels = babyCheckService.queryLastCheck(ids);
  632 + List<BabyCheckModel> checkModels = babyCheckService.queryLastDiagnoseCheck(ids);
633 633 if (CollectionUtils.isNotEmpty(checkModels) && checkModels.get(0) != null)
634 634 {
635 635 diagnose = checkModels.get(0).getDiagnose();