From e7b1f691769fc9f6a5b8cb2dc0cbefc74c551128 Mon Sep 17 00:00:00 2001
From: wet <1034391973@qq.com>
Date: Wed, 16 Nov 2022 15:03:03 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BookingOrder/BookingOrderService.cs | 8 ++++----
.../BookingOrder/IBookingOrderService.cs | 4 ++--
.../Service/CommonDB/CommonDBService.cs | 8 +++++++-
Myshipping.Web.Core/Startup.cs | 18 ++++++++++--------
4 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
index 72f9a69c..d55ce212 100644
--- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
@@ -470,9 +470,9 @@ namespace Myshipping.Application
///
///
[HttpGet("/BookingOrder/getRemark")]
- public async Task GetRemark(long Id)
+ public async Task> GetRemark(long Id)
{
- var list = await _bookingremark.FirstOrDefaultAsync(u => u.PId == Id);
+ var list = await _bookingremark.AsQueryable().Where(u => u.PId == Id).ToListAsync();
return list;
}
@@ -555,9 +555,9 @@ namespace Myshipping.Application
///
///
[HttpGet("/BookingOrder/getFile")]
- public async Task GetFile(long Id)
+ public async Task> GetFile(long Id)
{
- var list = await _bookingfile.FirstOrDefaultAsync(u => u.BookingId == Id);
+ var list = await _bookingfile.AsQueryable().Where(u => u.BookingId == Id).ToListAsync();
return list;
}
diff --git a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs
index bcd5b9a4..cf963c3e 100644
--- a/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/IBookingOrderService.cs
@@ -19,14 +19,14 @@ namespace Myshipping.Application
Task GetLog(long Id);
- Task GetRemark(long Id);
+ Task> GetRemark(long Id);
Task AddRemark(BookingRemarkDto dto);
Task AddFile(IFormFile file, [FromForm] BookingFileDto dto);
- Task GetFile(long Id);
+ Task> GetFile(long Id);
Task SendTrace(string BusinessId,string YARDID, string YARD, string MBLNO);
diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs
index da28b91c..eaa84535 100644
--- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs
+++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using System.Collections.Generic;
using System;
using Myshipping.Core.Service.CommonDB.Dto;
+using Microsoft.Extensions.Logging;
namespace Myshipping.Core.Service;
///
@@ -39,7 +40,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
private readonly SqlSugarRepository _mappingPackageRep;
private readonly SqlSugarRepository _mappingServiceRep;
private readonly ISysCacheService _sysCacheService;
-
+ private readonly ILogger _logger;
public CommonDBService(SqlSugarRepository codeCarrierRep,
SqlSugarRepository codeVesselRep,
SqlSugarRepository codeForwarderRep,
@@ -59,6 +60,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
SqlSugarRepository mappingPortRep,
SqlSugarRepository mappingPackageRep,
SqlSugarRepository mappingServiceRep,
+ ILogger logger,
ISysCacheService sysCacheService)
{
_codeCarrierRep = codeCarrierRep;
@@ -81,6 +83,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_mappingPortRep = mappingPortRep;
_mappingPackageRep = mappingPackageRep;
_mappingServiceRep = mappingServiceRep;
+ _logger = logger;
+
}
@@ -786,6 +790,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task> GetAllCarrier()
{
var list = await _codeCarrierRep.ToListAsync();
+ _logger.LogInformation("船公司缓存");
+ _logger.LogInformation(list.ToJsonString());
await _sysCacheService.SetAllCodeCarrier(list);
return list;
}
diff --git a/Myshipping.Web.Core/Startup.cs b/Myshipping.Web.Core/Startup.cs
index a953057c..684fa813 100644
--- a/Myshipping.Web.Core/Startup.cs
+++ b/Myshipping.Web.Core/Startup.cs
@@ -114,14 +114,7 @@ public class Startup : AppStartup
});
#region 缓存
- //缓存EDI数据
- App.GetService().CacheData();
-
- //缓存字典数据
- App.GetService().CacheData();
-
- //租户参数
- App.GetService().CacheData();
+
//船公司
App.GetService().GetAllCarrier();
@@ -177,6 +170,15 @@ public class Startup : AppStartup
App.GetService().GetAllMappingPackage();
//运输服务映射
App.GetService().GetAllMappingService();
+
+ //缓存EDI数据
+ App.GetService().CacheData();
+
+ //缓存字典数据
+ App.GetService().CacheData();
+
+ //租户参数
+ App.GetService().CacheData();
#endregion
}