Commit cee84156f436926b9c3a8e335fb364b73e30029d
1 parent
85456a5274
Exists in
master
and in
6 other branches
2
Showing 1 changed file with 3 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
cee8415
... | ... | @@ -228,18 +228,20 @@ |
228 | 228 | List<Map<String, Object>> restList = new ArrayList<>(); |
229 | 229 | List<BloodSugar> bloodSugars = mongoTemplate.find(Query.query(Criteria.where("parentId").is(parentId).and("bloodSugarType").is(type)).with(new Sort(Sort.Direction.DESC, "created")), BloodSugar.class); |
230 | 230 | Set<String> dayCountSet = new HashSet<>(); |
231 | + Set<String> monthCountSet = new HashSet<>(); | |
231 | 232 | for (BloodSugar bloodSugar : bloodSugars) { |
232 | 233 | if(bloodSugar.getBloodSugarType() == type) { |
233 | 234 | Map<String, Object> temp = new HashMap<>(); |
234 | 235 | temp.put("bloodSugar", bloodSugar.getBloodSugar()); |
235 | 236 | temp.put("craeted", DateUtil.getyyyy_MM_dd_hms(bloodSugar.getCreated())); |
237 | + temp.put("monthCountSet", DateUtil.getMonth(bloodSugar.getCreated())); | |
236 | 238 | temp.put("type", bloodSugar.getBloodSugarType()); |
237 | 239 | restList.add(temp); |
238 | 240 | |
239 | 241 | dayCountSet.add(DateUtil.getyyyy_MM_dd(bloodSugar.getCreated())); |
240 | 242 | } |
241 | 243 | } |
242 | - return RespBuilder.buildSuccess("restList", restList, "count", bloodSugars.size(), "dayCount", dayCountSet.size()); | |
244 | + return RespBuilder.buildSuccess("restList", restList, "count", bloodSugars.size(), "dayCount", dayCountSet.size(), "month", monthCountSet); | |
243 | 245 | } |
244 | 246 | |
245 | 247 | } |