package com.fjhx.wms.controller.stock;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.wms.entity.stock.vo.StockWaitDetailsVo;
import com.fjhx.wms.entity.stock.dto.StockWaitDetailsSelectDto;
import com.fjhx.wms.entity.stock.dto.StockWaitDetailsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.wms.service.stock.StockWaitDetailsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 待出入库明细 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-13
 */
@RestController
@RequestMapping("/stockWaitDetails")
public class StockWaitDetailsController {

    @Autowired
    private StockWaitDetailsService stockWaitDetailsService;

    /**
     * 待出入库明细分页
     */
    @PostMapping("/page")
    public Page<StockWaitDetailsVo> page(@RequestBody StockWaitDetailsSelectDto dto) {
        return stockWaitDetailsService.getPage(dto);
    }

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

    /**
     * 待出入库明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody StockWaitDetailsDto stockWaitDetailsDto) {
        stockWaitDetailsService.add(stockWaitDetailsDto);
    }

    /**
     * 待出入库明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody StockWaitDetailsDto stockWaitDetailsDto) {
        stockWaitDetailsService.edit(stockWaitDetailsDto);
    }

    /**
     * 待出入库明细删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        stockWaitDetailsService.delete(dto.getId());
    }

}
