cnf
2 天以前 cab67144217d6f42fa63cc8b88a30dd5621f69cb
修改工单合并查询,增加仓管员读取
已修改9个文件
116 ■■■■ 文件已修改
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/Gs.Warehouse/Services/MesDepotsManager.cs 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/Gs.Wom/Service/WomdaaManager.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/Gs.Wom/Service/WomdaahbManager.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db
Binary files differ
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-shm
Binary files differ
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/CodeChunks.db-wal
Binary files differ
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db
Binary files differ
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-shm
Binary files differ
WebApi/.vs/GsMesSolution/CopilotIndices/17.14.786.1071/SemanticSymbols.db-wal
Binary files differ
WebApi/Gs.Warehouse/Services/MesDepotsManager.cs
@@ -1,4 +1,5 @@
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Gs.Entity.BaseInfo;
using Gs.Entity.Sys;
@@ -401,74 +402,62 @@
    ///     查询列表,支持分页(保持输出参数方式)
    /// </summary>
    [RequestMethod(RequestMethods.POST)]
    public ReturnDto<PageList<MesStaff>> GetListCgy(PageQuery query)
    public ReturnDto<PageList<dynamic>> GetListCgy(PageQuery model)
    {
        var pageList = new PageList<MesStaff>();
        string currentId = "";//默认采购员
        int currentPage = model.currentPage;
        int everyPageSize = model.everyPageSize;
        string sortName = model.sortName;
        string keyWhere = model.keyWhere;
        SqlParameter[] parameters =
        {
                new("@inCurrentPage", currentPage),
                new("@inEveryPageSize", everyPageSize),
                new("@inSortName", sortName),
                new("@inSortOrder", ""),
                new("@inQueryWhere", keyWhere),
                new("@inFid", ""),
                new("@inP1", ""),
                new("@inP2", ""),
                new("@inP3", ""),
                new("@inP4", _userGuid)//当前登录用户guid,将根据他读取仓管员
            };
        var dset = new DataSet();
        var _pglist = new PageList<dynamic>
        {
            total = 0,
            everyPageSize = 0,
            pages = 0,
            list = new List<dynamic>()
        };
        try
        {
            // 检查基本对象
            if (query == null) throw new ArgumentNullException(nameof(query));
            if (Db?.Ado == null) throw new InvalidOperationException("数据库连接不可用");
            // 存储过程参数 - 注意现在有输出参数了
            var parameters = new[]
            dset = DbHelperSQL.RunProcedure("prc_cgy_lst", parameters, "0");
            if (dset != null && dset.Tables.Count > 0 &&
                dset.Tables[0].Rows.Count > 0) //有数据
            {
        new SugarParameter("@PageIndex", query.currentPage),
        new SugarParameter("@PageSize", query.everyPageSize),
        new SugarParameter("@SortField", string.IsNullOrEmpty(query.sortName) ? "staff_no" : query.sortName),
        new SugarParameter("@SortOrder", string.IsNullOrEmpty(query.sortOrder) ? "DESC" : query.sortOrder),
        new SugarParameter("@WhereCondition", query.keyWhere ?? ""),
        new SugarParameter("@Fid", DBNull.Value),
        new SugarParameter("@P1", DBNull.Value),
        new SugarParameter("@P2", DBNull.Value),
        new SugarParameter("@P3", DBNull.Value),
        new SugarParameter("@P4", DBNull.Value),
        // 注意:输出参数必须指定 ParameterDirection.Output
        new SugarParameter("@outTotalCount", 0, System.Data.DbType.Int32, ParameterDirection.Output)
    };
            // 注意:调用语句必须包含 OUTPUT 关键字
            var itemsList = Db.Ado.SqlQuery<MesStaff>(
                "EXEC prc_cgy_lst @PageIndex, @PageSize, @SortField, @SortOrder, @WhereCondition, @Fid, @P1, @P2, @P3, @P4, @outTotalCount OUTPUT",
                parameters
            );
            // 获取输出参数 - 等待执行完成后再获取
            var totalCountParam = parameters.FirstOrDefault(p => p.ParameterName == "@outTotalCount");
            if (totalCountParam != null && totalCountParam.Value != null)
            {
                try
                {
                    // 确保值是整数类型
                    var totalCount = Convert.ToInt32(totalCountParam.Value);
                    pageList = new PageList<MesStaff>(itemsList ?? new List<MesStaff>(), totalCount, query.everyPageSize);
                    return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Success, "读取成功");
                }
                catch (FormatException)
                {
                    // 如果转换失败,使用默认值
                    pageList = new PageList<MesStaff>(itemsList ?? new List<MesStaff>(), itemsList?.Count ?? 0, query.everyPageSize);
                    return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Success, "读取成功(总数获取失败)");
                }
                var intTotal = int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
                var pages = intTotal % everyPageSize != 0
                    ? intTotal / everyPageSize + 1
                    : intTotal / everyPageSize;
                _pglist.total = intTotal;
                _pglist.everyPageSize = everyPageSize;
                _pglist.pages = pages;
                var _dy = dset.Tables[0].TableToDynamicList();
                _pglist.list = _dy;
                currentId = dset.Tables[1].Rows[0]["mrCgy"].ToString();
            }
            else
            {
                // 输出参数不存在,使用列表长度
                pageList = new PageList<MesStaff>(itemsList ?? new List<MesStaff>(), itemsList?.Count ?? 0, query.everyPageSize);
                return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Success, "读取成功");
            }
        }
        catch (ArgumentNullException argEx)
        {
            return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Default, $"参数错误: {argEx.Message}");
        }
        catch (InvalidOperationException opEx)
        {
            return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Default, $"操作错误: {opEx.Message}");
        }
        catch (Exception ex)
        {
            return ReturnDto<PageList<MesStaff>>.QuickReturn(pageList, ReturnCode.Default, $"系统错误: {ex.Message}");
            LogHelper.Debug(ToString(), ex.Message);
            return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
          ReturnCode.Exception,"-1");
        }
        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
            ReturnCode.Success, currentId);
    }
}
WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -600,6 +600,7 @@
        string keyWhere = model.keyWhere;
        string workId = model.workId;
        string lineId = model.lineId;
        string cgyId = model.cgyId;
        var dset = new DataSet();
        try
        {
@@ -618,7 +619,7 @@
                        new("@inQueryWhere", keyWhere),
                        new("@workId", workId),
                        new("@inP1", lineId),
                        new("@inP2", "")
                        new("@inP2", cgyId)
                    };
                    foreach (var parameter in parameters)
                        cmd.Parameters.Add(parameter);
WebApi/Gs.Wom/Service/WomdaahbManager.cs
@@ -146,7 +146,7 @@
        string bz = model.bz; //备注
        string cjId = model.cjId; //车间
        string xtId = model.xtId;
        string cxId = ""; //产线,用不到了
        string cgyId = model.cgyId; //仓管员
        string jhrs = ""; //计划人数,用不到了
        var _sb = new StringBuilder();
        var _split = "|";
@@ -194,7 +194,7 @@
                        new("@inBz", bz),
                        new("@inCjId", cjId),
                        new("@inLineId", xtId),
                        new("@inJhrs", jhrs),
                        new("@inCgyId", cgyId),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inLineList", _sb.ToString())
                    };