啊鑫
4 天以前 2ba5117206c152cece2e5ac40067a6232dfb2870
WebApi/Gs.Wom/Service/WomdaaManager.cs
@@ -1,13 +1,14 @@
using System.Data;
using System.Data.SqlClient;
using System.Dynamic;
using System.Text;
using Gs.Toolbox;
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;
@@ -82,7 +83,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,
@@ -151,7 +152,7 @@
    /// <summary>
    ///     修改工单状态
    /// 修改工单状态
    /// </summary>
    /// <param name="mode"></param>
    /// <returns></returns>
@@ -209,13 +210,12 @@
    /// <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,6 +264,7 @@
    }
    /// <summary>
    ///     增加或编辑实体
    /// </summary>
@@ -290,12 +291,11 @@
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid",
                            CheckGuid(guid) ? guid : DBNull.Value),
                        new("@inOrderGuid",UtilityHelper.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,7 +318,6 @@
                }
            }
        }
        if (_outSum <= 0)
            return ReturnDto<string>.QuickReturn(guid.ToString(),
                ReturnCode.Exception, _outMsg);
@@ -365,7 +364,6 @@
                        dt.Fill(dset, "0");
                    }
                }
                conn.Close();
            }
        }
@@ -397,20 +395,18 @@
            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;
@@ -443,7 +439,6 @@
                        dt.Fill(dset, "0");
                    }
                }
                conn.Close();
            }
        }
@@ -453,7 +448,6 @@
            return ReturnDto<PageList<dynamic>>.QuickReturn(
                default(PageList<dynamic>), ReturnCode.Exception, "读取失败");
        }
        var _pglist = new PageList<dynamic>
        {
            total = 0,
@@ -475,7 +469,6 @@
            var _dy = dset.Tables[0].TableToDynamicList();
            _pglist.list = _dy;
        }
        return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
            ReturnCode.Success, "读取成功");
    }
@@ -563,7 +556,7 @@
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid",
                            CheckGuid(guid)
                            UtilityHelper.CheckGuid(guid)
                                ? guid
                                : DBNull.Value),
                        new("@inEdtUserGuid", _userGuid),
@@ -593,13 +586,12 @@
        }
        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>
@@ -617,7 +609,6 @@
                _sb.Append("~");
            _sb.Append(_line);
        }
        dynamic mObj = new ExpandoObject();
        mObj.outMsg = "";
        mObj.outSum = -1;
@@ -635,8 +626,7 @@
                    {
                        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())
                    };
@@ -661,39 +651,34 @@
                }
            }
        }
        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();
        var sbSql = new StringBuilder();
        sbSql.Append(
            "   select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" +
            daaGuid + "' order by processNo asc ");
        System.Text.StringBuilder sbSql = new System.Text.StringBuilder();
        sbSql.Append("   select * from [dbo].[WOMDAA_TECHNIQUE] where daaGuid='" + daaGuid + "' order by processNo asc ");
        try
        {
            dset = DbHelperSQL.Query(sbSql.ToString());
            dset = Gs.Toolbox.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();
@@ -703,7 +688,7 @@
    /// <summary>
    ///     变更内包装数量
    /// 变更内包装数量
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
@@ -727,8 +712,7 @@
                    {
                        new("@outMsg", SqlDbType.NVarChar, 300),
                        new("@outSum", SqlDbType.Int),
                        new("@inOrderGuid",
                            CheckGuid(guid) ? guid : DBNull.Value),
                        new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value),
                        new("@inEdtUserGuid", _userGuid),
                        new("@inSl", sl)
                    };
@@ -742,8 +726,7 @@
                }
                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;
                }
@@ -755,8 +738,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);
    }
}