| | |
| | | using MES.Service.Models; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Text; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using NewPdaSqlServer.DB; |
| | | using NewPdaSqlServer.Dto.service; |
| | | using NewPdaSqlServer.entity; |
| | | using NewPdaSqlServer.util; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Text; |
| | | using static Azure.Core.HttpHeader; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | |
| | | namespace NewPdaSqlServer.service.QC; |
| | | |
| | |
| | | a.ItemName.Contains(queryObj.keyword) || |
| | | a.Daa001.Contains(queryObj.keyword) || |
| | | a.ReleaseNo.Contains(queryObj.keyword) || |
| | | a.DepartmentName.Contains(queryObj.keyword )|| |
| | | a.XtName.Contains(queryObj.keyword) |
| | | a.DepartmentName.Contains(queryObj.keyword) || |
| | | a.XtName.Contains(queryObj.keyword) |
| | | ) |
| | | .WhereIF(UtilityHelper.CheckGuid(parsedGuid), |
| | | a => a.Guid == parsedGuid.ToString() ) |
| | | a => a.Guid == parsedGuid.ToString()) |
| | | .Where(a => (a.FSubmit ?? 0) == 0) |
| | | .OrderByDescending(a => a.CreateDate) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount); |
| | |
| | | { |
| | | var parsedGuid = Guid.Empty; |
| | | |
| | | var sql = string.Format(@"SELECT [a].[guid] AS [Guid], |
| | | var sql = string.Format( |
| | | @"SELECT [a].[guid] AS [Guid], |
| | | [a].[parent_guid] AS [ParentGuid], |
| | | [a].[release_no] AS [ReleaseNo], |
| | | [a].[check_qyt] AS [CheckQyt], |
| | |
| | | |
| | | public (List<VIpqcXj> item, int TotalCount) getPageXj(XJPageResult queryObj) |
| | | { |
| | | |
| | | |
| | | |
| | | var totalCount = 0; |
| | | var parsedGuid = Guid.Empty; |
| | | if (!queryObj.id.IsNullOrEmpty()) |
| | |
| | | throw new ApplicationException("GUID转换错误"); |
| | | } |
| | | |
| | | var sql = string.Format(@"EXEC prc_pda_ipqc_GetXjList '{0}'", parsedGuid); |
| | | var sql = |
| | | string.Format(@"EXEC prc_pda_ipqc_GetXjList '{0}'", parsedGuid); |
| | | |
| | | var pageList = Db.Ado.SqlQuery<VIpqcXj>(sql).ToList(); |
| | | |
| | |
| | | //更新不合格描述 |
| | | public int updateIpqcRzxx(dynamic dto) |
| | | { |
| | | if (dto == null) throw new ArgumentNullException(nameof(dto), "参数对象不能为 null"); |
| | | if (dto == null) |
| | | throw new ArgumentNullException(nameof(dto), "参数对象不能为 null"); |
| | | if (string.IsNullOrEmpty(dto.pid?.ToString())) |
| | | throw new ArgumentException("项目明细id存在问题,请联系管理员!", nameof(dto.pid)); |
| | | |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@inRzxxValue", dto.inRzxxValue), |
| | | new("@pid", dto.pid) |
| | | }; |
| | |
| | | throw new ArgumentException("用户账号不能为空", nameof(query.userAccount)); |
| | | |
| | | if (string.IsNullOrEmpty(query.inOrderGuid1?.ToString())) |
| | | throw new ArgumentException("检验单GUID不能为空", nameof(query.inOrderGuid1)); |
| | | throw new ArgumentException("检验单GUID不能为空", |
| | | nameof(query.inOrderGuid1)); |
| | | |
| | | if (string.IsNullOrEmpty(query.DAA001?.ToString())) |
| | | throw new ArgumentException("工单号不能为空", nameof(query.inOrderGuid1)); |
| | | if (string.IsNullOrEmpty(query.DAA001?.ToString())) |
| | | throw new ArgumentException("工单号不能为空", nameof(query.inOrderGuid1)); |
| | | |
| | | var _strMsg = ""; |
| | | var _strMsg = ""; |
| | | var _status = -1; |
| | | |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | |
| | | SqlParameter[] parameters = |
| | | 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 } |
| | | 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); |
| | |
| | | |
| | | if (_status <= 0) throw new Exception(_strMsg); |
| | | |
| | | return new |
| | | return new |
| | | { |
| | | message = _strMsg, |
| | | status = _status |
| | |
| | | } |
| | | } |
| | | |
| | | public int UpdateTableConfig(string selectedWater, string selectedFlow, string tableData, string mxguid) |
| | | public int UpdateTableConfig(string selectedWater, string selectedFlow, |
| | | string tableData, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@selectedWater", selectedWater), |
| | | new("@selectedFlow", selectedFlow), |
| | | new("@tableData", tableData), |
| | |
| | | |
| | | public dynamic GetTableConfig(string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@mxguid", mxguid) |
| | | }; |
| | | |
| | |
| | | WHERE guid = @mxguid"; |
| | | |
| | | var result = Db.Ado.SqlQuery<dynamic>(sql, sqlParams).FirstOrDefault(); |
| | | |
| | | |
| | | if (result == null) |
| | | throw new Exception("配置信息查询结果为空"); |
| | | |
| | |
| | | |
| | | public List<dynamic> GetRzxxList(string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@mxguid", mxguid) |
| | | }; |
| | | |
| | |
| | | )"; |
| | | |
| | | var result = Db.Ado.SqlQuery<dynamic>(sql, sqlParams); |
| | | |
| | | |
| | | if (result == null || result.Count == 0) |
| | | throw new Exception("未找到相关认证信息"); |
| | | |
| | |
| | | |
| | | public int UpdateScDate(string scDateValue, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@scDateValue", scDateValue), |
| | | new("@mxguid", mxguid) |
| | | }; |
| | |
| | | |
| | | public int UpdateRzxxNum(string ipqcrzxxNum, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@ipqcrzxxNum", ipqcrzxxNum), |
| | | new("@mxguid", mxguid) |
| | | }; |
| | |
| | | |
| | | public int UpdateCpscs(string ipqCpscs, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | var sqlParams = new List<SugarParameter> |
| | | { |
| | | new("@ipqCpscs", ipqCpscs), |
| | | new("@mxguid", mxguid) |
| | | }; |
| | |
| | | |
| | | public dynamic GetIpqcXjDaa(dynamic unity) |
| | | { |
| | | |
| | | var sqlParams = new List<SugarParameter> { }; |
| | | var sqlParams = new List<SugarParameter>(); |
| | | sqlParams.Add(new("@xt", unity.xt)); |
| | | |
| | | var sql2 = new StringBuilder(@" |
| | |
| | | |
| | | var XcslItem = Db.Ado.SqlQuery<dynamic>(sql2.ToString(), sqlParams); |
| | | |
| | | if (XcslItem == null) |
| | | { |
| | | throw new Exception("该条件下无对应工单信息,请重新输入!"); |
| | | } |
| | | if (XcslItem == null) throw new Exception("该条件下无对应工单信息,请重新输入!"); |
| | | |
| | | return XcslItem; |
| | | } |
| | |
| | | throw new ArgumentException("用户名不允许为空", nameof(query.userAccount)); |
| | | |
| | | if (string.IsNullOrEmpty(query.inOrderGuid1?.ToString())) |
| | | throw new ArgumentException("检验单主表GUID不允许为空", nameof(query.inOrderGuid1)); |
| | | throw new ArgumentException("检验单主表GUID不允许为空", |
| | | nameof(query.inOrderGuid1)); |
| | | |
| | | var _strMsg = ""; |
| | | var _status = -1; |
| | |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | |
| | | SqlParameter[] parameters = |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@pi_user", SqlDbType.NVarChar, 100) { Value = query.userAccount }, |
| | | new("@pi_user", SqlDbType.NVarChar, 100) |
| | | { Value = query.userAccount }, |
| | | new("@pi_gw", SqlDbType.NVarChar, 100) { Value = query.gw }, |
| | | new("@pi_QaGuid1", SqlDbType.NVarChar, 100) { Value = query.inOrderGuid1 }, |
| | | new("@po_outMsg", SqlDbType.NVarChar, 2000) { Direction = ParameterDirection.Output }, |
| | | new("@po_outStatus", SqlDbType.Int) { Direction = ParameterDirection.Output } |
| | | new("@pi_QaGuid1", SqlDbType.NVarChar, 100) |
| | | { Value = query.inOrderGuid1 }, |
| | | new("@po_outMsg", SqlDbType.NVarChar, 2000) |
| | | { Direction = ParameterDirection.Output }, |
| | | new("@po_outStatus", SqlDbType.Int) |
| | | { Direction = ParameterDirection.Output } |
| | | }; |
| | | |
| | | cmd.Parameters.AddRange(parameters); |
| | |
| | | |
| | | if (_status <= 0) throw new Exception(_strMsg); |
| | | |
| | | return new |
| | | return new |
| | | { |
| | | message = _strMsg, |
| | | status = _status, |
| | | qaGuid = query.inOrderGuid1, |
| | | gw = query.gw |
| | | query.gw |
| | | }; |
| | | } |
| | | catch (Exception ex) |