From fd2b52ddb4f9a1fb5d342acad52ff3455249d022 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期一, 26 五月 2025 17:14:18 +0800 Subject: [PATCH] 1.期初条码打印——PDA --- service/Warehouse/InventoryManager.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/service/Warehouse/InventoryManager.cs b/service/Warehouse/InventoryManager.cs index 66f8477..4a876e6 100644 --- a/service/Warehouse/InventoryManager.cs +++ b/service/Warehouse/InventoryManager.cs @@ -4,6 +4,7 @@ using NewPdaSqlServer.service.@base; using NewPdaSqlServer.util; using SqlSugar; +using System.Text; namespace NewPdaSqlServer.service.Warehouse; @@ -268,4 +269,61 @@ // 杩斿洖鎴愬姛淇℃伅 return query; } + + + public dynamic GetDepoptsInfo(dynamic unity) + { + + //// 浣跨敤鍙傛暟鍖栨煡璇㈤槻姝QL娉ㄥ叆 + var sqlParams = new List<SugarParameter> { new("@sectionCode", unity.sectionCode) }; + + var sql2 = @" SELECT TOP 1 B.depot_code + '('+B.depot_name+')' depotsInfo, + B.FSubsidiary, + C.FNumber + '('+C.NAME+')' orgInfo + FROM MES_DEPOT_SECTIONS A + LEFT JOIN + MES_DEPOTS B ON A.depot_guid = B.Guid + LEFT JOIN SYS_ORGANIZATION C ON C.FID = B.FSubsidiary + WHERE a.depot_section_code = @sectionCode;"; + + var XcslItem = Db.Ado.SqlQuery<dynamic>(sql2, sqlParams).FirstOrDefault(); + + // 妫�鏌ョ粨鏋滄湁鏁堟�� + if (XcslItem == null) + { + throw new Exception($"搴撲綅 [{unity.sectionCode}] 涓嶅瓨鍦紝鎴栨墍灞炰粨搴撶姸鎬佸紓甯革紙鍙兘琚鐢ㄦ垨鍒犻櫎锛夈��"); + } + + return XcslItem; // 杩斿洖绗竴琛屾暟鎹紝濡傛灉娌℃湁鍒欒繑鍥� null + } + + + + public dynamic GetItemsList(dynamic unity) + { + var sqlParams = new List<SugarParameter> { new("@orgId", unity.orgId) }; + + var sql2 = new StringBuilder(@" + SELECT TOP 20 item_id, item_no, item_name, item_model,item_no+'---'+item_name AS wlInfo + FROM MES_ITEMS + WHERE FSubsidiary = @orgId"); + + if (!string.IsNullOrWhiteSpace(unity.selectKey?.ToString())) + { + sqlParams.Add(new("@selectKey", unity.selectKey)); + sql2.Append(@" + AND (item_no LIKE '%' + @selectKey + '%' + OR item_name LIKE '%' + @selectKey + '%' + OR item_model 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