Commit 8b7154d09982cd02d3ab005ea1eb42841fc9373d
1 parent
8c0f96b98f
Exists in
master
and in
6 other branches
修复bug
Showing 1 changed file with 8 additions and 8 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
View file @
8b7154d
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 | * @param babyId |
55 | 55 | * @return |
56 | 56 | */ |
57 | - public BaseResponse getItemListByBabyId(String babyId, Integer checkMonth) { | |
57 | + public BaseResponse getItemListByBabyId(String babyId, Integer checkMonth, String id) { | |
58 | 58 | Map<String, Object> stringObjectMap = new HashMap<>(); |
59 | 59 | int [] months = null; |
60 | 60 | if (StringUtils.isNotEmpty(babyId)) { |
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 | months = new int[]{month1, month2, month3}; |
109 | 109 | } |
110 | 110 | } |
111 | - stringObjectMap = getListMap(months, babyId, checkMonth); | |
111 | + stringObjectMap = getListMap(months, babyId, checkMonth, id); | |
112 | 112 | } |
113 | 113 | } |
114 | 114 | BaseResponse baseResponse = new BaseResponse(); |
... | ... | @@ -153,7 +153,7 @@ |
153 | 153 | * @param checkMonth |
154 | 154 | * @return |
155 | 155 | */ |
156 | - private Map<String, Object> getListMap(int [] months, String babyId, Integer checkMonth) { | |
156 | + private Map<String, Object> getListMap(int [] months, String babyId, Integer checkMonth, String id) { | |
157 | 157 | Map<String, Object> resultMap = new HashMap<>(); |
158 | 158 | String neuroPsychologicalId = null; |
159 | 159 | // 智龄 |
160 | 160 | |
... | ... | @@ -180,13 +180,13 @@ |
180 | 180 | List<Map<String, Object>> list = new LinkedList<>(); |
181 | 181 | while (iterator.hasNext()) { |
182 | 182 | BabyEvaluationCriterionModel next = iterator.next(); |
183 | - final String id = next.getId(); | |
183 | + final String configId = next.getId(); | |
184 | 184 | boolean isSelected = false; |
185 | 185 | Double projectVal = next.getProjectVal(); |
186 | 186 | if (checkMonth != null) { |
187 | 187 | BabyNeuroPsychologicalModel one = mongoTemplate.findOne(Query.query( |
188 | - Criteria.where("configId").in(new ArrayList<String>(){{add(id);}}). | |
189 | - and("babyId").is(babyId).and("yn").is(YnEnums.YES.getId()).and("checkMonth").is(checkMonth)), BabyNeuroPsychologicalModel.class); | |
188 | + Criteria.where("configId").in(new ArrayList<String>(){{add(configId);}}). | |
189 | + and("_id").is(id)), BabyNeuroPsychologicalModel.class); | |
190 | 190 | if (one != null) { |
191 | 191 | isSelected = true; |
192 | 192 | if (neuroPsychologicalId == null) { |
... | ... | @@ -275,7 +275,7 @@ |
275 | 275 | |
276 | 276 | // 若该儿童做过该项检查,一次查出 |
277 | 277 | for (BabyNeuroPsychologicalModel model : models) { |
278 | - BaseResponse itemListByBabyId = getItemListByBabyId(model.getBabyId(), model.getCheckMonth()); | |
278 | + BaseResponse itemListByBabyId = getItemListByBabyId(model.getBabyId(), model.getCheckMonth(), model.getId()); | |
279 | 279 | if (itemListByBabyId.getErrorcode() != 0) { |
280 | 280 | // 出错直接return |
281 | 281 | return itemListByBabyId; |
... | ... | @@ -300,7 +300,7 @@ |
300 | 300 | } |
301 | 301 | |
302 | 302 | // 根据当前儿童显示项目领域的配置信息,以供save |
303 | - Map<String, Object> objectMap = (Map<String, Object>) getItemListByBabyId(babyId, checkMonth).getObject(); | |
303 | + Map<String, Object> objectMap = (Map<String, Object>) getItemListByBabyId(babyId, checkMonth, null).getObject(); | |
304 | 304 | objectMap.put("checkTimeStr", ""); |
305 | 305 | objectMap.put("checkMonth", checkMonthStr); |
306 | 306 | objectList.add(objectMap); |