啊鑫
2025-09-09 f2b71fe1d3c2b7651d525a5b5bbe66fad602ea06
WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -1,14 +1,13 @@
using Gs.Toolbox;
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.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Dynamic;
using System.Text;
using static Gs.Toolbox.UtilityHelper;
@@ -83,7 +82,7 @@
        {
            LogHelper.Debug(ToString(), ex.Message);
            return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
          ReturnCode.Exception, ex.Message);
                ReturnCode.Exception, ex.Message);
        }
        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
@@ -152,7 +151,7 @@
    /// <summary>
    /// 修改工单状态
    ///     修改工单状态
    /// </summary>
    /// <param name="mode"></param>
    /// <returns></returns>
@@ -210,12 +209,13 @@
    /// <summary>
    ///   重新生成首检
    ///     重新生成首检
    /// </summary>
    /// <param name="mode"></param>
    /// <returns></returns>
    [RequestMethod(RequestMethods.POST)]
    public ReturnDto<ExpandoObject> EditModelSubmitShouJian([FromBody] dynamic mode)
    public ReturnDto<ExpandoObject> EditModelSubmitShouJian(
        [FromBody] dynamic mode)
    {
        string _guid = mode.guid;
        string _inFieldValue = mode.inFieldValue;
@@ -235,7 +235,7 @@
                        new("@po_outMsg", SqlDbType.NVarChar, 300),
                        new("@po_outStatus", SqlDbType.Int),
                        new("@pi_user", _userCode),
                        new("@pi_DAA_guid", _guid),
                        new("@pi_DAA_guid", _guid)
                    };
                    parameters[0].Direction = ParameterDirection.Output;
                    parameters[1].Direction = ParameterDirection.Output;
@@ -264,7 +264,6 @@
    }
    /// <summary>
    ///     增加或编辑实体
    /// </summary>
@@ -291,11 +290,12 @@
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),
                        new("@inOrderGuid",
                            CheckGuid(guid) ? guid : DBNull.Value),
                        new("@inSjxt", sjxt),
                        new("@inBz", bz),
                        new("@inSclx", sclx),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inEdtUserGuid", _userGuid)
                    };
                    parameters[0].Direction = ParameterDirection.Output;
                    parameters[1].Direction = ParameterDirection.Output;
@@ -318,6 +318,7 @@
                }
            }
        }
        if (_outSum <= 0)
            return ReturnDto<string>.QuickReturn(guid.ToString(),
                ReturnCode.Exception, _outMsg);
@@ -364,6 +365,7 @@
                        dt.Fill(dset, "0");
                    }
                }
                conn.Close();
            }
        }
@@ -395,18 +397,20 @@
            var _dy = dset.Tables[0].TableToDynamicList();
            _pglist.list = _dy;
        }
        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
            ReturnCode.Success, "读取成功");
    }
    /// <summary>
    ///    选择dab弹窗体
    ///     选择dab弹窗体
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    [RequestMethod(RequestMethods.POST)]
    public ReturnDto<PageList<dynamic>> GetListSelectDab([FromBody] dynamic model)
    public ReturnDto<PageList<dynamic>> GetListSelectDab(
        [FromBody] dynamic model)
    {
        int currentPage = model.currentPage;
        int everyPageSize = model.everyPageSize;
@@ -439,6 +443,7 @@
                        dt.Fill(dset, "0");
                    }
                }
                conn.Close();
            }
        }
@@ -448,6 +453,7 @@
            return ReturnDto<PageList<dynamic>>.QuickReturn(
                default(PageList<dynamic>), ReturnCode.Exception, "读取失败");
        }
        var _pglist = new PageList<dynamic>
        {
            total = 0,
@@ -469,6 +475,7 @@
            var _dy = dset.Tables[0].TableToDynamicList();
            _pglist.list = _dy;
        }
        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
            ReturnCode.Success, "读取成功");
    }
@@ -556,7 +563,7 @@
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid",
                            UtilityHelper.CheckGuid(guid)
                            CheckGuid(guid)
                                ? guid
                                : DBNull.Value),
                        new("@inEdtUserGuid", _userGuid),
@@ -586,12 +593,13 @@
        }
        if (_outSum <= 0)
            return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
            return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
                _outMsg);
        return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
    }
    /// <summary>
    /// 工艺变更
    ///     工艺变更
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
@@ -609,6 +617,7 @@
                _sb.Append("~");
            _sb.Append(_line);
        }
        dynamic mObj = new ExpandoObject();
        mObj.outMsg = "";
        mObj.outSum = -1;
@@ -626,7 +635,8 @@
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
                        new("@inOrderGuid",
                            CheckGuid(guid) ? guid : DBNull.Value),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inLineList", _sb.ToString())
                    };
@@ -651,34 +661,39 @@
                }
            }
        }
        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>
    ///
    /// </summary>
    /// <param name="query"></param>
    /// <returns></returns>
    [RequestMethod(RequestMethods.POST)]
    public ReturnDto<List<dynamic>> GetGyList(
       [FromBody] dynamic model)
        [FromBody] dynamic model)
    {
        string daaGuid = model.guid;
        var lst = new List<dynamic>();
        var dset = new DataSet();
        System.Text.StringBuilder sbSql = new System.Text.StringBuilder();
        sbSql.Append("   select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" + daaGuid + "' order by processNo asc ");
        var sbSql = new StringBuilder();
        sbSql.Append(
            "   select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" +
            daaGuid + "' order by processNo asc ");
        try
        {
            dset = Gs.Toolbox.DbHelperSQL.Query(sbSql.ToString());
            dset = DbHelperSQL.Query(sbSql.ToString());
        }
        catch (Exception ex)
        {
            LogHelper.Debug(ToString(), ex.Message);
        }
        if (dset != null && dset.Tables.Count > 0 &&
            dset.Tables[0].Rows.Count > 0) //有数据
            lst = dset.Tables[0].TableToDynamicList();
@@ -688,7 +703,7 @@
    /// <summary>
    /// 变更内包装数量
    ///     变更内包装数量
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
@@ -712,7 +727,8 @@
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value),
                        new("@inOrderGuid",
                            CheckGuid(guid) ? guid : DBNull.Value),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inSl", sl)
                    };
@@ -726,7 +742,8 @@
                }
                catch (Exception ex)
                {
                    LogHelper.Debug(ToString(), "prc_wom_daa_nbz error:" + ex.Message);
                    LogHelper.Debug(ToString(),
                        "prc_wom_daa_nbz error:" + ex.Message);
                    _outMsg = ex.Message;
                    _outSum = -1;
                }
@@ -738,8 +755,8 @@
        }
        if (_outSum <= 0)
            return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, _outMsg);
            return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
                _outMsg);
        return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
    }
}