cnf
6 天以前 80aa0cb51bc007f85c74c2cad0fb8e24a60cb371
Controllers/Warehouse/MesItemQtController.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;
@@ -11,9 +12,11 @@
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class MesItemQtController : ControllerBase
public class MesItemQtController : BaseController
{
    private readonly MesItemQtManager _manager = new();
    private readonly MesPrintMangeer _mCf = new();
    #region 基础CRUD
@@ -60,7 +63,7 @@
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = _manager.GetPendingQtList();
            resultInfos.tbBillList = _manager.GetPendingQtList(RequestInfo);
            return new ResponseResult
            {
                status = 0,
@@ -81,7 +84,7 @@
    /// <returns>待处理的退料单明细列表</returns>
    /// <remarks>
    ///     请求示例:
    ///     POST /api/MesItemQt/GetPendingQtList
    ///     POST /api/MesItemQt/GetPendingQtDetailList
    ///     {
    ///     "userName": "admin",      // 用户名(必填)
    ///     "billNo": "QT20240101001" // 退料单号(必填)
@@ -91,13 +94,12 @@
    /// <response code="200">成功获取退料单明细</response>
    /// <response code="400">获取失败,返回具体错误信息</response>
    [HttpPost("GetPendingQtDetailList")]
    public ResponseResult GetPendingQtDetailList(
        [FromBody] WarehouseQuery query)
    public ResponseResult GetPendingQtDetailList([FromBody] WarehouseQuery query)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = _manager.GetPendingQtList(query);
            resultInfos.tbBillList = _manager.GetPendingQtDetailList(query, RequestInfo);
            return new ResponseResult
            {
                status = 0,
@@ -134,13 +136,38 @@
    [HttpPost("OutScanBarcode")]
    public ResponseResult OutScanBarcode([FromBody] WarehouseQuery query)
    {
        //try
        //{
        //    dynamic resultInfos = new ExpandoObject();
        //    var (form, items, message) = _manager.OutScanBarcode(query);
        //    resultInfos.form = form;
        //    resultInfos.items = items;
        //    resultInfos.message = message;
        //    return new ResponseResult
        //    {
        //        status = 0,
        //        message = "OK",
        //        data = resultInfos
        //    };
        //}
        //catch (Exception ex)
        //{
        //    return ResponseResult.ResponseError(ex);
        //}
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var (form, items, message) = _manager.OutScanBarcode(query);
            resultInfos.form = form;
            resultInfos.items = items;
            resultInfos.message = message;
            resultInfos.tbBillList = _manager.ScanCode(query);
            if (resultInfos.tbBillList.result == "2")
            {
                return new ResponseResult
                {
                    status = Convert.ToInt32(resultInfos.tbBillList.result),
                    message = resultInfos.tbBillList.strMsg,
                    data = resultInfos
                };
            }
            return new ResponseResult
            {
                status = 0,
@@ -198,5 +225,29 @@
        }
    }
    [HttpPost("ScanCodeCF")]
    public ResponseResult ScanCodeCF(WarehouseQuery query)
    {
        try
        {
            dynamic resultInfos = new ExpandoObject();
            resultInfos.tbBillList = new ExpandoObject();
            resultInfos.tbBillList.printInfo = _mCf.getPrintInfo(query);
            var scanResult = _manager.ScanCodeCF(query);
            resultInfos.tbBillList.cfBarInfo = _mCf.getCfInfo(scanResult);
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    #endregion
}