From 8b7154d09982cd02d3ab005ea1eb42841fc9373d Mon Sep 17 00:00:00 2001 From: dongqin <123456> Date: Fri, 2 Aug 2019 11:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BabyEvaluationCriterionServiceImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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); -- 1.8.3.1