Commit 2ffa98d2e3bf58d8935975bce980f93945de688a
1 parent
1d63a612a6
Exists in
master
and in
6 other branches
修复bug
Showing 1 changed file with 14 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
View file @
2ffa98d
| ... | ... | @@ -285,6 +285,8 @@ |
| 285 | 285 | List<BabyNeuroPsychologicalModel> models = mongoTemplate.find(Query.query(Criteria.where("babyId").is(babyId).and("hospitalId").is(hospitalId).and("yn").is(YnEnums.YES.getId())). |
| 286 | 286 | with(new Sort(new Sort.Order(Sort.Direction.ASC, "createTime"))), BabyNeuroPsychologicalModel.class); |
| 287 | 287 | List<Object> objectList = new ArrayList<>(); |
| 288 | + Integer checkMonth = null; | |
| 289 | + String checkMonthStr = ""; | |
| 288 | 290 | if (CollectionUtils.isNotEmpty(models)) { |
| 289 | 291 | |
| 290 | 292 | // 若该儿童做过该项检查,一次查出 |
| ... | ... | @@ -295,6 +297,12 @@ |
| 295 | 297 | return itemListByBabyId; |
| 296 | 298 | } |
| 297 | 299 | Map<String, Object> objectMap = (Map<String, Object>) itemListByBabyId.getObject(); |
| 300 | + objectMap.put("checkTimeStr", DateUtil.getyyyy_MM_dd(model.getCreateTime())); | |
| 301 | + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("id").is(babyId)), BabyModel.class); | |
| 302 | + if (babyModel != null) { | |
| 303 | + checkMonthStr = DateUtil.getBabyMonthAge(babyModel.getBirth(), model.getCreateTime()); | |
| 304 | + } | |
| 305 | + objectMap.put("checkMonth", checkMonthStr); | |
| 298 | 306 | objectList.add(objectMap); |
| 299 | 307 | } |
| 300 | 308 | |
| ... | ... | @@ -303,7 +311,9 @@ |
| 303 | 311 | } else { |
| 304 | 312 | |
| 305 | 313 | // 根据当前儿童显示项目领域的配置信息,以供save |
| 306 | - Map<String, Object> objectMap = (Map<String, Object>) getItemListByBabyId(babyId, null).getObject(); | |
| 314 | + Map<String, Object> objectMap = (Map<String, Object>) getItemListByBabyId(babyId, checkMonth).getObject(); | |
| 315 | + objectMap.put("checkTimeStr", ""); | |
| 316 | + objectMap.put("checkMonth", checkMonthStr); | |
| 307 | 317 | objectList.add(objectMap); |
| 308 | 318 | baseResponse.setObject(objectList); |
| 309 | 319 | return baseResponse; |
| ... | ... | @@ -336,8 +346,9 @@ |
| 336 | 346 | // 更新 |
| 337 | 347 | update(userId, configId, id); |
| 338 | 348 | } else { |
| 339 | - BabyNeuroPsychologicalModel model = mongoTemplate.findOne(Query.query(Criteria.where("babyId").is(babyId).and("checkMonth").is(checkMonth).and("yn").is(YnEnums.YES.getId())), | |
| 340 | - BabyNeuroPsychologicalModel.class); | |
| 349 | + | |
| 350 | + BabyNeuroPsychologicalModel model = mongoTemplate.findOne(Query.query(Criteria.where("babyId").is(babyId).and("createTime") | |
| 351 | + .gte(DateUtil.getDayFirstSecond(new Date())).lte(DateUtil.getDayLastSecond(new Date())).and("yn").is(YnEnums.YES.getId())), BabyNeuroPsychologicalModel.class); | |
| 341 | 352 | if (model != null) { |
| 342 | 353 | // 更新 |
| 343 | 354 | update(userId, configId, model.getId()); |