package com.zjrs.zwnw.sxgl.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.mohrss.leaf.core.framework.persistens.PageResult;
import org.mohrss.leaf.core.framework.web.controller.AjaxResponse;
import com.zjrs.zwnw.sxgl.bpo.YwltjBPO;
import com.zjrs.zwnw.sxgl.dto.YwltjQueryDTO;
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;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;

/**
 * @author chenjiebo
 * @date 2022/12/12 16:53
 **/
@Api("业务量统计")
@RestController
@RequestMapping("/api/sxgl/ywltj")
public class YwltjController {

    @Resource
    private YwltjBPO ywltjBPO;

    @ApiOperation(value = "业务量统计列表", notes = "业务量统计列表")
    @PostMapping("/queryYwltjList")
    public AjaxResponse queryYwltjList(@RequestBody YwltjQueryDTO dto) {
        AjaxResponse ajaxResponse = new AjaxResponse();
        PageResult pageResult = ywltjBPO.queryYwltjList(dto);
        ajaxResponse.setData("data", pageResult);
        ajaxResponse.setData("pagesize", dto.getPagesize());
        ajaxResponse.setData("pagenum", dto.getPagenum());
        return ajaxResponse;
    }

    @ApiOperation(value = "导出业务量统计", notes = "导出业务量统计")
    @PostMapping("/exportYwltjList")
    public void exportYwltjList(@RequestBody YwltjQueryDTO dto, HttpServletResponse res) {
        ywltjBPO.exportYwltjList(dto,res);
    }
}
