| | |
| | |  |
| | | 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) |