package com.fjhx.sale.controller.pack;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.pack.vo.PackDetailVo;
import com.fjhx.sale.entity.pack.dto.PackDetailSelectDto;
import com.fjhx.sale.entity.pack.dto.PackDetailDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.pack.PackDetailService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 装箱出货明细表	 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-18
 */
@RestController
@RequestMapping("/packDetail")
public class PackDetailController {

    @Autowired
    private PackDetailService packDetailService;

    /**
     * 装箱出货明细表	分页
     */
    @PostMapping("/page")
    public Page<PackDetailVo> page(@RequestBody PackDetailSelectDto dto) {
        return packDetailService.getPage(dto);
    }

    /**
     * 装箱出货明细表	明细
     */
    @PostMapping("/detail")
    public PackDetailVo detail(@RequestBody BaseSelectDto dto) {
        return packDetailService.detail(dto.getId());
    }

    /**
     * 装箱出货明细表	新增
     */
    @PostMapping("/add")
    public void add(@RequestBody PackDetailDto packDetailDto) {
        packDetailService.add(packDetailDto);
    }

    /**
     * 装箱出货明细表	编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody PackDetailDto packDetailDto) {
        packDetailService.edit(packDetailDto);
    }

    /**
     * 装箱出货明细表	删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        packDetailService.delete(dto.getId());
    }

    /**
     * 出货
     */
    @PostMapping("/shipment")
    public void shipment(@RequestBody PackDetailDto dto) {
        packDetailService.shipment(dto.getIds(),dto.getContractId());
    }



}
