yanderong
2026-06-24 851d4aacc5d7bebdfddcd7d279a8136e34a5c261
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package com.stylefeng.guns.modular.system.controller.specialTrain;
 
import com.aliyun.oss.ServiceException;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.modular.system.response.*;
import com.stylefeng.guns.modular.system.service.TOrderStatisticsService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
 
import java.util.List;
 
/**
 * 订单相关统计,可视化数据
 *
 * @author Lux
 * @version 1.0.0
 * @since 2026/6/22 11:30
 */
@Slf4j
@AllArgsConstructor
@Controller
@RequestMapping("/tOrderStatistics")
public class TOrderStatisticsController extends BaseController {
 
    private final TOrderStatisticsService orderStatisticsService;
 
    /**
     * 年度趋势统计
     */
    @ResponseBody
    @RequestMapping(value = "/annualTrend", method = RequestMethod.GET)
    public ResultUtil annualTrend(String year) {
        try {
            List<TOrderStatisticsAnnualTrendVo> annualTrendList = orderStatisticsService.annualTrendStatistics(year);
            return ResultUtil.success(annualTrendList);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
    /**
     * 总体订单统计
     */
    @ResponseBody
    @RequestMapping(value = "/totalOrder", method = RequestMethod.GET)
    public ResultUtil totalOrder(String startDate, String endDate) {
        try {
            TOrderStatisticsTotalOrderVo totalOrderVo = orderStatisticsService.totalOrderStatistics(startDate, endDate);
            return ResultUtil.success(totalOrderVo);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
    /**
     * 新增乘客统计
     */
    @ResponseBody
    @RequestMapping(value = "/newAddPassenger", method = RequestMethod.GET)
    public ResultUtil newAddPassenger(Integer type) {
        try {
            List<TOrderStatisticsCountVo> countVos = orderStatisticsService.newAddPassengerStatistics(type);
            return ResultUtil.success(countVos);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
    /**
     * 订单量统计
     */
    @ResponseBody
    @RequestMapping(value = "/orderCount", method = RequestMethod.GET)
    public ResultUtil orderCount(Integer type) {
        try {
            List<TOrderStatisticsCountVo> countVos = orderStatisticsService.orderCountStatistics(type);
            return ResultUtil.success(countVos);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
    /**
     * 当日各时段统计
     */
    @ResponseBody
    @RequestMapping(value = "/orderDayHourCount", method = RequestMethod.GET)
    public ResultUtil orderDayHourCount(Integer startHour, Integer endHour) {
        try {
            List<TOrderStatisticsCountVo> countVos = orderStatisticsService.orderDayHourCount(startHour, endHour);
            return ResultUtil.success(countVos);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
    /**
     * 司机接单排名统计
     */
    @ResponseBody
    @RequestMapping(value = "/driverCar", method = RequestMethod.GET)
    public ResultUtil driverCar(Integer type) {
        try {
            List<TOrderStatisticsCarVo> countVos = orderStatisticsService.driverCarStatistics(type);
            return ResultUtil.success(countVos);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
    /**
     * 司机接单排名统计
     */
    @ResponseBody
    @RequestMapping(value = "/passenger", method = RequestMethod.GET)
    public ResultUtil passenger(Integer type) {
        try {
            List<TOrderStatisticsPassengerVo> countVos = orderStatisticsService.passengerStatistics(type);
            return ResultUtil.success(countVos);
        } catch (ServiceException e) {
            log.error("可视化数据统计异常", e);
            return ResultUtil.error(e.getErrorMessage());
        }
    }
 
}