啊鑫
10 天以前 f2b71fe1d3c2b7651d525a5b5bbe66fad602ea06
WebApi/Gs.Warehouse/Services/MesAutoRkController.cs
@@ -1,25 +1,22 @@
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;
@@ -27,6 +24,7 @@
        }
        #region
        /// <summary>
        ///     读取列表,支持分页
        /// </summary>
@@ -84,6 +82,7 @@
                return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
              ReturnCode.Exception, ex.Message);
            }
            return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
                ReturnCode.Success, "读取成功");
        }
@@ -111,7 +110,8 @@
            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,19 +158,32 @@
                        cmd.CommandType = CommandType.StoredProcedure;
                        SqlParameter[] parameters =
                        {
                        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
                        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
                    };
                        parameters[0].Direction = ParameterDirection.Output;
                        parameters[1].Direction = ParameterDirection.Output;
@@ -197,9 +210,12 @@
                    }
                }
            }
            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>
@@ -273,7 +289,7 @@
            string _guid = mode.guid;
            string _inFieldValue = mode.inFieldValue;
            string _chkOut = mode.chkOut;
            string _proName = "prc_auto_rk_submit";
        var _proName = "prc_auto_rk_submit";
            dynamic m = new ExpandoObject();
            m.outSum = -1;
            m.outMsg = "";
@@ -317,8 +333,9 @@
                    }
                }
            }
            return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!");
        }
        #endregion
    }
}