Commit 1d63a612a640467b6c107c6fb8145c727c54497b
1 parent
a17e002134
Exists in
master
and in
6 other branches
修复bug
Showing 1 changed file with 25 additions and 19 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
View file @
1d63a61
... | ... | @@ -152,10 +152,12 @@ |
152 | 152 | String neuroPsychologicalId = null; |
153 | 153 | // 智龄 |
154 | 154 | Integer mentalAge = 0; |
155 | + | |
156 | + // 当前本月的被勾选的总分数 | |
157 | + Double currentProjectVal = 0D; | |
155 | 158 | List<Map<String, Object>> mapList = new LinkedList<>(); |
156 | 159 | for (int i = 0, size = months.length; i < size ; i++) { |
157 | - // 当前本月的被勾选的总分数 | |
158 | - Double currentProjectVal = 0D; | |
160 | + | |
159 | 161 | int currentMonth = months[i]; |
160 | 162 | // 月龄对应的数据 |
161 | 163 | Map<String, Object> objectMap = new HashMap<>(); |
162 | 164 | |
163 | 165 | |
... | ... | @@ -200,30 +202,15 @@ |
200 | 202 | listGroupMaps.add(map); |
201 | 203 | } |
202 | 204 | |
203 | - int developmentQuotient = 0; | |
204 | - if (currentProjectVal > 0) { | |
205 | - mentalAge = new BigDecimal(currentProjectVal).divide(new BigDecimal(5), 0, BigDecimal.ROUND_HALF_UP).intValue(); | |
206 | - developmentQuotient = new BigDecimal(mentalAge).divide(new BigDecimal(checkMonth), 0, BigDecimal.ROUND_HALF_UP).intValue(); | |
207 | - developmentQuotient *= 100; | |
208 | - } | |
205 | + | |
209 | 206 | // 当前测试时月龄 |
210 | 207 | objectMap.put("checkMonth", checkMonth); |
211 | 208 | // 配置对应的月龄 |
212 | 209 | objectMap.put("month", currentMonth); |
213 | 210 | // 领域组 |
214 | 211 | objectMap.put("listGroup", listGroupMaps); |
215 | - BabyEvaluationCriterionModel criterionModel = mongoTemplate.findOne(Query.query(Criteria.where("type").is(2). | |
216 | - and("minBorder").lte(developmentQuotient).and("maxBorder").gte(developmentQuotient)), BabyEvaluationCriterionModel.class); | |
217 | - String aptitudeName = null,levelName = null; | |
218 | - if (criterionModel != null) { | |
219 | - aptitudeName = criterionModel.getAptitudeName(); | |
220 | - levelName = criterionModel.getLevelName(); | |
221 | - } | |
222 | - // 发育商、智能、等级评价 | |
223 | - objectMap.put("developmentQuotient", developmentQuotient); | |
224 | - objectMap.put("aptitudeName", aptitudeName); | |
225 | - objectMap.put("levelName", levelName); | |
226 | 212 | |
213 | + | |
227 | 214 | // 当前检查时间 |
228 | 215 | BabyNeuroPsychologicalModel one = mongoTemplate.findOne(Query.query( |
229 | 216 | Criteria.where("babyId").is(babyId).and("yn").is(YnEnums.YES.getId()).and("checkMonth").is(checkMonth)), BabyNeuroPsychologicalModel.class); |
... | ... | @@ -234,6 +221,25 @@ |
234 | 221 | |
235 | 222 | mapList.add(objectMap); |
236 | 223 | } |
224 | + int developmentQuotient = 0; | |
225 | + if (currentProjectVal > 0) { | |
226 | + mentalAge = new BigDecimal(currentProjectVal).divide(new BigDecimal(5), 0, BigDecimal.ROUND_HALF_UP).intValue(); | |
227 | + developmentQuotient = new BigDecimal(mentalAge).divide(new BigDecimal(checkMonth), 0, BigDecimal.ROUND_HALF_UP).intValue(); | |
228 | + developmentQuotient *= 100; | |
229 | + } | |
230 | + | |
231 | + // 发育商、智能、等级评价 | |
232 | + BabyEvaluationCriterionModel criterionModel = mongoTemplate.findOne(Query.query(Criteria.where("type").is(2). | |
233 | + and("minBorder").lte(developmentQuotient).and("maxBorder").gte(developmentQuotient)), BabyEvaluationCriterionModel.class); | |
234 | + String aptitudeName = null,levelName = null; | |
235 | + if (criterionModel != null) { | |
236 | + aptitudeName = criterionModel.getAptitudeName(); | |
237 | + levelName = criterionModel.getLevelName(); | |
238 | + } | |
239 | + resultMap.put("developmentQuotient", developmentQuotient); | |
240 | + resultMap.put("aptitudeName", aptitudeName); | |
241 | + resultMap.put("levelName", levelName); | |
242 | + | |
237 | 243 | resultMap.put("configs", mapList); |
238 | 244 | resultMap.put("id", neuroPsychologicalId); |
239 | 245 | return resultMap; |