package com.fjhx.wms.controller.stock;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.wms.entity.stock.dto.StockWaitDto;
import com.fjhx.wms.entity.stock.dto.StockWaitSelectDto;
import com.fjhx.wms.entity.stock.vo.StockWaitVo;
import com.fjhx.wms.service.stock.StockWaitService;
import com.ruoyi.common.core.domain.BaseSelectDto;
import org.springframework.beans.factory.annotation.Autowired;
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;


/**
 * <p>
 * 待出入库 前端控制器
 * </p>
 *
 * @since 2023-03-22
 */
//@DS(SourceConstant.WMS)
@RestController
@RequestMapping("/stockWait")
public class StockWaitController {

    @Autowired
    private StockWaitService stockWaitService;

    /**
     * 待出入库分页
     */
    @PostMapping("/page")
    public Page<StockWaitVo> page(@RequestBody StockWaitSelectDto dto) {
        return stockWaitService.getPage(dto);
    }

    /**
     * 待出入库明细
     */
    @PostMapping("/detail")
    public StockWaitVo detail(@RequestBody BaseSelectDto dto) {
        return stockWaitService.detail(dto.getId());
    }

    /**
     * 待出入库新增
     */
    @PostMapping("/add")
    public void add(@RequestBody StockWaitDto stockWaitDto) {
        stockWaitService.add(stockWaitDto);
    }

}
