From 135599eb59bccb5f8f8a567ad174cc2af4357887 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 13 六月 2025 14:39:25 +0800 Subject: [PATCH] 1.采购退货单优化 2.采购退料单拆分 3.采购入库优化 --- service/QC/IpqcService.cs | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 42 insertions(+), 8 deletions(-) diff --git a/service/QC/IpqcService.cs b/service/QC/IpqcService.cs index 5fb5477..d6c87f0 100644 --- a/service/QC/IpqcService.cs +++ b/service/QC/IpqcService.cs @@ -7,6 +7,7 @@ using SqlSugar; using System.Data; using System.Data.SqlClient; +using System.Text; using static Azure.Core.HttpHeader; using static Microsoft.EntityFrameworkCore.DbLoggerCategory; @@ -152,6 +153,7 @@ 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); @@ -159,20 +161,22 @@ //鏇存柊涓嶅悎鏍兼弿杩� - 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); } @@ -335,4 +339,34 @@ 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; + } } \ No newline at end of file -- Gitblit v1.9.3