南骏 池
2025-05-27 54f23d618095bf49edc77a45ad489a555701b688
Controllers/Warehouse/InventoryController.cs
@@ -1,6 +1,7 @@
using System.Dynamic;
using Microsoft.AspNetCore.Mvc;
using NewPdaSqlServer.Dto.service;
using NewPdaSqlServer.service.@base;
using NewPdaSqlServer.service.Warehouse;
using NewPdaSqlServer.util;
@@ -12,17 +13,19 @@
{
    private readonly InventoryManager m = new();
    private readonly MesPrintMangeer _mCf = new();
    /// <summary>
    /// 扫描库位条码的控制器方法
    ///     扫描库位条码的控制器方法
    /// </summary>
    /// <param name="query">包含库位代码的查询对象</param>
    /// <returns>扫描结果信息</returns>
    /// <remarks>
    /// 请求示例:
    /// POST /api/Inventory/ScanDepotNo
    /// {
    ///     请求示例:
    ///     POST /api/Inventory/ScanDepotNo
    ///     {
    ///     "DepotCode": "库位代码"
    /// }
    ///     }
    /// </remarks>
    [HttpPost("ScanDepotNo")]
    public ResponseResult ScanDepotNo([FromBody] WarehouseQuery query)
@@ -45,18 +48,18 @@
    }
    /// <summary>
    /// 扫描条码的控制器方法
    ///     扫描条码的控制器方法
    /// </summary>
    /// <param name="query">包含条码、库位代码和用户名的查询对象</param>
    /// <returns>扫描结果信息</returns>
    /// <remarks>
    /// 请求示例:
    /// POST /api/Inventory/ScanBarcode
    /// {
    ///     请求示例:
    ///     POST /api/Inventory/ScanBarcode
    ///     {
    ///     "barcode": "条码",
    ///     "DepotCode": "库位代码",
    ///     "userName": "用户名"
    /// }
    ///     }
    /// </remarks>
    [HttpPost("ScanBarcode")]
    public ResponseResult ScanBarcode([FromBody] WarehouseQuery query)
@@ -77,4 +80,79 @@
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    /// 期初打印扫描库位获取仓库信息和库存组织信息
    /// </summary>
    /// <param name="query"></param>
    /// <returns></returns>
    [HttpPost("GetDepoptsInfo")]
    public ResponseResult GetDepoptsInfo([FromBody] WarehouseQuery query)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.GetDepoptsInfo(query);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
        /// <summary>
    /// 期初打印扫描库位获取仓库信息和库存组织信息
    /// </summary>
    /// <param name="query"></param>
    /// <returns></returns>
    [HttpPost("GetItemsList")]
    public ResponseResult GetItemsList([FromBody] dynamic query)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = m.GetItemsList(query);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    [HttpPost("printBeginBar")]
    public ResponseResult PrintBeginBar([FromBody] dynamic query)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = new ExpandoObject();
            resultInfos.tbBillList.printInfo = _mCf.getPrintInfo(query);
            //var scanResult = m.BarCF(unity);
            resultInfos.tbBillList.cfBarInfo = m.ExecuteBeginBar(query);
            //resultInfos.tbBillList = m.ExecuteBeginBar(query);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
}