Commit c47449184955cd2779753c08b88fe4bbd9649952
1 parent
19eb251eee
Exists in
master
and in
6 other branches
update code
Showing 1 changed file with 15 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
c474491
... | ... | @@ -194,6 +194,7 @@ |
194 | 194 | @Override |
195 | 195 | public BaseResponse info(String parentId, Integer type, Date time) { |
196 | 196 | List<Map<Object, Object>> tabList = new ArrayList<>(); |
197 | + List<DiabetesRecordResult> diabetesList = new ArrayList<>(); | |
197 | 198 | List<String> betweenDay = DateUtil.getBetweenDay(time, 7); |
198 | 199 | Object[] xAxis = betweenDay.toArray(); |
199 | 200 | CollectionUtils.reverseArray(xAxis); |
... | ... | @@ -243,7 +244,20 @@ |
243 | 244 | tabList.add(temp); |
244 | 245 | } |
245 | 246 | } |
246 | - return RespBuilder.buildSuccess("tabList", tabList, "xAxis", xAxis, "minAxis", minAxis, "maxAxis", maxAxis, "bloodSugarAxis", bloodSugarAxis); | |
247 | + List<DiabetesRecordModel> recordModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(mongoUtil.getPid(parentId))), DiabetesRecordModel | |
248 | + .class); | |
249 | + if (CollectionUtils.isNotEmpty(recordModels)) | |
250 | + { | |
251 | + for(DiabetesRecordModel model : recordModels) | |
252 | + { | |
253 | + DiabetesRecordResult result = new DiabetesRecordResult(); | |
254 | + org.springframework.beans.BeanUtils.copyProperties(model, result); | |
255 | + result.setCreatedStr(DateUtil.getyyyy_MM_dd(model.getCreated())); | |
256 | + diabetesList.add(result); | |
257 | + } | |
258 | + } | |
259 | + | |
260 | + return RespBuilder.buildSuccess("tabList", tabList, "xAxis", xAxis, "minAxis", minAxis, "maxAxis", maxAxis, "bloodSugarAxis", bloodSugarAxis,"diabetesList",diabetesList); | |
247 | 261 | } |
248 | 262 | |
249 | 263 | @Override |