| | |
| | | import com.ruoyi.order.enums.OrderStatus; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import com.ruoyi.order.util.payment.model.RefundCallbackResult; |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.vo.*; |
| | |
| | | private OrderMapper orderMapper; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private RefundPassService refundPassService; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "String"), |
| | | }) |
| | | @GetMapping("/writeOff/{id}/{shopId}") |
| | | public R<Void> writeOff(@PathVariable("id") String id, @PathVariable("shopId") Integer shopId){ |
| | | orderService.writeOff(id, shopId); |
| | | @GetMapping("/writeOff") |
| | | public R<Void> writeOff(String code, Integer shopId, String technicianId){ |
| | | orderService.writeOff(code, shopId, technicianId); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @PostMapping("/byUserId") |
| | | public R<List<Order>> byUserId(@RequestParam("appUserId") Long appUserId){ |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).list()); |
| | | public R<List<Order>> byUserId(@RequestParam("appUserId") Long appUserId,@RequestParam("shopId") Long shopId){ |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).eq(Order::getShopId, shopId).list()); |
| | | } |
| | | @PostMapping("/byShopId") |
| | | public R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId){ |
| | | return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).list()); |
| | | return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).in(Order::getOrderStatus,4,7,8).list()); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/confirmDelivery") |
| | | @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"}) |
| | | public R confirmDelivery(@RequestBody ConfirmDelivery confirmDelivery){ |
| | | return orderService.confirmDelivery(confirmDelivery.getOrderId(), confirmDelivery.getCode()); |
| | | return orderService.confirmDelivery(confirmDelivery); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "查询订单详情", tags = {"管理后台-订单管理"}) |
| | | public R<OrderInfoVo> getOrderInfo(@PathVariable("orderId") Long orderId){ |
| | | OrderInfoVo orderInfo = orderService.getOrderInfo(orderId); |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderId) |
| | | .eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | if (one!=null){ |
| | | orderInfo.setRefundPassId(one.getId().toString()); |
| | | } |
| | | return R.ok(orderInfo); |
| | | } |
| | | |
| | |
| | | .orderByAsc(Order::getCreateTime)); |
| | | |
| | | |
| | | Map<String, List<Order>> map = orderList.stream().collect(Collectors.groupingBy(item -> item.getCreateTime() |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))); |
| | | Map<String, List<Order>> map = orderList.stream() |
| | | .collect(Collectors.groupingBy( |
| | | item -> item.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")), |
| | | TreeMap::new, // 使用 TreeMap 按键排序 |
| | | Collectors.toList() |
| | | )); |
| | | |
| | | List<OrderStatisticsDetail> orderStatisticsDetails = new ArrayList<>(); |
| | | map.forEach((key, value) -> { |
| | |
| | | if (order.getOrderType().equals(1)) { |
| | | serviceTotal++; |
| | | serviceTotalMoney = serviceTotalMoney.add(order.getPaymentAmount()); |
| | | }else if (order.getOrderType().equals(2)){ |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | }else if (order.getOrderType().equals(2) && 1 == order.getDistributionMode()){ |
| | | singleTotal++; |
| | | singleTotalMoney = singleTotalMoney.add(order.getPaymentAmount()); |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | } |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | } |
| | | orderStatisticsDetail.setDate(key); |
| | | orderStatisticsDetail.setServiceTotal(serviceTotal); |
| | |
| | | */ |
| | | @PostMapping("/getGoodsSaleNum") |
| | | public R<Integer> getGoodsSaleNum(@RequestParam("goodsId") Integer goodsId, @RequestParam("type") Integer type){ |
| | | Integer goodsSaleNum = orderService.getGoodsSaleNum(goodsId, type); |
| | | Integer goodsSaleNum = orderService.getGoodsSaleNum(goodsId, type, null); |
| | | return R.ok(goodsSaleNum); |
| | | } |
| | | |