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


import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInventoryCountInfo;
import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInventoryCountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 记录库存盘点信息 前端控制器
 * </p>
 *
 * @author Gongdc
 * @since 2021-05-25
 */
@RestController
@RequestMapping("/warehouseInventoryCountInfo")
public class WarehouseInventoryCountInfoController {

    @Autowired
    private IWarehouseInventoryCountInfoService warehouseInventoryCountInfoService;
    /**
     * 盘损记录分页查询
     *
     * @param warehouseInventoryCountInfo
     * @return
     */
    @GetMapping("/selectInfo")
    public Page<WarehouseInventoryCountInfo> selectInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
        return warehouseInventoryCountInfoService.selectInfo(warehouseInventoryCountInfo);
    }

    /**
     * 根据货名查累计量
     */
    @GetMapping("/getInfo")
    public WarehouseInventoryCountInfo getInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
        return warehouseInventoryCountInfoService.getInfo(warehouseInventoryCountInfo);
    }

    /**
     * 盘损
     */
    @PostMapping("/addInventory")
    public String addInventory(@RequestBody WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
        return warehouseInventoryCountInfoService.addInventory(warehouseInventoryCountInfo);
    }


}

