package com.fjhx.sale.controller.purchase;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.purchase.dto.EhsdPurchaseArrivalDto;
import com.fjhx.sale.entity.purchase.dto.EhsdPurchaseArrivalSelectDto;
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseArrivalVo;
import com.fjhx.sale.service.purchase.EhsdPurchaseArrivalService;
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>
 *
 * @author
 * @since 2023-05-17
 */
@RestController
@RequestMapping("/ehsdPurchaseArrival")
public class EhsdPurchaseArrivalController {

    @Autowired
    private EhsdPurchaseArrivalService ehsdPurchaseArrivalService;

    /**
     * 采购合同-到货计划分页
     */
    @PostMapping("/page")
    public Page<EhsdPurchaseArrivalVo> page(@RequestBody EhsdPurchaseArrivalSelectDto dto) {
        return ehsdPurchaseArrivalService.getPage(dto);
    }

    /**
     * 采购合同-到货计划明细
     */
    @PostMapping("/detail")
    public EhsdPurchaseArrivalVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdPurchaseArrivalService.detail(dto.getId());
    }

    /**
     * 采购合同-到货计划新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto) {
        ehsdPurchaseArrivalService.add(ehsdPurchaseArrivalDto);
    }

    /**
     * 采购合同-到货计划编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto) {
        ehsdPurchaseArrivalService.edit(ehsdPurchaseArrivalDto);
    }

    /**
     * 采购合同-到货计划删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        ehsdPurchaseArrivalService.delete(dto.getId());
    }

}
