Commit 48d76ab05561e802d509e4c5ff93c369857c4aa0
1 parent
923c6dd16d
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 20 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyStatisticsManagerController.java
View file @
48d76ab
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
| 8 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 9 | +import com.lyms.platform.common.result.BaseResponse; | |
| 9 | 10 | import com.lyms.platform.common.utils.*; |
| 10 | 11 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
| 11 | 12 | import com.lyms.platform.operate.web.facade.BabyStatisticsManagerFacade; |
| 12 | 13 | |
| ... | ... | @@ -212,10 +213,10 @@ |
| 212 | 213 | * @createTime 2017年01月09日 15时33分 |
| 213 | 214 | * @discription 体检月龄统计左边 |
| 214 | 215 | */ |
| 215 | - @TokenRequired | |
| 216 | + /* @TokenRequired | |
| 216 | 217 | @ResponseBody |
| 217 | 218 | @RequestMapping(value = "babyStatisticsManagerWeekAgeGroup", method = RequestMethod.POST, consumes = "application/json") |
| 218 | - public BaseListResponse babyStatisticsManagerWeekAgeGroup(HttpServletRequest httpServletRequest, @RequestBody BabyStatisticsManagerWeekAgeGroupRequest babyStatisticsManagerWeekAgeGroupRequest) { | |
| 219 | + public BaseListResponse babyStatisticsManagerWeekAgeGroup(HttpServletRequest httpServletRequest, @RequestBody BabyStatisticsManagerWeekAgeGroupRequest babyStatisticsManagerWeekAgeGroupRequest) { | |
| 219 | 220 | BaseListResponse baseListResponse; |
| 220 | 221 | try { |
| 221 | 222 | babyStatisticsManagerWeekAgeGroupRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); |
| 222 | 223 | |
| ... | ... | @@ -230,8 +231,14 @@ |
| 230 | 231 | ExceptionUtils.catchException(e, "babyStatisticsManagerWeekAgeGroup异常"); |
| 231 | 232 | } |
| 232 | 233 | return baseListResponse; |
| 234 | + }*/ | |
| 235 | + @TokenRequired | |
| 236 | + @ResponseBody | |
| 237 | + @RequestMapping(value = "babyStatisticsManagerWeekAgeGroup", method = RequestMethod.POST, consumes = "application/json") | |
| 238 | + public BaseResponse babyStatisticsManagerWeekAgeGroup(HttpServletRequest httpServletRequest, @RequestBody BabyStatisticsManagerWeekAgeGroupRequest babyStatisticsManagerWeekAgeGroupRequest) { | |
| 239 | + babyStatisticsManagerWeekAgeGroupRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); | |
| 240 | + return babyStatisticsManagerFacade.babyStatisticsManagerWeekAgeGroup(babyStatisticsManagerWeekAgeGroupRequest); | |
| 233 | 241 | } |
| 234 | - | |
| 235 | 242 | /** |
| 236 | 243 | * @auther HuJiaqi |
| 237 | 244 | * @createTime 2017年01月09日 16时34分 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
View file @
48d76ab
| ... | ... | @@ -447,11 +447,16 @@ |
| 447 | 447 | |
| 448 | 448 | List<BabyStatisticsManagerWeekAgeGroupQueryModel> babyStatisticsManagerWeekAgeGroupQueryModelList = new ArrayList<>(); |
| 449 | 449 | |
| 450 | + Integer counts = 0; | |
| 450 | 451 | if (CollectionUtils.isNotEmpty(temp)) { |
| 451 | 452 | for (HashMap hashMap : temp) { |
| 452 | 453 | BabyStatisticsManagerWeekAgeGroupQueryModel babyStatisticsManagerWeekAgeGroupQueryModel = new BabyStatisticsManagerWeekAgeGroupQueryModel(); |
| 453 | 454 | babyStatisticsManagerWeekAgeGroupQueryModel.setWeekAge(hashMap.get("_id") == null ? null : hashMap.get("_id").toString()); |
| 454 | 455 | babyStatisticsManagerWeekAgeGroupQueryModel.setCount(hashMap.get("count").toString()); |
| 456 | + if(hashMap.get("count") !=null && !"0".equals(hashMap.get("count").toString())){ | |
| 457 | + counts += Integer.parseInt(hashMap.get("count").toString()); | |
| 458 | + } | |
| 459 | + | |
| 455 | 460 | babyStatisticsManagerWeekAgeGroupQueryModelList.add(babyStatisticsManagerWeekAgeGroupQueryModel); |
| 456 | 461 | } |
| 457 | 462 | } |
| ... | ... | @@ -508,8 +513,11 @@ |
| 508 | 513 | index++; |
| 509 | 514 | } |
| 510 | 515 | } |
| 511 | - | |
| 512 | - babyStatisticsManagerWeekAgeGroupResult.setData(babyStatisticsManagerWeekAgeGroupQueryModelListResult); | |
| 516 | + Map map = new HashMap(); | |
| 517 | +// babyStatisticsManagerWeekAgeGroupResult.setData(babyStatisticsManagerWeekAgeGroupQueryModelListResult); | |
| 518 | + map.put("babyStatisticsManagerWeekAgeGroupQueryModelListResult", babyStatisticsManagerWeekAgeGroupQueryModelListResult); | |
| 519 | + map.put("counts", counts); | |
| 520 | + babyStatisticsManagerWeekAgeGroupResult.setObject(map); | |
| 513 | 521 | babyStatisticsManagerWeekAgeGroupResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 514 | 522 | babyStatisticsManagerWeekAgeGroupResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
| 515 | 523 | return babyStatisticsManagerWeekAgeGroupResult; |