package com.fjhx.sale.controller.arrival;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.arrival.dto.ArrivalDto;
import com.fjhx.sale.entity.arrival.dto.ArrivalSelectDto;
import com.fjhx.sale.entity.arrival.vo.ArrivalVo;
import com.fjhx.sale.service.arrival.ArrivalService;
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>
 * purchase_到货 前端控制器
 * </p>
 *
 * @author
 * @since 2024-02-01
 */
@RestController
@RequestMapping("/arrival")
public class ArrivalController {

    @Autowired
    private ArrivalService arrivalService;

    /**
     * purchase_到货分页
     */
    @PostMapping("/page")
    public Page<ArrivalVo> page(@RequestBody ArrivalSelectDto dto) {
        return arrivalService.getPage(dto);
    }

    /**
     * purchase_到货明细
     */
    @PostMapping("/detail")
    public ArrivalVo detail(@RequestBody BaseSelectDto dto) {
        return arrivalService.detail(dto.getId());
    }

    /**
     * purchase_到货新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ArrivalDto arrivalDto) {
        arrivalService.add(arrivalDto);
    }

}
