package com.fjhx.wms.controller.stock;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.fjhx.common.constant.SourceConstant;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.wms.entity.stock.vo.StockCheckDetailsVo;
import com.fjhx.wms.entity.stock.dto.StockCheckDetailsSelectDto;
import com.fjhx.wms.entity.stock.dto.StockCheckDetailsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.wms.service.stock.StockCheckDetailsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 库存盘点明细 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-03-22
 */
//@DS(SourceConstant.WMS)
@RestController
@RequestMapping("/stockCheckDetails")
public class StockCheckDetailsController {

    @Autowired
    private StockCheckDetailsService stockCheckDetailsService;

    /**
     * 库存盘点明细分页
     */
    @PostMapping("/page")
    public Page<StockCheckDetailsVo> page(@RequestBody StockCheckDetailsSelectDto dto) {
        return stockCheckDetailsService.getPage(dto);
    }

    /**
     * 库存盘点明细明细
     */
    @PostMapping("/detail")
    public StockCheckDetailsVo detail(@RequestBody BaseSelectDto dto) {
        return stockCheckDetailsService.detail(dto.getId());
    }

    /**
     * 库存盘点明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody StockCheckDetailsDto stockCheckDetailsDto) {
        stockCheckDetailsService.add(stockCheckDetailsDto);
    }

    /**
     * 库存盘点明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody StockCheckDetailsDto stockCheckDetailsDto) {
        stockCheckDetailsService.edit(stockCheckDetailsDto);
    }

    /**
     * 库存盘点明细删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        stockCheckDetailsService.delete(dto.getId());
    }

}
