From a118d7fe06475cf28efc6b565348933592278c5e Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期四, 27 十一月 2025 09:40:51 +0800
Subject: [PATCH] 代码提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs |    2 +-
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs                   |    8 ++++----
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs                      |   29 +++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 5 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs"
new file mode 100644
index 0000000..d093097
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs"
@@ -0,0 +1,29 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.DB;
+using WIDESEA_Core.Seed;
+
+namespace WIDESEA_Core.Helper
+{
+    public class SqlSugarHelper
+    {
+        //澶氬簱鎯呭喌涓嬩娇鐢ㄨ鏄庯細
+        //濡傛灉鏄浐瀹氬搴撳彲浠ヤ紶 new SqlSugarScope(List<ConnectionConfig>,db=>{}) 鏂囨。锛氬绉熸埛
+        //濡傛灉鏄笉鍥哄畾澶氬簱 鍙互鐪嬫枃妗aas鍒嗗簱
+        //鐢ㄥ崟渚嬫ā寮�
+        public static SqlSugarScope DbWMS = new SqlSugarScope(new ConnectionConfig()
+        {
+            ConnectionString = DBContext.GetMainConnectionDb().Connection,
+            //ConnectionString = AppSettings.app(MainDb.ConnectionStringWCS),
+            DbType = DbType.SqlServer,//鏁版嵁搴撶被鍨�
+            IsAutoCloseConnection = true //涓嶈鎴恡rue瑕佹墜鍔╟lose
+        },
+      db =>
+      {
+      });
+    }
+}
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
index 492701c..e52e206 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
@@ -22,16 +22,16 @@
         public IRepository<Dt_StockInfo> Repository => BaseDal;
         private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository;
         private readonly IOutboundOrderService _outboundOrderService;
-        private readonly IOutboundOrderDetailService _outboundOrderDetailService;
+        //private readonly IOutboundOrderDetailService _outboundOrderDetailService;
         private readonly ILocationInfoService _locationInfoService;
-        public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRecordService recordService, ILocationInfoService locationInfoService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService) : base(BaseDal)
+        public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRecordService recordService, ILocationInfoService locationInfoService, IOutboundOrderService outboundOrderService) : base(BaseDal)
         {
             _mapper = mapper;
             _stockInfoDetailRepository = stockInfoDetailRepository;
             _recordService = recordService;
             _locationInfoService = locationInfoService;
             _outboundOrderService = outboundOrderService;
-            _outboundOrderDetailService = outboundOrderDetailService;
+            //_outboundOrderDetailService = outboundOrderDetailService;
         }
 
         /// <summary>
@@ -289,7 +289,7 @@
             }
 
             // 鑾峰彇鍑哄簱鍗曟槑缁嗭紝鐢ㄤ簬纭畾闇�瑕佺殑鎵规鍜屼緵搴斿晢
-            var orderDetails = _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.OrderId == orderId && x.MaterielCode == materielCode).ToList();
+            var orderDetails = SqlSugarHelper.DbWMS.Queryable<Dt_OutboundOrderDetail>().Where(x => x.OrderId == orderId && x.MaterielCode == materielCode).ToList();
 
             if (!orderDetails.Any())
             {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs"
index 87d98a3..555a83d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs"
@@ -25,7 +25,7 @@
         /// <param name="orderId"></param>
         /// <param name="materielCode"></param>
         /// <returns></returns>
-        [HttpPost, HttpGet, Route("GetStockSelectViews")]
+        [HttpPost, HttpGet, Route("GetStockSelectViews"),AllowAnonymous]
         public List<StockSelectViewDTO> GetStockSelectViews(int orderId, string materielCode)
         {
             return Service.GetStockSelectViews(orderId, materielCode);

--
Gitblit v1.9.3