package com.zzsmart.qomo.kn.cost.manage.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsmart.qomo.kn.cost.manage.service.CostStandardDetailService;
import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardService;
import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO;
import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 标准成本明细表 前端控制器
 * </p>
 *
 * @author cost_purchase_price
 * @since 2024-06-19
 */
@Api(tags="标准成本单行查询")
@RestController
@RequestMapping("//costStandardDetail")
@Slf4j
public class CostStandardDetailController {
    @Autowired
    private CostStandardDetailService costStandardDetailService;

    /**
     * 分页列表查询
     *
     * @param costStandard
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "cost_standard-分页列表查询")
    @ApiOperation(value="cost_standard_detail-分页列表查询", notes="cost_standard_detail-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<CostStandardDetailVO>> queryPageList(CostStandardDetailVO costStandard,
                                                                @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                                @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                                                HttpServletRequest req) {

        Page<CostStandardDetailVO> page = new Page<CostStandardDetailVO>(pageNo, pageSize);
        IPage<CostStandardDetailVO> pageList = costStandardDetailService.pageList(page, costStandard);
        return Result.OK(pageList);
    }
}
