Commit d796a950f664e84fc99175b14e73438853d854e6
1 parent
6baa29f30a
Exists in
master
and in
6 other branches
修复bug
Showing 2 changed files with 7 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/EvaluationCriterionNeuropsychologyListRequest.java
View file @
d796a95
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
View file @
d796a95
... | ... | @@ -374,8 +374,8 @@ |
374 | 374 | } |
375 | 375 | int developmentQuotient = 0; |
376 | 376 | if (val > 0) { |
377 | - int mentalAge = new BigDecimal(val.toString()).divide(new BigDecimal(5), 0, BigDecimal.ROUND_HALF_UP).intValue(); | |
378 | - developmentQuotient = new BigDecimal(mentalAge).divide(new BigDecimal(checkMonth), 0, BigDecimal.ROUND_HALF_UP).intValue(); | |
377 | + int mentalAge = new BigDecimal(val.toString()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP).intValue(); | |
378 | + developmentQuotient = new BigDecimal(mentalAge).divide(new BigDecimal(checkMonth), 2, BigDecimal.ROUND_HALF_UP).intValue(); | |
379 | 379 | developmentQuotient *= 100; |
380 | 380 | } |
381 | 381 | |
382 | 382 | |
... | ... | @@ -732,9 +732,12 @@ |
732 | 732 | } |
733 | 733 | |
734 | 734 | if (StringUtils.isNotEmpty(id)) { |
735 | - Integer month = DateUtil.getBabyAgeMonth(model.getBirth(), | |
735 | + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(babyId)), BabyModel.class); | |
736 | + if (babyModel == null) { | |
737 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("查无数据"); | |
738 | + } | |
739 | + Integer month = DateUtil.getBabyAgeMonth(babyModel.getBirth(), | |
736 | 740 | mongoTemplate.findOne(Query.query(Criteria.where("_id").is(id)), ExerciseAppraisalModel.class).getCreateTime()); |
737 | - //Integer currentMonth = getCurrentMonth(month, 3, 1); | |
738 | 741 | model.setCreateUser(null); |
739 | 742 | model.setCreateTime(null); |
740 | 743 | model.setBirth(null); |