From 0aa54059b26e6641196e9953490dd18616e916e3 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 10 九月 2025 17:26:47 +0800
Subject: [PATCH] 精简修正代码

---
 service/Warehouse/MesXsthManager.cs |   65 +++++++++++++++-----------------
 1 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/service/Warehouse/MesXsthManager.cs b/service/Warehouse/MesXsthManager.cs
index 27d063f..effe333 100644
--- a/service/Warehouse/MesXsthManager.cs
+++ b/service/Warehouse/MesXsthManager.cs
@@ -1,15 +1,11 @@
-锘縰sing Masuit.Tools;
-using MES.Service.Modes;
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using Masuit.Tools;
 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;
 
 namespace NewPdaSqlServer.service.Warehouse;
 
@@ -19,7 +15,7 @@
     ///     鑾峰彇閿�鍞��璐х敵璇峰垪琛�
     /// </summary>
     /// <returns>閿�鍞��璐х敵璇峰垪琛�</returns>
-    public dynamic GetXsthBillNo(WarehouseQuery query,dynamic RequestInfo)
+    public dynamic GetXsthBillNo(WarehouseQuery query, dynamic RequestInfo)
     {
         var orgId = RequestInfo.OrgId;
 
@@ -29,17 +25,18 @@
         // 鑾峰彇鏈畬鎴愮殑閫�鏂欏崟鍙峰垪琛�
         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)
@@ -71,24 +68,25 @@
 
         // 鑾峰彇鏈畬鎴愮殑閿�鍞��璐ф槑缁�
         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
         {
-            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();   // 宸叉壂鐗╂枡
+            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(); // 宸叉壂鐗╂枡
             return new
             {
-                items = items,
-                ysitems = ysitems,
+                items,
+                ysitems,
                 Count = items.Count + ysitems.Count
             };
         }
@@ -100,7 +98,7 @@
     }
 
     /// <summary>
-    /// 閿�鍞��璐у叆搴�
+    ///     閿�鍞��璐у叆搴�
     /// </summary>
     /// <param name="unity"></param>
     /// <returns></returns>
@@ -112,7 +110,8 @@
         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("鐢宠鍗曞彿涓嶅厑璁镐负绌�");
 
@@ -130,12 +129,11 @@
                         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);
@@ -149,7 +147,6 @@
                     return _strMsg;
 
                     //return 0;
-
                 }
                 catch (Exception ex)
                 {

--
Gitblit v1.9.3