Commit b7b370b47c8eb6afa2bb3bb447357cfbf2b5498a
1 parent
7641836aa8
Exists in
master
and in
6 other branches
儿保检查-获取量表数据
Showing 2 changed files with 58 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
b7b370b
... | ... | @@ -791,6 +791,19 @@ |
791 | 791 | } |
792 | 792 | |
793 | 793 | /** |
794 | + * 根据儿童ID获取儿童量表数据 | |
795 | + * | |
796 | + * @param babyId 儿童建档id | |
797 | + * @return | |
798 | + */ | |
799 | + @RequestMapping(value = "/scale", method = RequestMethod.POST) | |
800 | + @ResponseBody | |
801 | + public BaseResponse scaleDetail(@RequestParam String babyId) { | |
802 | + return viewFacade.scaleDetail(babyId); | |
803 | + } | |
804 | + | |
805 | + | |
806 | + /** | |
794 | 807 | * 妇女查看页面 |
795 | 808 | * |
796 | 809 | * @param id |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
b7b370b
... | ... | @@ -5959,5 +5959,50 @@ |
5959 | 5959 | objectResponse.setErrormsg("成功"); |
5960 | 5960 | return objectResponse; |
5961 | 5961 | } |
5962 | + | |
5963 | + /** | |
5964 | + * 根据儿童ID获取儿童量表数据 | |
5965 | + * | |
5966 | + * @param babyId | |
5967 | + * @return | |
5968 | + */ | |
5969 | + public BaseResponse scaleDetail(String babyId) { | |
5970 | + Date firstSecond = DateUtil.getDayFirstSecond(new Date()); | |
5971 | + Query query = Query.query(Criteria.where("babyId").is(babyId).and("createTime").gte(firstSecond)).with(new Sort(Sort.Direction.DESC, "createTime")); | |
5972 | + // 运动测评结果 | |
5973 | + List<ExerciseAppraisalModel> models = mongoTemplate.find(query, ExerciseAppraisalModel.class); | |
5974 | + String percentileScore = ""; | |
5975 | + if (CollectionUtils.isNotEmpty(models)) { | |
5976 | + ExerciseAppraisalModel model = models.get(0); | |
5977 | + percentileScore = model.getPercentileScore().toString(); | |
5978 | + } | |
5979 | + | |
5980 | + // 异常、正常数 | |
5981 | + List<BabyNerveMovementModel> movementModels = mongoTemplate.find(query, BabyNerveMovementModel.class); | |
5982 | + String abnormalSize = ""; | |
5983 | + String okSize = ""; | |
5984 | + if (CollectionUtils.isNotEmpty(movementModels)) { | |
5985 | + BabyNerveMovementModel model = movementModels.get(0); | |
5986 | + abnormalSize = model.getAbnormalSize().toString(); | |
5987 | + okSize = model.getOkSize().toString(); | |
5988 | + } | |
5989 | + | |
5990 | + // 智力商 | |
5991 | + List<BabyNeuroPsychologicalModel> babyNeuroPsychologicalModels = mongoTemplate.find(query, BabyNeuroPsychologicalModel.class); | |
5992 | + String developmentQuotient = ""; | |
5993 | + if (CollectionUtils.isNotEmpty(babyNeuroPsychologicalModels)) { | |
5994 | + BabyNeuroPsychologicalModel model = babyNeuroPsychologicalModels.get(0); | |
5995 | + developmentQuotient = model.getDevelopmentQuotient().toString(); | |
5996 | + } | |
5997 | + | |
5998 | + HashMap<String, String> map = new HashMap<>(); | |
5999 | + map.put("percentileScore", percentileScore); | |
6000 | + map.put("abnormalSize", abnormalSize); | |
6001 | + map.put("okSize", okSize); | |
6002 | + map.put("developmentQuotient", developmentQuotient); | |
6003 | + BaseResponse response = new BaseResponse(); | |
6004 | + response.setObject(map); | |
6005 | + return response; | |
6006 | + } | |
5962 | 6007 | } |