| | |
| | | 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; |
| | |
| | | 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.*; |
| | |
| | | private OrderMapper orderMapper; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private RefundPassService refundPassService; |
| | | |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |