package com.tofly.watermeter.custom.controller.meterBusiness;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.watermeter.custom.entity.meterBusiness.dto.StatisticalFormDto;
import com.tofly.watermeter.custom.service.meterBusiness.StatisticalFormService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@AllArgsConstructor
@RequestMapping("/statisticalForm")
@Api(tags = "表务管理--统计查询")
public class StatisticalFormContrlller {

    private final StatisticalFormService statisticalFormService;


    @GetMapping("/outboundCount")
    @ApiOperation("出库-厂家统计-第一层")
    public ResultRespone outboundCount(HttpServletResponse response, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.outboundCount(response, dto));
    }

    @GetMapping("/outboundByCal")
    @ApiOperation("出库-口径统计-第二层")
    public ResultRespone outboundByCal(HttpServletResponse response, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.outboundByCal(response, dto));
    }

    @GetMapping("/outboundInfo")
    @ApiOperation("出库-详情查询-第三层")
    public ResultRespone  outboundInfo(HttpServletResponse response, Page page, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.outboundInfo(response, page, dto));
    }

    @GetMapping("/changeTableCount")
    @ApiOperation("换表-厂家统计-第一层")
    public ResultRespone changeTableCount(HttpServletResponse response, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.changeTableCount(response, dto));
    }

    @GetMapping("/changeTableByCal")
    @ApiOperation("换表-口径统计-第二层")
    public ResultRespone changeTableByCal(HttpServletResponse response, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.changeTableByCal(response, dto));
    }

    @GetMapping("/changeTableInfo")
    @ApiOperation("换表-详情查询-第三层")
    public ResultRespone changeTableInfo(HttpServletResponse response, Page page, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.changeTableInfo(response, page, dto));
    }

    @GetMapping("/scrapCount")
    @ApiOperation("报废-厂家统计-第一层")
    public ResultRespone scrapCount(HttpServletResponse response, StatisticalFormDto dto) {
        return ResultRespone.success(statisticalFormService.scrapCount(response, dto));
    }

    @GetMapping("/scrapByCal")
    @ApiOperation("报废-口径统计-第二层")
    public ResultRespone scrapByCal(HttpServletResponse response, StatisticalFormDto dto){
        return ResultRespone.success(statisticalFormService.scrapByCal(response, dto));
    }

    @GetMapping("/scrapInfo")
    @ApiOperation("报废-详情查询-第三层")
    public ResultRespone scrapInfo(HttpServletResponse response, Page page, StatisticalFormDto dto){
        return ResultRespone.success(statisticalFormService.scrapInfo(response, page, dto));
    }

    @GetMapping("/disputeCount")
    @ApiOperation("争议-厂家统计-第一层")
    public ResultRespone disputeCount(HttpServletResponse response, StatisticalFormDto dto){
        return ResultRespone.success(statisticalFormService.disputeCount(response, dto));
    }

    @GetMapping("/disputeByCal")
    @ApiOperation("争议-口径统计-第二层")
    public ResultRespone disputeByCal(HttpServletResponse response, StatisticalFormDto dto){
        return ResultRespone.success(statisticalFormService.disputeByCal(response, dto));
    }

    @GetMapping("/disputeInfo")
    @ApiOperation("争议-口径统计-第三层")
    public ResultRespone disputeInfo(HttpServletResponse response, Page page, StatisticalFormDto dto){
        return ResultRespone.success(statisticalFormService.disputeInfo(response, page,dto));
    }

}
