| | |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Text; |
| | | using static Azure.Core.HttpHeader; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | |
| | |
| | | a.Order, |
| | | a.Ybsl, |
| | | a.ISRZXX, |
| | | a.IPQCRZXX |
| | | a.IPQCRZXX, |
| | | a.IPQCRZXXDate, |
| | | a.IPQCRZXXNum, |
| | | a.IPQCpscs, |
| | | a.FcheckType, |
| | | }).Select((a, b) => new MesQaItemsDetectDetail5 |
| | | { |
| | | Guid = a.Guid, |
| | |
| | | Ybsl = a.Ybsl, |
| | | YbslIn = Ybsl_In, |
| | | ISRZXX = a.ISRZXX, |
| | | IPQCRZXX = a.IPQCRZXX |
| | | IPQCRZXX = a.IPQCRZXX, |
| | | IPQCRZXXDate = a.IPQCRZXXDate.ToString(), |
| | | IPQCRZXXNum = a.IPQCRZXXNum, |
| | | IPQCpscs = a.IPQCpscs, |
| | | FcheckType =a.FcheckType, |
| | | }).OrderBy(a => a.Order) |
| | | .ToList(); |
| | | } |
| | |
| | | a => a.Guid == parsedGuid.ToString()) |
| | | .Where(a => (a.FSubmit ?? 0) == 0) |
| | | .OrderByDescending(a => a.CreateDate) |
| | | .OrderBy(a => a.checkTimeSlot) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit, ref totalCount); |
| | | |
| | | return (pageList, totalCount); |
| | |
| | | |
| | | |
| | | //更新不合格描述 |
| | | public int updateIpqcRzxx(LLJDto dto) |
| | | public int updateIpqcRzxx(dynamic dto) |
| | | { |
| | | if (dto == null) throw new ArgumentNullException(nameof(dto), "参数对象不能为 null"); |
| | | |
| | | // 参数校验(根据存储过程新增参数) |
| | | if (string.IsNullOrEmpty(dto.pid?.ToString())) |
| | | throw new ArgumentException("项目明细id存在问题,请联系管理员!", nameof(dto.pid)); |
| | | |
| | | var withOracle = Db.Updateable<MesQaItemsDetectDetail5>() |
| | | .SetColumns(s => s.IPQCRZXX == dto.inRzxxValue) |
| | | .Where(s => s.Guid.ToString() == dto.pid) |
| | | .ExecuteCommand(); |
| | | var sqlParams = new List<SugarParameter> { |
| | | new("@inRzxxValue", dto.inRzxxValue), |
| | | new("@pid", dto.pid) |
| | | }; |
| | | |
| | | return withOracle; |
| | | var sql = @"UPDATE MES_QA_ITEMS_DETECT_DETAIL5 |
| | | SET ipqc_rzxx = @inRzxxValue |
| | | WHERE guid = @pid"; |
| | | |
| | | return Db.Ado.ExecuteCommand(sql, sqlParams); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public List<dynamic> GetRzxxList(string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | new("@mxguid", mxguid) |
| | | }; |
| | | |
| | | var sql = @"SELECT a.s_type, a.defect_name |
| | | FROM [dbo].[MES_DEFECT_CODE] a |
| | | WHERE a.s_type = '认证信息' |
| | | AND a.pid = ( |
| | | SELECT TOP 1 b.guid |
| | | FROM [dbo].[MES_DEFECT_CODE] b |
| | | INNER JOIN [dbo].[MES_QA_ITEMS_DETECT_DETAIL5] d |
| | | ON b.defect_name = d.fcheck_item |
| | | WHERE d.guid = @mxguid |
| | | ORDER BY b.guid |
| | | )"; |
| | | |
| | | var result = Db.Ado.SqlQuery<dynamic>(sql, sqlParams); |
| | | |
| | | if (result == null || result.Count == 0) |
| | | throw new Exception("未找到相关认证信息"); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public int UpdateScDate(string scDateValue, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | new("@scDateValue", scDateValue), |
| | | new("@mxguid", mxguid) |
| | | }; |
| | | |
| | | var sql = @"UPDATE MES_QA_ITEMS_DETECT_DETAIL5 |
| | | SET ipqc_rzxx_date = @scDateValue |
| | | WHERE guid = @mxguid"; |
| | | |
| | | return Db.Ado.ExecuteCommand(sql, sqlParams); |
| | | } |
| | | |
| | | public int UpdateRzxxNum(string ipqcrzxxNum, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | new("@ipqcrzxxNum", ipqcrzxxNum), |
| | | new("@mxguid", mxguid) |
| | | }; |
| | | |
| | | var sql = @"UPDATE MES_QA_ITEMS_DETECT_DETAIL5 |
| | | SET ipqc_rzxx_num = @ipqcrzxxNum |
| | | WHERE guid = @mxguid"; |
| | | |
| | | return Db.Ado.ExecuteCommand(sql, sqlParams); |
| | | } |
| | | |
| | | public int UpdateCpscs(string ipqCpscs, string mxguid) |
| | | { |
| | | var sqlParams = new List<SugarParameter> { |
| | | new("@ipqCpscs", ipqCpscs), |
| | | new("@mxguid", mxguid) |
| | | }; |
| | | |
| | | var sql = @"UPDATE MES_QA_ITEMS_DETECT_DETAIL5 |
| | | SET ipqc_pscs = @ipqCpscs |
| | | WHERE guid = @mxguid"; |
| | | |
| | | return Db.Ado.ExecuteCommand(sql, sqlParams); |
| | | } |
| | | |
| | | |
| | | public dynamic GetIpqcXjDaa(dynamic unity) |
| | | { |
| | | |
| | | var sqlParams = new List<SugarParameter> { }; |
| | | sqlParams.Add(new("@xt", unity.xt)); |
| | | |
| | | var sql2 = new StringBuilder(@" |
| | | SELECT '['+DAA001+']['+DAA021+']' AS daaInfo,DAA001,DAA021 |
| | | FROM WOMDAA |
| | | WHERE DAA015 = @xt AND daa018 NOT IN ('W:完工', 'D:待开工')"); |
| | | |
| | | if (!string.IsNullOrWhiteSpace(unity.selectKey?.ToString())) |
| | | { |
| | | sqlParams.Add(new("@selectKey", unity.selectKey)); |
| | | sql2.Append(@" |
| | | AND (DAA001 LIKE '%' + @selectKey + '%' |
| | | OR DAA021 LIKE '%' + @selectKey + '%')"); |
| | | } |
| | | |
| | | var XcslItem = Db.Ado.SqlQuery<dynamic>(sql2.ToString(), sqlParams); |
| | | |
| | | if (XcslItem == null) |
| | | { |
| | | throw new Exception("该条件下无对应工单信息,请重新输入!"); |
| | | } |
| | | |
| | | return XcslItem; |
| | | } |
| | | } |