package com.fjhx.sale.controller.sample;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.fjhx.common.constant.SourceConstant;
import com.fjhx.sale.entity.sample.dto.SampleShipmentDto;
import com.fjhx.sale.entity.sample.dto.SampleShipmentSelectDto;
import com.fjhx.sale.entity.sample.vo.SampleShipmentVo;
import com.fjhx.sale.service.sample.SampleShipmentService;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.BaseSelectDto;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 样品单-出货计划 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-05
 */
@RestController
@RequestMapping("/sampleShipment")
public class SampleShipmentController {

    @Autowired
    private SampleShipmentService sampleShipmentService;

    /**
     * 样品单-出货计划分页
     */
    @PostMapping("/page")
    public Page<SampleShipmentVo> page(@RequestBody SampleShipmentSelectDto dto) {
        return sampleShipmentService.getPage(dto);
    }

    /**
     * 样品单-出货计划明细
     */
    @PostMapping("/detail")
    public SampleShipmentVo detail(@RequestBody BaseSelectDto dto) {
        return sampleShipmentService.detail(dto.getId());
    }

    /**
     * 样品单-出货计划新增
     */
    @PostMapping("/add")
    public void add(@RequestBody SampleShipmentDto sampleShipmentDto) {
        sampleShipmentService.add(sampleShipmentDto);
    }

    /**
     * 样品单-出货计划编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody SampleShipmentDto sampleShipmentDto) {
        sampleShipmentService.edit(sampleShipmentDto);
    }

    /**
     * 样品单-出货计划删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        sampleShipmentService.delete(dto.getId());
    }

}
