package com.hys.app.controller.erp.use;

import com.hys.app.framework.database.WebPage;
import com.hys.app.model.erp.dto.WarehouseOutItemQueryParams;
import com.hys.app.model.erp.vo.WarehouseOutItemV1;
import com.hys.app.model.erp.vo.WarehouseOutItemVO;
import com.hys.app.service.erp.WarehouseOutItemManager;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * 出库单明细相关API
 *
 * @author 张崧
 * @since 2023-12-07 17:06:32
 */
@RestController
@RequestMapping("/admin/erp/warehouseOutItem")
@Api(tags = "出库单商品明细相关API")
@Validated
public class WarehouseOutItemController {

    @Autowired
    private WarehouseOutItemManager warehouseOutItemManager;

    @ApiOperation(value = "分页列表")
    @PostMapping("/query")
    public WebPage<WarehouseOutItemV1> list( WarehouseOutItemQueryParams request) {
        Long count=warehouseOutItemManager.selectCount(request);
        List<WarehouseOutItemV1> list=warehouseOutItemManager.selectList(request);
        WebPage<WarehouseOutItemV1> webPage=new WebPage<>();
        webPage.setData(list);
        webPage.setPageNo(request.getPageNo());
        webPage.setPageSize(request.getPageSize());
        webPage.setDataTotal(count);
        return webPage;
    }





}

