package com.xinelu.manage.controller.orderstatistics;

import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.service.orderstatistics.OrderStatisticsService;
import com.xinelu.manage.vo.orderstatistics.OrderStatisticsVO;
import org.springframework.security.access.prepost.PreAuthorize;
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;

/**
 * 预约服务订单订单统计
 *
 * @author zh
 * @date 2023-11-27
 */
@RestController
@RequestMapping("/system/orderStatistics")
public class OrderStatisticsController extends BaseController {

    @Resource
    private OrderStatisticsService orderStatisticsService;

    /**
     * 查询预约服务订单数量及销售额
     */
    @PreAuthorize("@ss.hasPermi('system:orderStatistics:list')")
    @GetMapping("/list")
    public TableDataInfo list() {
        startPage();
        List<OrderStatisticsVO> list = orderStatisticsService.selectAppointmentOrderCount();
        return getDataTable(list);
    }
}