package com.zjrs.zwnw.dbgl.controller;

import com.zjrs.zwnw.portal.bpo.CommonBPO;
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.dbgl.bpo.DbrwgzBPO;
import com.zjrs.zwnw.dbgl.dto.DbrwglDbrwQueryDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.validation.Valid;

@Api("督办任务跟踪")
@RestController
@RequestMapping("/api/dbrwgl/dbrwgz")
public class DbrwgzController {

    private static final Logger logger = LoggerFactory.getLogger(DbrwgzController.class);

    @Resource
    private DbrwgzBPO dbrwgzBPO;
    @Resource
    private CommonBPO commBPO;

    @ApiOperation(value = "督办任务跟踪列表", notes = "督办任务跟踪列表")
    @PostMapping(value = "/getDbrwgzList")
    public AjaxResponse getDbrwgzList(@RequestBody @Valid DbrwglDbrwQueryDTO dto){
        AjaxResponse ajaxResponse = new AjaxResponse();
        Integer pagenum = Math.toIntExact(dto.getPagenum());
        Integer pagesize = Math.toIntExact(dto.getPagesize());
        PageResult pageResult = dbrwgzBPO.getDbrwList(dto, pagenum, pagesize);
        ajaxResponse.setData("data", pageResult);
        ajaxResponse.setData("pagesize", pagesize);
        ajaxResponse.setData("pagenum", pagenum);
        return ajaxResponse;
    }

}
