cnf
2025-09-10 1b3db8f5683373dd8e179b006e7314783dd1f9db
WebApi/Gs.Warehouse/Services/MesAutoRkController.cs
@@ -1,22 +1,25 @@
using System.Data;
using System.Data.SqlClient;
using System.Dynamic;
using System.Text;
using Gs.Toolbox;
using Gs.Toolbox.ApiCore.Abstract.Mvc;
using Gs.Toolbox.ApiCore.Common.Mvc;
using Gs.Toolbox.ApiCore.Group;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using static Gs.Toolbox.UtilityHelper;
namespace Gs.Wom.WorkService;
namespace Gs.Wom.WorkService
{
[ApiGroup(ApiGroupNames.WOM)]
public class MesAutoRkController : IRomteService
{
    private readonly IHttpContextAccessor _http;
    private readonly string _userCode, _userGuid, _orgFids;
    public MesAutoRkController(IHttpContextAccessor httpContextAccessor)
    {
        _http = httpContextAccessor;
@@ -24,7 +27,6 @@
    }
    #region
    /// <summary>
    ///     读取列表,支持分页
    /// </summary>
@@ -82,7 +84,6 @@
            return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
                ReturnCode.Exception, ex.Message);
        }
        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
            ReturnCode.Success, "读取成功");
    }
@@ -110,8 +111,7 @@
        var dset = new DataSet();
        try
        {
            dset = DbHelperSQL.RunProcedure("[prc_auto_rk_mx]", parameters,
                "0");
                dset = DbHelperSQL.RunProcedure("[prc_auto_rk_mx]", parameters, "0");
            if (dset != null && dset.Tables.Count > 0 &&
                dset.Tables[0].Rows.Count > 0)
            {
@@ -158,32 +158,19 @@
                    cmd.CommandType = CommandType.StoredProcedure;
                    SqlParameter[] parameters =
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@outGuid", SqlDbType.UniqueIdentifier),
                        new("@outNo", SqlDbType.NVarChar, 300),
                        new("@inOrderGuid",
                            CheckGuid(guid) ? guid : DBNull.Value),
                        new("@ItemId",
                            string.IsNullOrEmpty(itemId)
                                ? DBNull.Value
                                : long.Parse(itemId)),
                        new("@departmentId",
                            string.IsNullOrEmpty(departmentId)
                                ? DBNull.Value
                                : long.Parse(departmentId)),
                        new("@depotId",
                            string.IsNullOrEmpty(depotId)
                                ? DBNull.Value
                                : long.Parse(depotId)),
                        new("@depotlocid",
                            string.IsNullOrEmpty(depotlocid)
                                ? DBNull.Value
                                : depotlocid),
                        new("@remark", ""),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inLineList", DBNull.Value), // 设置为DBNull.Value
                        new("@inLineList2", DBNull.Value) // 设置为DBNull.Value
                        new SqlParameter("@outMsg", SqlDbType.NVarChar, 300),
                        new SqlParameter("@outSum", SqlDbType.Int),
                        new SqlParameter("@outGuid", SqlDbType.UniqueIdentifier),
                        new SqlParameter("@outNo", SqlDbType.NVarChar, 300),
                        new SqlParameter("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
                        new SqlParameter("@ItemId", string.IsNullOrEmpty(itemId) ? DBNull.Value : (object)long.Parse(itemId)),
                        new SqlParameter("@departmentId", string.IsNullOrEmpty(departmentId) ? DBNull.Value : (object)long.Parse(departmentId)),
                        new SqlParameter("@depotId", string.IsNullOrEmpty(depotId) ? DBNull.Value : (object)long.Parse(depotId)),
                        new SqlParameter("@depotlocid", string.IsNullOrEmpty(depotlocid) ? DBNull.Value : (object)depotlocid),
                        new SqlParameter("@remark", ""),
                        new SqlParameter("@inEdtUserGuid", _userGuid),
                        new SqlParameter("@inLineList", DBNull.Value), // 设置为DBNull.Value
                        new SqlParameter("@inLineList2", DBNull.Value) // 设置为DBNull.Value
                    };
                    parameters[0].Direction = ParameterDirection.Output;
                    parameters[1].Direction = ParameterDirection.Output;
@@ -210,12 +197,9 @@
                }
            }
        }
        if (mObj.outSum <= 0)
            return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception,
                mObj.outMsg);
        return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success,
            mObj.outMsg);
                return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg);
            return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg);
    }
    /// <summary>
@@ -289,7 +273,7 @@
        string _guid = mode.guid;
        string _inFieldValue = mode.inFieldValue;
        string _chkOut = mode.chkOut;
        var _proName = "prc_auto_rk_submit";
            string _proName = "prc_auto_rk_submit";
        dynamic m = new ExpandoObject();
        m.outSum = -1;
        m.outMsg = "";
@@ -333,9 +317,8 @@
                }
            }
        }
        return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!");
    }
    #endregion
}
}