| | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | orderStatisticsDetail.setServiceTotal(serviceTotal); |
| | | orderStatisticsDetail.setSingleTotal(singleTotal); |
| | | orderStatisticsDetail.setTotal(total); |
| | | |
| | | orderStatisticsDetail.setServiceTotalMoney(serviceTotalMoney); |
| | | orderStatisticsDetail.setSingleTotalMoney(singleTotalMoney); |
| | | orderStatisticsDetail.setTotalMoney(totalMoney); |
| | | orderStatisticsDetails.add(orderStatisticsDetail); |
| | | }); |
| | | Integer shopId = null; |
| | |
| | | } |
| | | OrderStatistics orderStatistics = orderMapper.getOrderStatistics(startTime, endTime, shopId); |
| | | if(null != orderStatistics){ |
| | | orderStatistics.setOrderStatisticsDetailList(orderStatisticsDetails); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<OrderStatisticsDetail> sortedDetails = orderStatisticsDetails.stream() |
| | | .sorted(Comparator.comparing((OrderStatisticsDetail detail) -> { |
| | | try { |
| | | return dateFormat.parse(detail.getDate()); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }).reversed()) |
| | | .collect(Collectors.toList()); |
| | | orderStatistics.setOrderStatisticsDetailList(sortedDetails); |
| | | } |
| | | return R.ok(orderStatistics); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/getAppUserByShoppingShop") |
| | | public R<Set<Long>> getAppUserByShoppingShop(@RequestParam("shopId") Integer shopId){ |
| | | List<Order> list = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getShopId, shopId).eq(Order::getDelFlag, 0).eq(Order::getPayStatus, 2).in(Order::getOrderStatus, Arrays.asList(1, 2, 3, 4, 7, 8))); |
| | | List<Order> list = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getShopId, shopId).eq(Order::getDelFlag, 0) |
| | | .eq(Order::getPayStatus, 2).in(Order::getOrderStatus, Arrays.asList(1, 2, 3, 4, 7, 8))); |
| | | Set<Long> collect = list.stream().map(Order::getAppUserId).collect(Collectors.toSet()); |
| | | return R.ok(collect); |
| | | } |