diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java index 75f20ea..3b73ed7 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java @@ -54,7 +54,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri * @param babyId * @return */ - public BaseResponse getItemListByBabyId(String babyId, Integer checkMonth) { + public BaseResponse getItemListByBabyId(String babyId, Integer checkMonth, String id) { Map stringObjectMap = new HashMap<>(); int [] months = null; if (StringUtils.isNotEmpty(babyId)) { @@ -108,7 +108,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri months = new int[]{month1, month2, month3}; } } - stringObjectMap = getListMap(months, babyId, checkMonth); + stringObjectMap = getListMap(months, babyId, checkMonth, id); } } BaseResponse baseResponse = new BaseResponse(); @@ -153,7 +153,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri * @param checkMonth * @return */ - private Map getListMap(int [] months, String babyId, Integer checkMonth) { + private Map getListMap(int [] months, String babyId, Integer checkMonth, String id) { Map resultMap = new HashMap<>(); String neuroPsychologicalId = null; // 智龄 @@ -180,13 +180,13 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri List> list = new LinkedList<>(); while (iterator.hasNext()) { BabyEvaluationCriterionModel next = iterator.next(); - final String id = next.getId(); + final String configId = next.getId(); boolean isSelected = false; Double projectVal = next.getProjectVal(); if (checkMonth != null) { BabyNeuroPsychologicalModel one = mongoTemplate.findOne(Query.query( - Criteria.where("configId").in(new ArrayList(){{add(id);}}). - and("babyId").is(babyId).and("yn").is(YnEnums.YES.getId()).and("checkMonth").is(checkMonth)), BabyNeuroPsychologicalModel.class); + Criteria.where("configId").in(new ArrayList(){{add(configId);}}). + and("_id").is(id)), BabyNeuroPsychologicalModel.class); if (one != null) { isSelected = true; if (neuroPsychologicalId == null) { @@ -275,7 +275,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri // 若该儿童做过该项检查,一次查出 for (BabyNeuroPsychologicalModel model : models) { - BaseResponse itemListByBabyId = getItemListByBabyId(model.getBabyId(), model.getCheckMonth()); + BaseResponse itemListByBabyId = getItemListByBabyId(model.getBabyId(), model.getCheckMonth(), model.getId()); if (itemListByBabyId.getErrorcode() != 0) { // 出错直接return return itemListByBabyId; @@ -300,7 +300,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri } // 根据当前儿童显示项目领域的配置信息,以供save - Map objectMap = (Map) getItemListByBabyId(babyId, checkMonth).getObject(); + Map objectMap = (Map) getItemListByBabyId(babyId, checkMonth, null).getObject(); objectMap.put("checkTimeStr", ""); objectMap.put("checkMonth", checkMonthStr); objectList.add(objectMap);