package com.yh.saas.plugin.yiliangyiyun.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.*;
import com.yh.saas.plugin.yiliangyiyun.service.ITradeWarehouseReceiptApplService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 贸易仓单申请信息 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2021-11-06
 */
@RestController
    @RequestMapping("/tradeWarehouseReceiptAppl")
public class TradeWarehouseReceiptApplController {
    @Autowired
    private ITradeWarehouseReceiptApplService tradeWarehouseReceiptApplService;

    /**
     * 列表
     * @param tradeWarehouseReceiptAppl
     * @return
     */
    @GetMapping("/selectTradeWarehouseReceiptAppl")
    public Page<TradeWarehouseReceiptAppl> selectTradeWarehouseReceiptAppl(TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl){
        return tradeWarehouseReceiptApplService.selectTradeWarehouseReceiptAppl(tradeWarehouseReceiptAppl);
    }

    /**
     * 编号
     * @return
     */
    @GetMapping("/getBillNo")
    public String getBillNo(){
        return tradeWarehouseReceiptApplService.getBillNo();
    }
    /**
     * 地图信息
     *
     * @return
     */
    @GetMapping("/getMapInfo")
    public List<TradeWarehouseReceiptAppl> getMapInfo(){
        return tradeWarehouseReceiptApplService.getMapInfo();
    }

    /**
     * 添加
     * @param tradeWarehouseReceiptAppl
     * @return
     */
    @PostMapping("/api/insertTradeWarehouseReceiptAppl")
    public String insertTradeWarehouseReceiptAppl(@RequestBody TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl) {
        return tradeWarehouseReceiptApplService.insertTradeWarehouseReceiptAppl(tradeWarehouseReceiptAppl);
    }
    /**
     * 编辑
     * @param tradeWarehouseReceiptAppl
     * @return
     */
    @PostMapping("/api/editTradeWarehouseReceiptAppl")
    public String editTradeWarehouseReceiptAppl(@RequestBody TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl) {
        return tradeWarehouseReceiptApplService.editTradeWarehouseReceiptAppl(tradeWarehouseReceiptAppl);
    }

    /**
     * 详情
     *
     * @return
     */
    @GetMapping("/getTrageInfo")
    public TradeWarehouseReceiptAppl getTrageInfo(String id){
        return tradeWarehouseReceiptApplService.getTrageInfo(id);
    }

    /**
     * 删除
     * @return
     */
    @PostMapping("/api/deleteTrageInfo")
    public void deleteTrageInfo(@RequestBody TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl){
         tradeWarehouseReceiptApplService.deleteTrageInfo(tradeWarehouseReceiptAppl.getId());
    }


}

