IndexController.java
2.37 KB
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
package com.order.erp.controller;
import com.order.erp.common.constant.ServerResult;
import com.order.erp.domain.OrderStatusEnum;
import com.order.erp.domain.dto.order.QuerySalesStatisticeDO;
import com.order.erp.domain.vo.IndexDataVO;
import com.order.erp.domain.vo.order.DateTimeVO;
import com.order.erp.service.order.OrderBaseInfoService;
import com.order.erp.service.order.OrderCompletionReportService;
import com.order.erp.service.order.OrderInspectionStageService;
import com.order.erp.service.order.OrderProfitAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @author zhongnanhuang
* @version 1.0
* @project order-erp
* @description 首页
* @date 2023/10/23 16:44:55
*/
@Api(tags = "首页")
@RestController
@RequestMapping("/order/erp/index")
public class IndexController {
@Resource
OrderBaseInfoService orderBaseInfoService;
@GetMapping("/data")
@ApiOperation("首页统计数据")
public ServerResult getData(DateTimeVO dateTimeVO){ return orderBaseInfoService.countByYear(dateTimeVO);}
@GetMapping("/chartData")
@ApiOperation("首页订单趋势")
public ServerResult getChartData(DateTimeVO dateTimeVO){
//订单趋势数据
// List<Map<String,Integer>> chartData = orderBaseInfoService.countDaysOrder();
return orderBaseInfoService.countByDate(dateTimeVO);
}
@GetMapping("/totalSalesStatistics")
@ApiOperation("销售额完成情况")
public ServerResult totalSalesStatistics(QuerySalesStatisticeDO querySalesStatisticeDO){
//订单趋势数据
Map<String, String> chartData = orderBaseInfoService.totalSalesStatistics(querySalesStatisticeDO);
return ServerResult.success(chartData);
}
@GetMapping("/salesStatusEveryCustomer")
@ApiOperation("每个客户销售额情况")
public ServerResult salesStatusEveryCustomer(QuerySalesStatisticeDO querySalesStatisticeDO){
//订单趋势数据
Map<String, Map<String, Double>> chartData = orderBaseInfoService.salesStatusEveryCustomer(querySalesStatisticeDO);
return ServerResult.success(chartData);
}
}