package com.fjhx.sale.controller.contract;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.contract.vo.ContractShipmentVo;
import com.fjhx.sale.entity.contract.dto.ContractShipmentSelectDto;
import com.fjhx.sale.entity.contract.dto.ContractShipmentDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.contract.ContractShipmentService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 外销合同-出货计划 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-17
 */
@RestController
@RequestMapping("/contractShipment")
public class ContractShipmentController {

    @Autowired
    private ContractShipmentService contractShipmentService;

    /**
     * 外销合同-出货计划分页
     */
    @PostMapping("/page")
    public Page<ContractShipmentVo> page(@RequestBody ContractShipmentSelectDto dto) {
        return contractShipmentService.getPage(dto);
    }

    /**
     * 外销合同-出货计划明细
     */
    @PostMapping("/detail")
    public ContractShipmentVo detail(@RequestBody BaseSelectDto dto) {
        return contractShipmentService.detail(dto.getId());
    }

    /**
     * 外销合同-出货计划新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ContractShipmentDto contractShipmentDto) {
        contractShipmentService.add(contractShipmentDto);
    }

    /**
     * 外销合同-出货计划编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody ContractShipmentDto contractShipmentDto) {
        contractShipmentService.edit(contractShipmentDto);
    }

    /**
     * 外销合同-出货计划删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        contractShipmentService.delete(dto.getId());
    }

}
