From 10f53087313130934c23d7f2e53a6a73fde17e09 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期一, 23 十二月 2024 21:31:30 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs"
index e6305ee..20b4120 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs"
@@ -1,11 +1,29 @@
 锘�
+using SqlSugar;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.BasicInfo;
+
 namespace WIDESEAWCS_Server.HostedService
 {
     public class WarehouseHostedService : IHostedService
     {
         public Task StartAsync(CancellationToken cancellationToken)
         {
-            throw new NotImplementedException();
+            string connStr = AppSettings.GetValue("WMSConnectionStrings");
+            if (string.IsNullOrEmpty(connStr))
+            {
+                throw new Exception("WMS杩炴帴瀛楃涓查敊璇�");
+            }
+            SqlSugarClient sugarClient = new SqlSugarClient(new ConnectionConfig()
+            {
+                ConnectionString = connStr,
+                IsAutoCloseConnection = true,
+                DbType = DbType.SqlServer
+            });
+
+            List<WarehouseDTO> warehouses = sugarClient.Queryable<WarehouseDTO>().ToList();
+
+            return Task.CompletedTask;
         }
 
         public Task StopAsync(CancellationToken cancellationToken)

--
Gitblit v1.9.3