From 00a72fff219241eb5b0405a066cc859d07cf7735 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期三, 17 九月 2025 10:23:44 +0800 Subject: [PATCH] 1111 --- service/Warehouse/MesXsthManager.cs | 66 +++++++++++++++++--------------- 1 files changed, 35 insertions(+), 31 deletions(-) diff --git a/service/Warehouse/MesXsthManager.cs b/service/Warehouse/MesXsthManager.cs index effe333..baf36be 100644 --- a/service/Warehouse/MesXsthManager.cs +++ b/service/Warehouse/MesXsthManager.cs @@ -1,11 +1,16 @@ -锘縰sing System.Data; -using System.Data.SqlClient; -using Masuit.Tools; +锘縰sing Masuit.Tools; +using MES.Service.Modes; using NewPdaSqlServer.DB; using NewPdaSqlServer.Dto.service; using NewPdaSqlServer.entity; +using NewPdaSqlServer.entity.Base; using NewPdaSqlServer.util; +using OracleInternal.Sharding; using SqlSugar; +using SqlSugar.Extensions; +using System.Data; +using System.Data.SqlClient; +using DbHelperSQL = NewPdaSqlServer.DB.DbHelperSQL; namespace NewPdaSqlServer.service.Warehouse; @@ -15,7 +20,7 @@ /// 鑾峰彇閿�鍞��璐х敵璇峰垪琛� /// </summary> /// <returns>閿�鍞��璐х敵璇峰垪琛�</returns> - public dynamic GetXsthBillNo(WarehouseQuery query, dynamic RequestInfo) + public dynamic GetXsthBillNo(WarehouseQuery query,dynamic RequestInfo) { var orgId = RequestInfo.OrgId; @@ -25,18 +30,17 @@ // 鑾峰彇鏈畬鎴愮殑閫�鏂欏崟鍙峰垪琛� var parameters = new[] { - new SugarParameter("@pi_orgId", orgId), - new SugarParameter("@inP1", null), - new SugarParameter("@inP2", null), - new SugarParameter("@inP3", null), - new SugarParameter("@inP4", null) + new SugarParameter("@pi_orgId", orgId), + new SugarParameter("@inP1", null), + new SugarParameter("@inP2", null), + new SugarParameter("@inP3", null), + new SugarParameter("@inP4", null) }; try { // 杩斿洖鍗曞彿瀛楃涓插垪琛� var blDetails = Db.Ado.SqlQuery<string>( - "EXEC prc_pda_xsth_list @pi_orgId,@inP1,@inP2,@inP3,@inP4", - parameters); + "EXEC prc_pda_xsth_list @pi_orgId,@inP1,@inP2,@inP3,@inP4", parameters); return blDetails; } catch (Exception ex) @@ -68,25 +72,24 @@ // 鑾峰彇鏈畬鎴愮殑閿�鍞��璐ф槑缁� var parameters = new[] - { - new SugarParameter("@billNo", query.billNo), - new SugarParameter("@pi_orgId", orgId), - new SugarParameter("@inP1", null), - new SugarParameter("@inP2", null), - new SugarParameter("@inP3", null), - new SugarParameter("@inP4", null) - }; +{ + new SugarParameter("@billNo", query.billNo), + new SugarParameter("@pi_orgId",orgId), + new SugarParameter("@inP1", null), + new SugarParameter("@inP2", null), + new SugarParameter("@inP3", null), + new SugarParameter("@inP4", null) + }; try { - var blDetails = Db.Ado.SqlQuery<dynamic>( - "EXEC prc_pda_xsth_detailList @billNo,@pi_orgId,@inP1,@inP2,@inP3,@inP4", - parameters); - var items = blDetails.Where(x => x.DSQty > 0).ToList(); // 寰呮壂鐗╂枡 - var ysitems = blDetails.Where(x => x.SQty > 0).ToList(); // 宸叉壂鐗╂枡 + List<dynamic>? blDetails = Db.Ado.SqlQuery<dynamic>( + "EXEC prc_pda_xsth_detailList @billNo,@pi_orgId,@inP1,@inP2,@inP3,@inP4", parameters); + var items = blDetails.Where(x => x.DSQty > 0).ToList(); // 寰呮壂鐗╂枡 + var ysitems = blDetails.Where(x => x.SQty > 0).ToList(); // 宸叉壂鐗╂枡 return new { - items, - ysitems, + items = items, + ysitems = ysitems, Count = items.Count + ysitems.Count }; } @@ -98,7 +101,7 @@ } /// <summary> - /// 閿�鍞��璐у叆搴� + /// 閿�鍞��璐у叆搴� /// </summary> /// <param name="unity"></param> /// <returns></returns> @@ -110,8 +113,7 @@ using (var conn = new SqlConnection(DbHelperSQL.strConn)) { if (unity.userName.IsNullOrEmpty()) throw new Exception("鐢ㄦ埛鍚嶄笉鍏佽涓虹┖"); - if (unity.sectionCode.IsNullOrEmpty()) - throw new Exception("搴撲綅缂栧彿涓嶅厑璁镐负绌�"); + if (unity.sectionCode.IsNullOrEmpty()) throw new Exception("搴撲綅缂栧彿涓嶅厑璁镐负绌�"); if (unity.barcode.IsNullOrEmpty()) throw new Exception("鏉$爜涓嶅厑璁镐负绌�"); if (unity.billNo.IsNullOrEmpty()) throw new Exception("鐢宠鍗曞彿涓嶅厑璁镐负绌�"); @@ -129,11 +131,12 @@ new("@pi_user", unity.userName), new("@pi_barcode", unity.barcode), new("@pi_sectionCode", unity.sectionCode), - new("@pi_billno", unity.billNo) + new("@pi_billno", unity.billNo), + }; parameters[0].Direction = ParameterDirection.Output; parameters[1].Direction = ParameterDirection.Output; - // parameters[2].Direction = ParameterDirection.Output; + // parameters[2].Direction = ParameterDirection.Output; foreach (var parameter in parameters) cmd.Parameters.Add(parameter); @@ -147,6 +150,7 @@ return _strMsg; //return 0; + } catch (Exception ex) { -- Gitblit v1.9.3