package org.springblade.modules.app.web;


import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.dto.*;
import org.springblade.modules.app.common.query.StatBaseQuery;
import org.springblade.modules.app.entity.VerifyStationDTO;
import org.springblade.modules.app.manager.StatReportManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *   大屏统计报表 前端控制器
 * </p>
 *
 * @author zhangK
 * @since 2021-12-30
 */
@RestController
@RequestMapping("app/report")
@Api(value = "数据大屏", tags = "数据大屏")
public class StatReportController extends BaseController {

    @Autowired
    private StatReportManager statReportManager;

    //@ApiOperation(value = "热力图统计（头部）")
    @GetMapping("/stat/heat/top")
    public ResponseEntity<ResultDTO<StatHeatMapTopDTO>> statHeatMapTop(StatBaseQuery query) {
        return success(statReportManager.statHeatMapTop(query));
    }

    //@ApiOperation(value = "热力图统计（中间）")
    @GetMapping("/stat/heat/mid")
    public ResponseEntity<ResultDTO<List<StatHeatMapMidDTO>>> statHeatMapMid(StatBaseQuery query) {
        return success(statReportManager.statHeatMapMid(query));
    }

    //@ApiOperation(value = "热力图统计（尾部）")
    @GetMapping("/stat/heat/foot")
    public ResponseEntity<ResultDTO<StatHeatMapFootDTO>> statHeatMapFoot(StatBaseQuery query) {
        return success(statReportManager.statHeatMapFoot(query));
    }

    //@ApiOperation(value = "预备订单列表")
    @GetMapping("/stat/heat/foot/prep")
    public ResponseEntity<ResultDTO<List<StatWaybillDTO>>> prepList(StatBaseQuery query) {
        return success(statReportManager.prepList(query));
    }

    //@ApiOperation(value = "在途中订单列表")
    @GetMapping("/stat/heat/foot/way")
    public ResponseEntity<ResultDTO<List<StatWaybillDTO>>> wayList(StatBaseQuery query) {
        return success(statReportManager.wayList(query));
    }

    //@ApiOperation(value = "已交付订单列表")
    @GetMapping("/stat/heat/foot/finish")
    public ResponseEntity<ResultDTO<List<StatWaybillDTO>>> finishList(StatBaseQuery query) {
        return success(statReportManager.finishList(query));
    }

    //@ApiOperation(value = "供浙养殖场调运量统计")
    @GetMapping("/stat/saler")
    public ResponseEntity<ResultDTO<List<StatBySalerDTO>>> statBySaler(StatBaseQuery query) {
        return success(statReportManager.statBySaler(query));
    }

    //@ApiOperation(value = "供浙经纪人调运量统计")
    @GetMapping("/stat/agent")
    public ResponseEntity<ResultDTO<List<StatByAgentUserDTO>>> statByAgent(StatBaseQuery query) {
        return success(statReportManager.statByAgent(query));
    }

    //@ApiOperation(value = "省内屠宰场调运量统计")
    @GetMapping("/stat/buyer")
    public ResponseEntity<ResultDTO<List<StatByBuyerDTO>>> statByBuyer(StatBaseQuery query) {
        return success(statReportManager.statByBuyer(query));
    }

    //@ApiOperation(value = "实时异常订单统计")
    @GetMapping("/stat/exp")
    public ResponseEntity<ResultDTO<List<StatExpOrderDTO>>> statExpOrder(StatBaseQuery query) {
        return success(statReportManager.statExpOrder(query));
    }

    //@ApiOperation(value = "违规统计")
    @GetMapping("/stat/violation")
    public ResponseEntity<ResultDTO<List<StatViolationDTO>>> statViolation(StatBaseQuery query) {
        return success(statReportManager.statViolation(query));
    }

    //@ApiOperation(value = "供浙生猪检疫站统计")
    @GetMapping("/stat/verify")
    public ResponseEntity<ResultDTO<List<VerifyStationDTO>>> verify(StatBaseQuery query) {
        return success(statReportManager.verify(query));
    }
}

