package com.ruoyi.order.controller.management;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.order.controller.management.dto.MgtOrderStaticsQuery;
|
import com.ruoyi.order.controller.management.vo.MgtOrderStaticsChartVO;
|
import com.ruoyi.order.controller.management.vo.MgtOrderStaticsVO;
|
import com.ruoyi.order.service.impl.MgtBusinessDataService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import javax.servlet.http.HttpServletResponse;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* @author mitao
|
* @date 2024/6/19
|
*/
|
@Api(tags = {"管理后台-工作台-业务数据统计"})
|
@RestController
|
@RequestMapping("/mgt/business-data")
|
@RequiredArgsConstructor
|
public class MgtBusinessDataController {
|
|
private final MgtBusinessDataService mgtBusinessDataService;
|
|
/**
|
* 获取业务数据统计
|
*
|
* @param query 订单统计查询对象
|
* @return MgtOrderStaticsVO
|
*/
|
|
@ApiOperation(value = "获取业务数据统计", notes = "获取业务数据统计")
|
@PostMapping("/get-overview")
|
public R<MgtOrderStaticsVO> getOverview(@Validated @RequestBody MgtOrderStaticsQuery query) {
|
return R.ok(mgtBusinessDataService.getOverview(query));
|
}
|
|
/**
|
* 获取图表数据
|
*
|
* @return MgtOrderStaticsChartVO
|
*/
|
@ApiOperation(value = "获取业务数据统计图表数据", notes = "获取业务数据统计图表数据")
|
@GetMapping("/get-chart")
|
public R<MgtOrderStaticsChartVO> getChart() {
|
return R.ok(mgtBusinessDataService.getChart());
|
}
|
|
/**
|
* 业务数据导出
|
*
|
* @param query
|
* @param response
|
*/
|
@ApiOperation("导出业务数据统计")
|
@PostMapping("/export")
|
public void exportBusinessData(@Validated @RequestBody MgtOrderStaticsQuery query,
|
HttpServletResponse response) {
|
mgtBusinessDataService.exportBusinessData(query, response);
|
}
|
}
|