package com.fjhx.wms.controller.arrival;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.wms.entity.arrival.vo.ArrivalStockRecordsVo;
import com.fjhx.wms.entity.arrival.dto.ArrivalStockRecordsSelectDto;
import com.fjhx.wms.entity.arrival.dto.ArrivalStockRecordsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.wms.service.arrival.ArrivalStockRecordsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 采购到货入库记录 维多利亚 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-26
 */
@RestController
@RequestMapping("/arrivalStockRecords")
public class ArrivalStockRecordsController {

    @Autowired
    private ArrivalStockRecordsService arrivalStockRecordsService;

    /**
     * 采购到货入库记录 维多利亚分页
     */
    @PostMapping("/page")
    public Page<ArrivalStockRecordsVo> page(@RequestBody ArrivalStockRecordsSelectDto dto) {
        return arrivalStockRecordsService.getPage(dto);
    }

    /**
     * 采购到货入库记录 维多利亚明细
     */
    @PostMapping("/detail")
    public ArrivalStockRecordsVo detail(@RequestBody BaseSelectDto dto) {
        return arrivalStockRecordsService.detail(dto.getId());
    }

    /**
     * 采购到货入库记录 维多利亚新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ArrivalStockRecordsDto arrivalStockRecordsDto) {
        arrivalStockRecordsService.add(arrivalStockRecordsDto);
    }

    /**
     * 采购到货入库记录 维多利亚编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody ArrivalStockRecordsDto arrivalStockRecordsDto) {
        arrivalStockRecordsService.edit(arrivalStockRecordsDto);
    }

    /**
     * 采购到货入库记录 维多利亚删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        arrivalStockRecordsService.delete(dto.getId());
    }

}
