From 66abc3ce8009e42790c073d752a9a36e022ed668 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 14 一月 2025 08:41:57 +0800 Subject: [PATCH] 修改bug --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java index 132a453..62ebf74 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java @@ -14,8 +14,10 @@ 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.vo.*; import com.ruoyi.other.api.domain.BaseSetting; @@ -33,6 +35,8 @@ 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.*; @@ -64,6 +68,8 @@ private OrderMapper orderMapper; @Resource private SysUserClient sysUserClient; + @Resource + private RefundPassService refundPassService; /** @@ -261,6 +267,10 @@ @ApiOperation(value = "查询订单详情", tags = {"管理后台-订单管理"}) public R<OrderInfoVo> getOrderInfo(@PathVariable("orderId") Long orderId){ OrderInfoVo orderInfo = orderService.getOrderInfo(orderId); + RefundPass refundPass = refundPassService.lambdaQuery().eq(RefundPass::getOrderId, orderId).one(); + if (refundPass!=null){ + orderInfo.setRefundPassId(refundPass.getId().toString()); + } return R.ok(orderInfo); } @@ -312,6 +322,10 @@ orderStatisticsDetail.setServiceTotal(serviceTotal); orderStatisticsDetail.setSingleTotal(singleTotal); orderStatisticsDetail.setTotal(total); + + orderStatisticsDetail.setServiceTotalMoney(serviceTotalMoney); + orderStatisticsDetail.setSingleTotalMoney(singleTotalMoney); + orderStatisticsDetail.setTotalMoney(totalMoney); orderStatisticsDetails.add(orderStatisticsDetail); }); Integer shopId = null; @@ -320,7 +334,17 @@ } 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); } -- Gitblit v1.7.1