package com.fjhx.sale.controller.pack;

import com.fjhx.sale.entity.pack.po.Pack;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.pack.vo.PackVo;
import com.fjhx.sale.entity.pack.dto.PackSelectDto;
import com.fjhx.sale.entity.pack.dto.PackDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.pack.PackService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;


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

    @Autowired
    private PackService packService;

    /**
     * 装箱出货表分页
     */
    @PostMapping("/page")
    public Page<PackVo> page(@RequestBody PackSelectDto dto) {
        return packService.getPage(dto);
    }

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

    /**
     * 装箱出货表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody Pack pack) {
        packService.add(pack);
    }

    /**
     * 装箱出货表编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody PackDto packDto) {
        packService.edit(packDto);
    }

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

    /**
     * 装箱出货通知单
     *
     * @return
     */
    @PostMapping("/shipmentNotification")
    public Map<String, Object> shipmentNotification(@RequestBody BaseSelectDto dto) {
        return packService.shipmentNotification(dto.getId());
    }

}
