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


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

import java.util.List;

/**
 * <p>
 * 记录折转信息 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2022-01-10
 */
@RestController
@RequestMapping("/turnInfo")
public class TurnInfoController {
    @Autowired
    private ITurnInfoService turnInfoService;
    /**
     * 折转
     *
     * @param turnInfo
     * @return
     */
    @PostMapping("/api/addTurn")
    public String addTurn(@RequestBody TurnInfo turnInfo){
        return turnInfoService.addTurn(turnInfo);
    }

    /**
     * 仓位货名下拉列表
     *
     * @param id
     * @return
     */
    @GetMapping("/getPositionAndGoodsName")
    List<WarehouseNumView> getPositionAndGoodsName(String id){
        return turnInfoService.getPositionAndGoodsName(id);
    }

    /**
     * 折转列表
     * @param turnInfo
     * @return
     */
    @GetMapping("/selectTurnInfo")
    public Page<TurnInfo> selectTurnInfo(TurnInfo turnInfo) {
        return turnInfoService.selectTurnInfo(turnInfo);
    }
}

