| | |
| | | using NewPdaSqlServer.entity; |
| | | using NewPdaSqlServer.util; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using static Azure.Core.HttpHeader; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | |
| | |
| | | |
| | | return withOracle; |
| | | } |
| | | |
| | | |
| | | public dynamic CreateByWomdaa(dynamic query) |
| | | { |
| | | if (query == null) throw new ArgumentNullException(nameof(query)); |
| | | |
| | | if (string.IsNullOrEmpty(query.userAccount?.ToString())) |
| | | throw new ArgumentException("用户账号不能为空", nameof(query.userAccount)); |
| | | |
| | | if (string.IsNullOrEmpty(query.inOrderGuid1?.ToString())) |
| | | throw new ArgumentException("检验单GUID不能为空", nameof(query.inOrderGuid1)); |
| | | |
| | | if (string.IsNullOrEmpty(query.DAA001?.ToString())) |
| | | throw new ArgumentException("工单号不能为空", nameof(query.inOrderGuid1)); |
| | | |
| | | var _strMsg = ""; |
| | | var _status = -1; |
| | | |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | using (var cmd = new SqlCommand("ipqc_createByWomdaa", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@po_outMsg", SqlDbType.NVarChar, 150) { Direction = ParameterDirection.Output }, |
| | | new("@po_outStatus", SqlDbType.Int) { Direction = ParameterDirection.Output }, |
| | | new("@pi_user", SqlDbType.NVarChar, 150) { Value = query.userAccount }, |
| | | new("@pi_OrderGuid1", SqlDbType.UniqueIdentifier) { Value = Guid.Parse(query.inOrderGuid1.ToString()) }, |
| | | new("@pi_DAA001", SqlDbType.NVarChar, 150) { Value = query.DAA001.ToString() }, |
| | | new("@pi_inP1", SqlDbType.NVarChar, 20) { Value = query.pi_inP1 ?? DBNull.Value }, |
| | | new("@pi_inP2", SqlDbType.NVarChar, 20) { Value = query.pi_inP2 ?? DBNull.Value } |
| | | }; |
| | | |
| | | cmd.Parameters.AddRange(parameters); |
| | | cmd.ExecuteNonQuery(); |
| | | |
| | | _strMsg = parameters[0].Value?.ToString() ?? ""; |
| | | _status = Convert.ToInt32(parameters[1].Value ?? -1); |
| | | |
| | | if (_status <= 0) throw new Exception(_strMsg); |
| | | |
| | | return new |
| | | { |
| | | message = _strMsg, |
| | | status = _status |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"检验单更新失败:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |