| | |
| | | public R<UserStatisticsDetail> statisticsDetail(@ApiParam(value = "用户id") Long userId) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | Integer shopId = null; |
| | | Set<Long> userIds = null; |
| | | Integer shopId = 0; |
| | | Set<Long> userIds = new HashSet<>(); |
| | | if(null != userId){ |
| | | userIds = new HashSet<>(); |
| | | userIds.add(userId); |
| | |
| | | |
| | | } |
| | | UserStatisticsDetail userStatisticsDetail = appUserMapper.getUserStatisticsDetail(null, userIds); |
| | | List<Order> orderList = orderClient.getOrderByAppUserIdsAndWriteOffShop(shopId, userIds).getData(); |
| | | BigDecimal shopAmount = orderList.stream().map(Order::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | userStatisticsDetail.setShopAmount(shopAmount); |
| | | return R.ok(userStatisticsDetail); |
| | | } |
| | | |