booking_auth_dev
jianghaiqing 2 years ago
commit b7266ffd98

File diff suppressed because it is too large Load Diff

@ -16,6 +16,11 @@ namespace Myshipping.Application.Entity
/// </summary>
[Description("单据ID")]
public long? BILLID { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
public string CTNCODE { get; set; }
/// <summary>
/// 箱型
/// </summary>

@ -26,7 +26,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 附件类型id
/// </summary>
public long? TypeId { get; set; }
public string TypeCode { get; set; }
/// <summary>
/// 附件类型
/// </summary>

@ -569,6 +569,10 @@ namespace Myshipping.Application.Entity
/// </summary>
public string THIRDPAYADDR { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YARDCONTRACTTEL { get; set; }

@ -34,6 +34,81 @@
订舱附件文件配置
</summary>
</member>
<member name="T:Myshipping.Application.EDI.XiahuozhiHelpler">
<summary>
下货纸辅助类
</summary>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.formatEdiStr(System.String,System.String)">
<summary>
各种文本转义字符东胜7移植
</summary>
<param name="fileType">文件类型例如txt、xml</param>
<param name="str">文本字符串</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetCtnEDICode(System.String,System.String)">
<summary>
获取箱型的EDI代码
</summary>
<param name="ctnCode"></param>
<param name="EDINAME"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllCodeCtn">
<summary>
获取所有箱型(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllCodeCarrier">
<summary>
获取所有船司(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllMappingCtn">
<summary>
获取所有箱型映射(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllMappingCarrier">
<summary>
获取所有船司映射(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllCodeFrt">
<summary>
获取所有付费方式(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllMappingFrt">
<summary>
获取所有付费方式映射(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllTenantParam">
<summary>
获取所有公司参数(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllCodeVessel">
<summary>
获取所有船名(使用缓存)
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Application.EDI.XiahuozhiHelpler.GetAllMappingVessel">
<summary>
获取所有船名映射(使用缓存)
</summary>
<returns></returns>
</member>
<member name="T:Myshipping.Application.Entity.BookingCtn">
<summary>
@ -44,6 +119,11 @@
单据ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingCtn.CTNCODE">
<summary>
箱型代码
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingCtn.CTNALL">
<summary>
箱型
@ -214,7 +294,7 @@
文件路径
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingFile.TypeId">
<member name="P:Myshipping.Application.Entity.BookingFile.TypeCode">
<summary>
附件类型id
</summary>
@ -969,6 +1049,11 @@
第三付款地
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrder.YARDCONTRACT">
<summary>
场站联系人
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrder.YARDCONTRACTTEL">
<summary>
场站联系人电话
@ -1334,6 +1419,11 @@
单据ID
</summary>
</member>
<member name="P:Myshipping.Application.BookingCtnDto.CTNCODE">
<summary>
箱型代码
</summary>
</member>
<member name="P:Myshipping.Application.BookingCtnDto.CTNALL">
<summary>
箱型
@ -2620,6 +2710,11 @@
第三付款地
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderDto.YARDCONTRACT">
<summary>
场站联系人
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderDto.YARDCONTRACTTEL">
<summary>
场站联系人电话
@ -3350,6 +3445,11 @@
第三付款地
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderInput.YARDCONTRACT">
<summary>
场站联系人
</summary>
</member>
<member name="P:Myshipping.Application.BookingOrderInput.YARDCONTRACTTEL">
<summary>
场站联系人电话

@ -18,7 +18,10 @@ namespace Myshipping.Application
/// 单据ID
/// </summary>
public long? BILLID { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
public string CTNCODE{ get; set;}
/// <summary>
/// 箱型
/// </summary>

@ -27,6 +27,10 @@ using Myshipping.Application.ConfigOption;
using System.IO;
using Yitter.IdGenerator;
using Myshipping.Core.Entity;
using Furion.RemoteRequest.Extensions;
using System.Net.Http;
using Myshipping.Core.Service;
using Myshipping.Application.EDI;
namespace Myshipping.Application
{
@ -43,12 +47,16 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingLogDetail> _bookinglogdetail;
private readonly SqlSugarRepository<BookingRemark> _bookingremark;
private readonly SqlSugarRepository<BookingFile> _bookingfile;
SqlSugarRepository<DjyWebsiteAccountConfig> _webconfig;
private readonly SqlSugarRepository<DjyWebsiteAccountConfig> _webconfig;
private readonly SqlSugarRepository<SysDictData> _dicdata;
private readonly ILogger<BookingOrderService> _logger;
private readonly ISysCacheService _cache;
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, SqlSugarRepository<BookingCtnDetail> ctndetailrep,
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyWebsiteAccountConfig> webconfig,
ILogger<BookingOrderService> logger)
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyWebsiteAccountConfig> webconfig, SqlSugarRepository<SysDictData> dicdata,
ILogger<BookingOrderService> logger, ISysCacheService cache)
{
this._logger = logger;
this._rep = rep;
@ -59,6 +67,8 @@ namespace Myshipping.Application
this._bookingremark = bookingremark;
this._bookingfile = bookingfile;
this._webconfig = webconfig;
this._dicdata = dicdata;
this._cache = cache;
}
/// <summary>
@ -244,12 +254,11 @@ namespace Myshipping.Application
});
if (input.YARD!=null&&input.YARDID!=null) {
if (!string.IsNullOrWhiteSpace(input.YARDID) && !string.IsNullOrWhiteSpace(input.YARD) && !string.IsNullOrWhiteSpace(input.MBLNO))
{
await SendTrace(input.YARDID, input.YARD, input.MBLNO);
}
}
/// <summary>
@ -349,6 +358,13 @@ namespace Myshipping.Application
OldValue = _oldvalue,
NewValue = _value,
});
if (descriptor.Name == "YARDID" || descriptor.Name == "YARD" || descriptor.Name == "MBLNO")
{
if (!string.IsNullOrWhiteSpace(input.YARDID) && !string.IsNullOrWhiteSpace(input.YARD) && !string.IsNullOrWhiteSpace(input.MBLNO))
{
await SendTrace(input.YARDID, input.YARD, input.MBLNO);
}
}
}
}
}
@ -398,7 +414,6 @@ namespace Myshipping.Application
return list;
}
/// <summary>
/// 获取备注
/// </summary>
@ -424,8 +439,6 @@ namespace Myshipping.Application
await _bookingremark.InsertAsync(entity);
}
/// <summary>
/// 增加订舱附件
/// </summary>
@ -473,7 +486,7 @@ namespace Myshipping.Application
Id = id,
FileName = originalFilename,
FilePath = fileRelaPath,
TypeId = dto.TypeId,
TypeCode = dto.TypeCode,
TypeName = dto.TypeName,
TenantId = Convert.ToInt16(UserManager.TENANT_ID),
TenantName = UserManager.CLAINM_TENANT_NAME,
@ -486,8 +499,6 @@ namespace Myshipping.Application
}
/// <summary>
/// 获取附件
/// </summary>
@ -502,9 +513,28 @@ namespace Myshipping.Application
public async Task SendTrace(string YARDID, string YARD, string MBLNO)
{
_logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口");
var key = _webconfig.FirstOrDefault(x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID) && x.TypeCode == "seae_billtraceurl");
var url = _cache.GetAllDictData().Result;
BillTraceDto billdto = new BillTraceDto();
List<BillTraceList> billTraceList = new List<BillTraceList>();
billTraceList.Add(new BillTraceList
{
MBLNO = MBLNO,
YARD = YARD,
YardCode = YARDID,
CARRIER = null,
CARRIERID = null,
isBook = false
});
billdto.Children = billTraceList;
billdto.Key = key.Account;
billdto.PWD = key.Password;
var json = billdto.ToJsonString();
var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
_logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString());
}
}
}

@ -33,4 +33,10 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
public bool isBook { get; set; }
}
public class RespCommon
{
public bool Success { get; set; }
public string Message { get; set; }
public int Code { get; set; }
}
}

@ -9,7 +9,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
public class BookingFileDto
{
public long BookingId { get; set; }
public long TypeId { get; set; }
public string TypeCode { get; set; }
public string TypeName { get; set; }
}
}

@ -573,6 +573,10 @@ namespace Myshipping.Application
/// </summary>
public string THIRDPAYADDR { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YARDCONTRACTTEL { get; set; }

@ -704,7 +704,12 @@ namespace Myshipping.Application
/// 第三付款地
/// </summary>
public virtual string THIRDPAYADDR { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>

@ -26,5 +26,7 @@ namespace Myshipping.Application
Task AddFile(IFormFile file, [FromForm] BookingFileDto dto);
Task<BookingFile> GetFile(long Id);
Task SendTrace(string YARDID, string YARD, string MBLNO);
}
}

@ -14,6 +14,8 @@ using Myshipping.Application.ConfigOption;
using System.IO;
using Yitter.IdGenerator;
using Furion.FriendlyException;
using Furion.RemoteRequest.Extensions;
using System.Text;
namespace Myshipping.Application
{
@ -202,5 +204,6 @@ namespace Myshipping.Application
//{
// return await _rep.ToListAsync();
//}
}
}

@ -7,6 +7,6 @@ public class Startup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
}
}

@ -10,5 +10,5 @@
"basePath": "", //使
"relativePath": "Upload/PrintTemplate",
"fileType": [ ".xls", ".xlsx", ".pdf" ]
}
},
}

@ -1,4 +1,5 @@
using System;
using Myshipping.Core.Entity;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

@ -89,6 +89,44 @@ public class CommonConst
/// 付费方式
/// </summary>
public const string CACHE_KEY_COMMON_DB_FRT = "CommonDbFrt";
/// <summary>
/// 箱型映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_CTN = "CommonDbMappingCtn";
/// <summary>
/// 箱型映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_CARRIER = "CommonDbMappingCarrier";
/// <summary>
/// 付费方式映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_FRT = "CommonDbMappingFrt";
/// <summary>
/// 租户参数
/// </summary>
public const string CACHE_KEY_COMMON_DB_TENANT_PARAM_VALUE = "TenantParamValue";
/// <summary>
/// 船名映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_VESSEL = "CommonDbMappingVessel";
/// <summary>
/// 字典映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_DICT_DATA = "DictDataList";
/// <summary>
/// 船名映射
/// </summary>
public const string CACHE_KEY_DJY_EDI_SETTING = "DjyEdiSetting";
#endregion
public const string API_USER_HEADER_KEY = "USER_KEY";

@ -44,5 +44,36 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingCarrier")]
[Description("船公司映射")]
public class MappingCarrier : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -45,5 +45,42 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingCtn")]
[Description("箱型映射")]
public class MappingCtn : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -40,4 +40,40 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingFrt")]
[Description("付费方式映射")]
public class MappingFrt : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -54,4 +54,31 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingVessel")]
[Description("船名映射")]
public class MappingVessel : CommonDbEntity
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,134 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core
{
public static class JsonExtension
{
/// <summary>
/// 获取JObject
/// </summary>
/// <param name="jobj"></param>
/// <param name="prop"></param>
/// <returns></returns>
public static JObject GetJObjectValue(this JObject jobj, string prop)
{
var jt = jobj[prop];
if (jt == null)
{
return null;
}
return jt as JObject;
}
/// <summary>
/// 获取字符串值
/// </summary>
/// <param name="jobj"></param>
/// <param name="prop"></param>
/// <returns></returns>
public static string GetStringValue(this JObject jobj, string prop)
{
var jt = jobj[prop];
if (jt == null)
{
return string.Empty;
}
return jt.ToString();
}
/// <summary>
/// 获取int值
/// </summary>
/// <param name="jobj"></param>
/// <param name="prop"></param>
/// <returns></returns>
public static int GetIntValue(this JObject jobj, string prop)
{
var jt = jobj[prop];
if (jt == null)
{
return 0;
}
var strVal = jt.ToString();
int rtnVal = 0;
int.TryParse(strVal, out rtnVal);
return rtnVal;
}
/// <summary>
/// 获取decimal值
/// </summary>
/// <param name="jobj"></param>
/// <param name="prop"></param>
/// <returns></returns>
public static decimal GetDecimalValue(this JObject jobj, string prop)
{
var jt = jobj[prop];
if (jt == null)
{
return 0;
}
var strVal = jt.ToString();
decimal rtnVal = 0;
decimal.TryParse(strVal, out rtnVal);
return rtnVal;
}
/// <summary>
/// 获取datetime值
/// </summary>
/// <param name="jobj"></param>
/// <param name="prop"></param>
/// <returns></returns>
public static DateTime? GetDateTimeValue(this JObject jobj, string prop)
{
var jt = jobj[prop];
if (jt == null)
{
return null;
}
var strVal = jt.ToString();
DateTime rtnVal = DateTime.MinValue;
if (DateTime.TryParse(strVal, out rtnVal))
{
return rtnVal;
}
return null;
}
/// <summary>
/// 获取datetime值不带秒yyyy-MM-dd HH:mm
/// </summary>
/// <param name="jobj"></param>
/// <param name="prop"></param>
/// <returns></returns>
public static DateTime? GetDateTimeMinuteValue(this JObject jobj, string prop)
{
var jt = jobj[prop];
if (jt == null)
{
return null;
}
var strVal = jt.ToString() + ":00";
DateTime rtnVal = DateTime.MinValue;
if (DateTime.TryParse(strVal, out rtnVal))
{
return rtnVal;
}
return null;
}
}
}

@ -622,6 +622,41 @@
付费方式
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN">
<summary>
箱型映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER">
<summary>
箱型映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT">
<summary>
付费方式映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_TENANT_PARAM_VALUE">
<summary>
租户参数
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL">
<summary>
船名映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_DICT_DATA">
<summary>
字典映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_DJY_EDI_SETTING">
<summary>
船名映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.ENTITY_ASSEMBLY_NAME">
<summary>
程序集
@ -662,6 +697,31 @@
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCarrier.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCarrier.Module">
<summary>
模块
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCarrier.MapCode">
<summary>
映射代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCarrier.MapName">
<summary>
映射名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCarrier.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeCity.Code">
<summary>
代码
@ -807,6 +867,36 @@
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCtn.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCtn.CarrierCode">
<summary>
船司代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCtn.Module">
<summary>
模块
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCtn.MapCode">
<summary>
映射代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCtn.MapName">
<summary>
映射名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingCtn.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeDangerGrade.Code">
<summary>
代码
@ -872,6 +962,36 @@
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingFrt.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingFrt.CarrierCode">
<summary>
船司代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingFrt.Module">
<summary>
模块
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingFrt.MapCode">
<summary>
映射代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingFrt.MapName">
<summary>
映射名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingFrt.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodePackage.Code">
<summary>
代码
@ -1072,6 +1192,26 @@
修改人
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingVessel.Name">
<summary>
名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingVessel.Module">
<summary>
模块
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingVessel.MapName">
<summary>
映射名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingVessel.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeYard.Code">
<summary>
代码
@ -4352,6 +4492,54 @@
降序排序(不要问我为什么是descend不是desc前端约定参数就是这样)
</summary>
</member>
<member name="M:Myshipping.Core.JsonExtension.GetJObjectValue(Newtonsoft.Json.Linq.JObject,System.String)">
<summary>
获取JObject
</summary>
<param name="jobj"></param>
<param name="prop"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.JsonExtension.GetStringValue(Newtonsoft.Json.Linq.JObject,System.String)">
<summary>
获取字符串值
</summary>
<param name="jobj"></param>
<param name="prop"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.JsonExtension.GetIntValue(Newtonsoft.Json.Linq.JObject,System.String)">
<summary>
获取int值
</summary>
<param name="jobj"></param>
<param name="prop"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.JsonExtension.GetDecimalValue(Newtonsoft.Json.Linq.JObject,System.String)">
<summary>
获取decimal值
</summary>
<param name="jobj"></param>
<param name="prop"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.JsonExtension.GetDateTimeValue(Newtonsoft.Json.Linq.JObject,System.String)">
<summary>
获取datetime值
</summary>
<param name="jobj"></param>
<param name="prop"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.JsonExtension.GetDateTimeMinuteValue(Newtonsoft.Json.Linq.JObject,System.String)">
<summary>
获取datetime值不带秒yyyy-MM-dd HH:mm
</summary>
<param name="jobj"></param>
<param name="prop"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Core.PagedQueryableExtensions">
<summary>
分页拓展类
@ -5101,6 +5289,211 @@
</summary>
<example>123456</example>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeCarrier">
<summary>
获取公共库 船公司
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeVessel">
<summary>
获取公共库 船名
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeForwarder">
<summary>
获取公共库 船代
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeYard">
<summary>
获取公共库 场站
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodePortLoad">
<summary>
获取公共库 起始港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodePort">
<summary>
获取公共库 目的港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodePackage">
<summary>
获取公共库 包装
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeService">
<summary>
获取公共库 运输方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeCtn">
<summary>
获取公共库 箱型
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllCodeFrt">
<summary>
获取公共库 付费方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllMappingCtn">
<summary>
获取公共库 箱型映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllMappingCarrier">
<summary>
获取公共库 船司映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllMappingFrt">
<summary>
获取公共库 付费方式映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllMappingVessel">
<summary>
获取公共库 船名映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeCarrier(System.Collections.Generic.List{Myshipping.Core.Entity.CodeCarrier})">
<summary>
设置公共库 船公司
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeVessel(System.Collections.Generic.List{Myshipping.Core.Entity.CodeVessel})">
<summary>
设置公共库 船名
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeForwarder(System.Collections.Generic.List{Myshipping.Core.Entity.CodeForwarder})">
<summary>
设置公共库 船代
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeYard(System.Collections.Generic.List{Myshipping.Core.Entity.CodeYard})">
<summary>
设置公共库 场站
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodePortLoad(System.Collections.Generic.List{Myshipping.Core.Entity.CodePortLoad})">
<summary>
设置公共库 起始港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodePort(System.Collections.Generic.List{Myshipping.Core.Entity.CodePort})">
<summary>
设置公共库 目的港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodePackage(System.Collections.Generic.List{Myshipping.Core.Entity.CodePackage})">
<summary>
设置公共库 包装
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeService(System.Collections.Generic.List{Myshipping.Core.Entity.CodeService})">
<summary>
设置公共库 运输方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeCtn(System.Collections.Generic.List{Myshipping.Core.Entity.CodeCtn})">
<summary>
设置公共库 箱型
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeFrt(System.Collections.Generic.List{Myshipping.Core.Entity.CodeFrt})">
<summary>
设置公共库 付费方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllMappingCtn(System.Collections.Generic.List{Myshipping.Core.Entity.MappingCtn})">
<summary>
设置公共库 箱型映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllMappingCarrier(System.Collections.Generic.List{Myshipping.Core.Entity.MappingCarrier})">
<summary>
设置公共库 船司映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllMappingFrt(System.Collections.Generic.List{Myshipping.Core.Entity.MappingFrt})">
<summary>
设置公共库 费用方式映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllMappingVessel(System.Collections.Generic.List{Myshipping.Core.Entity.MappingVessel})">
<summary>
设置公共库 船名映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllTenantParam">
<summary>
获取租户参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllTenantParam(System.Collections.Generic.List{Myshipping.Core.Entity.DjyTenantParamValue})">
<summary>
设置租户参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllDictData">
<summary>
获取字典
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllDictData(System.Collections.Generic.List{Myshipping.Core.Service.Dict.Dto.DictDataDto})">
<summary>
设置字典
</summary>
<param name="list"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllEdiSetting">
<summary>
获取EDI参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllEdiSetting(System.Collections.Generic.List{Myshipping.Core.Entity.DjyEdiSetting})">
<summary>
设置EDI参数
</summary>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.SysCacheService">
<summary>
系统缓存服务
@ -5277,6 +5670,210 @@
<param name="key"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeCarrier">
<summary>
获取公共库 船公司
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeVessel">
<summary>
获取公共库 船名
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeForwarder">
<summary>
获取公共库 船代
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeYard">
<summary>
获取公共库 场站
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodePortLoad">
<summary>
获取公共库 起始港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodePort">
<summary>
获取公共库 目的港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodePackage">
<summary>
获取公共库 包装
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeService">
<summary>
获取公共库 运输方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeCtn">
<summary>
获取公共库 箱型
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllCodeFrt">
<summary>
获取公共库 付费方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllMappingCtn">
<summary>
获取公共库 船司映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllMappingCarrier">
<summary>
获取公共库 箱型映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllMappingFrt">
<summary>
获取公共库 费用方式映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllMappingVessel">
<summary>
获取公共库 船名映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeCarrier(System.Collections.Generic.List{Myshipping.Core.Entity.CodeCarrier})">
<summary>
设置公共库 船公司
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeVessel(System.Collections.Generic.List{Myshipping.Core.Entity.CodeVessel})">
<summary>
设置公共库 船名
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeForwarder(System.Collections.Generic.List{Myshipping.Core.Entity.CodeForwarder})">
<summary>
设置公共库 船代
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeYard(System.Collections.Generic.List{Myshipping.Core.Entity.CodeYard})">
<summary>
设置公共库 场站
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodePortLoad(System.Collections.Generic.List{Myshipping.Core.Entity.CodePortLoad})">
<summary>
设置公共库 起始港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodePort(System.Collections.Generic.List{Myshipping.Core.Entity.CodePort})">
<summary>
设置公共库 目的港
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodePackage(System.Collections.Generic.List{Myshipping.Core.Entity.CodePackage})">
<summary>
设置公共库 包装
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeService(System.Collections.Generic.List{Myshipping.Core.Entity.CodeService})">
<summary>
设置公共库 运输方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeCtn(System.Collections.Generic.List{Myshipping.Core.Entity.CodeCtn})">
<summary>
设置公共库 箱型
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeFrt(System.Collections.Generic.List{Myshipping.Core.Entity.CodeFrt})">
<summary>
设置公共库 付费方式
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllMappingCtn(System.Collections.Generic.List{Myshipping.Core.Entity.MappingCtn})">
<summary>
设置公共库 箱型映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllMappingCarrier(System.Collections.Generic.List{Myshipping.Core.Entity.MappingCarrier})">
<summary>
设置公共库 船司映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllMappingFrt(System.Collections.Generic.List{Myshipping.Core.Entity.MappingFrt})">
<summary>
设置公共库 费用方式映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllMappingVessel(System.Collections.Generic.List{Myshipping.Core.Entity.MappingVessel})">
<summary>
设置公共库 船名映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllTenantParam">
<summary>
获取租户参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllTenantParam(System.Collections.Generic.List{Myshipping.Core.Entity.DjyTenantParamValue})">
<summary>
设置租户参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllDictData">
<summary>
获取字典缓存
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllDictData(System.Collections.Generic.List{Myshipping.Core.Service.Dict.Dto.DictDataDto})">
<summary>
设置字典参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllEdiSetting">
<summary>
获取EDI参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllEdiSetting(System.Collections.Generic.List{Myshipping.Core.Entity.DjyEdiSetting})">
<summary>
设置EDI参数
</summary>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.CodeGenConfigService">
<summary>
代码生成详细配置服务
@ -6361,6 +6958,13 @@
<param name="code"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysDictDataService.CacheData">
<summary>
缓存数据
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:Myshipping.Core.Service.SysDictTypeService">
<summary>
字典类型服务
@ -7256,6 +7860,13 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyEdiSettingService.CacheData">
<summary>
缓存数据
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:Myshipping.Core.Service.DjyTenantParamService">
<summary>
租户参数

@ -1,4 +1,6 @@
using System;
using Myshipping.Core.Entity;
using Myshipping.Core.Service.Dict.Dto;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
@ -30,4 +32,213 @@ public interface ISysCacheService
Task<List<string>> GetAllPermission();
Task SetAllPermission(List<string> permissions);
#region 公共库缓存
/// <summary>
/// 获取公共库 船公司
/// </summary>
/// <returns></returns>
Task<List<CodeCarrier>> GetAllCodeCarrier();
/// <summary>
/// 获取公共库 船名
/// </summary>
/// <returns></returns>
Task<List<CodeVessel>> GetAllCodeVessel();
/// <summary>
/// 获取公共库 船代
/// </summary>
/// <returns></returns>
Task<List<CodeForwarder>> GetAllCodeForwarder();
/// <summary>
/// 获取公共库 场站
/// </summary>
/// <returns></returns>
Task<List<CodeYard>> GetAllCodeYard();
/// <summary>
/// 获取公共库 起始港
/// </summary>
/// <returns></returns>
Task<List<CodePortLoad>> GetAllCodePortLoad();
/// <summary>
/// 获取公共库 目的港
/// </summary>
/// <returns></returns>
Task<List<CodePort>> GetAllCodePort();
/// <summary>
/// 获取公共库 包装
/// </summary>
/// <returns></returns>
Task<List<CodePackage>> GetAllCodePackage();
/// <summary>
/// 获取公共库 运输方式
/// </summary>
/// <returns></returns>
Task<List<CodeService>> GetAllCodeService();
/// <summary>
/// 获取公共库 箱型
/// </summary>
/// <returns></returns>
Task<List<CodeCtn>> GetAllCodeCtn();
/// <summary>
/// 获取公共库 付费方式
/// </summary>
/// <returns></returns>
Task<List<CodeFrt>> GetAllCodeFrt();
/// <summary>
/// 获取公共库 箱型映射
/// </summary>
/// <returns></returns>
Task<List<MappingCtn>> GetAllMappingCtn();
/// <summary>
/// 获取公共库 船司映射
/// </summary>
/// <returns></returns>
Task<List<MappingCarrier>> GetAllMappingCarrier();
/// <summary>
/// 获取公共库 付费方式映射
/// </summary>
/// <returns></returns>
Task<List<MappingFrt>> GetAllMappingFrt();
/// <summary>
/// 获取公共库 船名映射
/// </summary>
/// <returns></returns>
Task<List<MappingVessel>> GetAllMappingVessel();
/// <summary>
/// 设置公共库 船公司
/// </summary>
/// <returns></returns>
Task SetAllCodeCarrier(List<CodeCarrier> list);
/// <summary>
/// 设置公共库 船名
/// </summary>
/// <returns></returns>
Task SetAllCodeVessel(List<CodeVessel> list);
/// <summary>
/// 设置公共库 船代
/// </summary>
/// <returns></returns>
Task SetAllCodeForwarder(List<CodeForwarder> list);
/// <summary>
/// 设置公共库 场站
/// </summary>
/// <returns></returns>
Task SetAllCodeYard(List<CodeYard> list);
/// <summary>
/// 设置公共库 起始港
/// </summary>
/// <returns></returns>
Task SetAllCodePortLoad(List<CodePortLoad> list);
/// <summary>
/// 设置公共库 目的港
/// </summary>
/// <returns></returns>
Task SetAllCodePort(List<CodePort> list);
/// <summary>
/// 设置公共库 包装
/// </summary>
/// <returns></returns>
Task SetAllCodePackage(List<CodePackage> list);
/// <summary>
/// 设置公共库 运输方式
/// </summary>
/// <returns></returns>
Task SetAllCodeService(List<CodeService> list);
/// <summary>
/// 设置公共库 箱型
/// </summary>
/// <returns></returns>
Task SetAllCodeCtn(List<CodeCtn> list);
/// <summary>
/// 设置公共库 付费方式
/// </summary>
/// <returns></returns>
Task SetAllCodeFrt(List<CodeFrt> list);
/// <summary>
/// 设置公共库 箱型映射
/// </summary>
/// <returns></returns>
Task SetAllMappingCtn(List<MappingCtn> list);
/// <summary>
/// 设置公共库 船司映射
/// </summary>
/// <returns></returns>
Task SetAllMappingCarrier(List<MappingCarrier> list);
/// <summary>
/// 设置公共库 费用方式映射
/// </summary>
/// <returns></returns>
Task SetAllMappingFrt(List<MappingFrt> list);
/// <summary>
/// 设置公共库 船名映射
/// </summary>
/// <returns></returns>
Task SetAllMappingVessel(List<MappingVessel> list);
#endregion
#region DJY
/// <summary>
/// 获取租户参数
/// </summary>
/// <returns></returns>
Task<List<DjyTenantParamValue>> GetAllTenantParam();
/// <summary>
/// 设置租户参数
/// </summary>
/// <returns></returns>
Task SetAllTenantParam(List<DjyTenantParamValue> list);
/// <summary>
/// 获取字典
/// </summary>
/// <returns></returns>
Task<List<DictDataDto>> GetAllDictData();
/// <summary>
/// 设置字典
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
Task SetAllDictData(List<DictDataDto> list);
/// <summary>
/// 获取EDI参数
/// </summary>
/// <returns></returns>
Task<List<DjyEdiSetting>> GetAllEdiSetting();
/// <summary>
/// 设置EDI参数
/// </summary>
/// <returns></returns>
Task SetAllEdiSetting(List<DjyEdiSetting> list);
#endregion
}

@ -2,6 +2,8 @@
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Myshipping.Core.Entity;
using Myshipping.Core.Service.Dict.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
@ -284,4 +286,326 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
{
return _cache.ExistsAsync(key);
}
#region 公共库缓存
/// <summary>
/// 获取公共库 船公司
/// </summary>
/// <returns></returns>
public Task<List<CodeCarrier>> GetAllCodeCarrier()
{
return _cache.GetAsync<List<CodeCarrier>>(CommonConst.CACHE_KEY_COMMON_DB_CARRIER);
}
/// <summary>
/// 获取公共库 船名
/// </summary>
/// <returns></returns>
public Task<List<CodeVessel>> GetAllCodeVessel()
{
return _cache.GetAsync<List<CodeVessel>>(CommonConst.CACHE_KEY_COMMON_DB_VESSEL);
}
/// <summary>
/// 获取公共库 船代
/// </summary>
/// <returns></returns>
public Task<List<CodeForwarder>> GetAllCodeForwarder()
{
return _cache.GetAsync<List<CodeForwarder>>(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER);
}
/// <summary>
/// 获取公共库 场站
/// </summary>
/// <returns></returns>
public Task<List<CodeYard>> GetAllCodeYard()
{
return _cache.GetAsync<List<CodeYard>>(CommonConst.CACHE_KEY_COMMON_DB_YARD);
}
/// <summary>
/// 获取公共库 起始港
/// </summary>
/// <returns></returns>
public Task<List<CodePortLoad>> GetAllCodePortLoad()
{
return _cache.GetAsync<List<CodePortLoad>>(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD);
}
/// <summary>
/// 获取公共库 目的港
/// </summary>
/// <returns></returns>
public Task<List<CodePort>> GetAllCodePort()
{
return _cache.GetAsync<List<CodePort>>(CommonConst.CACHE_KEY_COMMON_DB_PORT);
}
/// <summary>
/// 获取公共库 包装
/// </summary>
/// <returns></returns>
public Task<List<CodePackage>> GetAllCodePackage()
{
return _cache.GetAsync<List<CodePackage>>(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE);
}
/// <summary>
/// 获取公共库 运输方式
/// </summary>
/// <returns></returns>
public Task<List<CodeService>> GetAllCodeService()
{
return _cache.GetAsync<List<CodeService>>(CommonConst.CACHE_KEY_COMMON_DB_SERVICE);
}
/// <summary>
/// 获取公共库 箱型
/// </summary>
/// <returns></returns>
public Task<List<CodeCtn>> GetAllCodeCtn()
{
return _cache.GetAsync<List<CodeCtn>>(CommonConst.CACHE_KEY_COMMON_DB_CTN);
}
/// <summary>
/// 获取公共库 付费方式
/// </summary>
/// <returns></returns>
public Task<List<CodeFrt>> GetAllCodeFrt()
{
return _cache.GetAsync<List<CodeFrt>>(CommonConst.CACHE_KEY_COMMON_DB_FRT);
}
/// <summary>
/// 获取公共库 船司映射
/// </summary>
/// <returns></returns>
public Task<List<MappingCtn>> GetAllMappingCtn()
{
return _cache.GetAsync<List<MappingCtn>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN);
}
/// <summary>
/// 获取公共库 箱型映射
/// </summary>
/// <returns></returns>
public Task<List<MappingCarrier>> GetAllMappingCarrier()
{
return _cache.GetAsync<List<MappingCarrier>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER);
}
/// <summary>
/// 获取公共库 费用方式映射
/// </summary>
/// <returns></returns>
public Task<List<MappingFrt>> GetAllMappingFrt()
{
return _cache.GetAsync<List<MappingFrt>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT);
}
/// <summary>
/// 获取公共库 船名映射
/// </summary>
/// <returns></returns>
public Task<List<MappingVessel>> GetAllMappingVessel()
{
return _cache.GetAsync<List<MappingVessel>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL);
}
/// <summary>
/// 设置公共库 船公司
/// </summary>
/// <returns></returns>
public Task SetAllCodeCarrier(List<CodeCarrier> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_CARRIER, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 船名
/// </summary>
/// <returns></returns>
public Task SetAllCodeVessel(List<CodeVessel> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_VESSEL, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 船代
/// </summary>
/// <returns></returns>
public Task SetAllCodeForwarder(List<CodeForwarder> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 场站
/// </summary>
/// <returns></returns>
public Task SetAllCodeYard(List<CodeYard> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_YARD, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 起始港
/// </summary>
/// <returns></returns>
public Task SetAllCodePortLoad(List<CodePortLoad> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 目的港
/// </summary>
/// <returns></returns>
public Task SetAllCodePort(List<CodePort> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PORT, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 包装
/// </summary>
/// <returns></returns>
public Task SetAllCodePackage(List<CodePackage> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 运输方式
/// </summary>
/// <returns></returns>
public Task SetAllCodeService(List<CodeService> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_SERVICE, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 箱型
/// </summary>
/// <returns></returns>
public Task SetAllCodeCtn(List<CodeCtn> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_CTN, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 付费方式
/// </summary>
/// <returns></returns>
public Task SetAllCodeFrt(List<CodeFrt> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_FRT, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 箱型映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingCtn(List<MappingCtn> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 船司映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingCarrier(List<MappingCarrier> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 费用方式映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingFrt(List<MappingFrt> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT, list, TimeSpan.FromMinutes(5));
}
/// <summary>
/// 设置公共库 船名映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingVessel(List<MappingVessel> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL, list, TimeSpan.FromMinutes(5));
}
#endregion
#region DJY
/// <summary>
/// 获取租户参数
/// </summary>
/// <returns></returns>
public Task<List<DjyTenantParamValue>> GetAllTenantParam()
{
return _cache.GetAsync<List<DjyTenantParamValue>>(CommonConst.CACHE_KEY_COMMON_DB_TENANT_PARAM_VALUE);
}
/// <summary>
/// 设置租户参数
/// </summary>
/// <returns></returns>
public Task SetAllTenantParam(List<DjyTenantParamValue> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_TENANT_PARAM_VALUE, list);
}
/// <summary>
/// 获取字典缓存
/// </summary>
/// <returns></returns>
public Task<List<DictDataDto>> GetAllDictData()
{
return _cache.GetAsync<List<DictDataDto>>(CommonConst.CACHE_KEY_COMMON_DB_DICT_DATA);
}
/// <summary>
/// 设置字典参数
/// </summary>
/// <returns></returns>
public Task SetAllDictData(List<DictDataDto> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_DICT_DATA, list);
}
/// <summary>
/// 获取EDI参数
/// </summary>
/// <returns></returns>
public Task<List<DjyEdiSetting>> GetAllEdiSetting()
{
return _cache.GetAsync<List<DjyEdiSetting>>(CommonConst.CACHE_KEY_DJY_EDI_SETTING);
}
/// <summary>
/// 设置EDI参数
/// </summary>
/// <returns></returns>
public Task SetAllEdiSetting(List<DjyEdiSetting> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_DJY_EDI_SETTING, list);
}
#endregion
}

@ -210,14 +210,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeCarrier>> GetAllCarrier()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CARRIER))
var list = await _sysCacheService.GetAllCodeCarrier();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeCarrier>>(CommonConst.CACHE_KEY_COMMON_DB_CARRIER);
return list;
}
else
{
var list = await _codeCarrierRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_CARRIER, list, TimeSpan.FromMinutes(5));
list = await _codeCarrierRep.ToListAsync();
await _sysCacheService.SetAllCodeCarrier(list);
return list;
}
}
@ -225,14 +226,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeVessel>> GetAllVessel()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_VESSEL))
var list = await _sysCacheService.GetAllCodeVessel();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeVessel>>(CommonConst.CACHE_KEY_COMMON_DB_VESSEL);
return list;
}
else
{
var list = await _codeVesselRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_VESSEL, list, TimeSpan.FromMinutes(5));
list = await _codeVesselRep.ToListAsync();
await _sysCacheService.SetAllCodeVessel(list);
return list;
}
}
@ -240,14 +242,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeForwarder>> GetAllForwarder()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER))
var list = await _sysCacheService.GetAllCodeForwarder();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeForwarder>>(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER);
return list;
}
else
{
var list = await _codeForwarderRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER, list, TimeSpan.FromMinutes(5));
list = await _codeForwarderRep.ToListAsync();
await _sysCacheService.SetAllCodeForwarder(list);
return list;
}
}
@ -255,14 +258,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeYard>> GetAllYard()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_YARD))
var list = await _sysCacheService.GetAllCodeYard();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeYard>>(CommonConst.CACHE_KEY_COMMON_DB_YARD);
return list;
}
else
{
var list = await _codeYardRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_YARD, list, TimeSpan.FromMinutes(5));
list = await _codeYardRep.ToListAsync();
await _sysCacheService.SetAllCodeYard(list);
return list;
}
}
@ -270,14 +274,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodePortLoad>> GetAllPortload()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD))
var list = await _sysCacheService.GetAllCodePortLoad();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodePortLoad>>(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD);
return list;
}
else
{
var list = await _codePortLoadrRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD, list, TimeSpan.FromMinutes(5));
list = await _codePortLoadrRep.ToListAsync();
await _sysCacheService.SetAllCodePortLoad(list);
return list;
}
}
@ -285,14 +290,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodePort>> GetAllPort()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PORT))
var list = await _sysCacheService.GetAllCodePort();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodePort>>(CommonConst.CACHE_KEY_COMMON_DB_PORT);
return list;
}
else
{
var list = await _codePortRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_PORT, list, TimeSpan.FromMinutes(5));
list = await _codePortRep.ToListAsync();
await _sysCacheService.SetAllCodePort(list);
return list;
}
}
@ -300,14 +306,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodePackage>> GetAllPackage()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE))
var list = await _sysCacheService.GetAllCodePackage();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodePackage>>(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE);
return list;
}
else
{
var list = await _codePackageRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE, list, TimeSpan.FromMinutes(5));
list = await _codePackageRep.ToListAsync();
await _sysCacheService.SetAllCodePackage(list);
return list;
}
}
@ -315,14 +322,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeService>> GetAllService()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_SERVICE))
var list = await _sysCacheService.GetAllCodeService();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeService>>(CommonConst.CACHE_KEY_COMMON_DB_SERVICE);
return list;
}
else
{
var list = await _codeServiceRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_SERVICE, list, TimeSpan.FromMinutes(5));
list = await _codeServiceRep.ToListAsync();
await _sysCacheService.SetAllCodeService(list);
return list;
}
}
@ -330,14 +338,16 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeCtn>> GetAllCtn()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CTN))
var list = await _sysCacheService.GetAllCodeCtn();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeCtn>>(CommonConst.CACHE_KEY_COMMON_DB_CTN);
return list;
}
else
{
var list = await _codeCtnRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_CTN, list, TimeSpan.FromMinutes(5));
list = await _codeCtnRep.ToListAsync();
await _sysCacheService.SetAllCodeCtn(list);
return list;
}
}
@ -345,17 +355,22 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeFrt>> GetAllFrt()
{
if (_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_FRT))
var list = await _sysCacheService.GetAllCodeFrt();
if (list != null && list.Count > 0)
{
return await _sysCacheService.GetAsync<List<CodeFrt>>(CommonConst.CACHE_KEY_COMMON_DB_FRT);
return list;
}
else
{
var list = await _codeFrtRep.ToListAsync();
await _sysCacheService.SetTimeoutAsync(CommonConst.CACHE_KEY_COMMON_DB_FRT, list, TimeSpan.FromMinutes(5));
list = await _codeFrtRep.ToListAsync();
await _sysCacheService.SetAllCodeFrt(list);
return list;
}
}
#endregion
}

@ -60,4 +60,5 @@ public interface ICommonDBService
/// </summary>
/// <returns></returns>
Task<List<CodeCtn>> GetAllCtn();
}

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.Dict.Dto
{
public class DictDataDto
{
public long Id { get; set; }
public string TypeName { get; set; }
public string TypeCode { get; set; }
public string Value { get; set; }
public string Code { get; set; }
public int Sort { get; set; }
public string Remark { get; set; }
}
}

@ -17,4 +17,6 @@ public interface ISysDictDataService
Task<dynamic> QueryDictDataPageList([FromQuery] DictDataInput input);
Task UpdateDictData(UpdateDictDataInput input);
Task<List<SysDictData>> GetDictDataByCode(string code);
Task CacheData();
}

@ -12,6 +12,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Myshipping.Core.Service.Dict.Dto;
namespace Myshipping.Core.Service;
@ -23,9 +24,12 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
{
private readonly SqlSugarRepository<SysDictData> _sysDictDataRep; // 字典类型表仓储
public SysDictDataService(SqlSugarRepository<SysDictData> sysDictDataRep)
private readonly ISysCacheService _cache;
public SysDictDataService(SqlSugarRepository<SysDictData> sysDictDataRep, ISysCacheService cache)
{
_sysDictDataRep = sysDictDataRep;
_cache = cache;
}
/// <summary>
@ -73,6 +77,11 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
var dictData = input.Adapt<SysDictData>();
await _sysDictDataRep.InsertAsync(dictData);
await CacheData();
}
/// <summary>
@ -87,6 +96,9 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
if (dictData == null) throw Oops.Oh(ErrorCode.D3004);
await _sysDictDataRep.DeleteAsync(dictData);
await CacheData();
}
/// <summary>
@ -106,6 +118,9 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
var dictData = input.Adapt<SysDictData>();
await _sysDictDataRep.AsUpdateable(dictData).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
await CacheData();
}
/// <summary>
@ -133,6 +148,8 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
if (!Enum.IsDefined(typeof(CommonStatus), input.Status))
throw Oops.Oh(ErrorCode.D3005);
dictData.Status = input.Status;
await CacheData();
}
/// <summary>
@ -160,8 +177,9 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
public async Task DeleteByTypeId(long dictTypeId)
{
await _sysDictDataRep.DeleteAsync(u => u.TypeId == dictTypeId);
}
await CacheData();
}
/// <summary>
/// 根据字典Code返回字典值列表
@ -174,4 +192,27 @@ public class SysDictDataService : ISysDictDataService, IDynamicApiController, IT
var payment = await _sysDictDataRep.AsQueryable().InnerJoin<SysDictType>((d, t) => d.TypeId == t.Id).Where((d, t) => t.Code == code).Select<SysDictData>().ToListAsync();
return payment;
}
/// <summary>
/// 缓存数据
/// </summary>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
[NonAction]
public async Task CacheData()
{
var list = await _sysDictDataRep.AsQueryable().InnerJoin<SysDictType>((d, t) => d.TypeId == t.Id).Filter(null, true).Where((d, t) => t.Status == CommonStatus.ENABLE && d.Status == CommonStatus.ENABLE).Select((d, t) => new DictDataDto
{
Id = d.Id,
TypeName = t.Name,
TypeCode = t.Code,
Value = d.Value,
Code = d.Code,
Sort = d.Sort,
Remark = d.Remark
}).ToListAsync();
await _cache.SetAllDictData(list);
}
}

@ -19,12 +19,14 @@ namespace Myshipping.Core.Service
public class DjyEdiSettingService : IDjyEdiSettingService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<DjyEdiSetting> _rep;
private readonly ISysCacheService _cacheService;
private readonly ILogger<DjyEdiSetting> _logger;
public DjyEdiSettingService(SqlSugarRepository<DjyEdiSetting> rep, ILogger<DjyEdiSetting> logger)
public DjyEdiSettingService(SqlSugarRepository<DjyEdiSetting> rep, ILogger<DjyEdiSetting> logger, ISysCacheService cacheService)
{
_rep = rep;
_logger = logger;
_cacheService = cacheService;
}
/// <summary>
@ -86,6 +88,7 @@ namespace Myshipping.Core.Service
entity = input.Adapt(entity);
await _rep.UpdateAsync(entity);
}
await CacheData();
}
/// <summary>
@ -98,6 +101,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyEdiSetting>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
await CacheData();
}
/// <summary>
@ -110,6 +114,7 @@ namespace Myshipping.Core.Service
{
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
await _rep.DeleteAsync(entity);
await CacheData();
}
/// <summary>
@ -123,6 +128,20 @@ namespace Myshipping.Core.Service
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
/// <summary>
/// 缓存数据
/// </summary>
/// <returns></returns>
/// <exception cref="System.NotImplementedException"></exception>
[NonAction]
public async Task CacheData()
{
_logger.LogInformation($"准备缓存EDI参数……");
var list = _rep.AsQueryable().Filter(null, true).ToList();
await _cacheService.SetAllEdiSetting(list);
_logger.LogInformation($"缓存EDI参数完成");
}
///// <summary>
///// 获取EDI参数设置列表
///// </summary>

@ -13,5 +13,7 @@ namespace Myshipping.Core.Service
Task Delete(GetDjyEdiSettingInput input);
Task<DjyEdiSetting> Get([FromQuery] GetDjyEdiSettingInput input);
//Task<dynamic> List([FromQuery] QueryDjyEdiSettingInput input);
Task CacheData();
}
}

@ -22,13 +22,14 @@ namespace Myshipping.Core.Service
private readonly SqlSugarRepository<DjyTenantParamItem> _itemrep;
private readonly SqlSugarRepository<DjyTenantParamValue> _valuerep;
private readonly ILogger<DjyTenantParam> _logger;
public DjyTenantParamService(SqlSugarRepository<DjyTenantParam> rep, SqlSugarRepository<DjyTenantParamItem> itemrep, SqlSugarRepository<DjyTenantParamValue> valuerep, ILogger<DjyTenantParam> logger)
private readonly ISysCacheService _cache;
public DjyTenantParamService(SqlSugarRepository<DjyTenantParam> rep, SqlSugarRepository<DjyTenantParamItem> itemrep, SqlSugarRepository<DjyTenantParamValue> valuerep, ISysCacheService cache, ILogger<DjyTenantParam> logger)
{
_rep = rep;
_logger = logger;
_itemrep = itemrep;
_valuerep = valuerep;
_cache = cache;
}
@ -112,6 +113,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyTenantParamItem>();
await _itemrep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
@ -126,6 +128,7 @@ namespace Myshipping.Core.Service
await _valuerep.DeleteAsync(m => m.ItemCode == entity.ItemCode && m.ParaCode == entity.ParaCode);
await _itemrep.DeleteAsync(entity);
}
@ -151,6 +154,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyTenantParamValue>();
await _valuerep.InsertAsync(entity);
await CacheData();
}
@ -163,6 +167,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyTenantParamValue>();
await _valuerep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
await CacheData();
}
/// <summary>
@ -176,5 +181,13 @@ namespace Myshipping.Core.Service
var entity = await _itemrep.FirstOrDefaultAsync(u => u.Id == Id);
await _valuerep.DeleteAsync(entity);
}
public async Task CacheData()
{
var list = await _valuerep.AsQueryable().Filter(null, true).ToListAsync();
await _cache.SetAllTenantParam(list);
}
}
}

@ -17,5 +17,7 @@ namespace Myshipping.Core.Service
Task UpdateParamItem(DjyTenantParamItem input);
Task DeleteParamItem(long Id);
Task CacheData();
}
}

@ -110,6 +110,15 @@ public class Startup : AppStartup
// 注册 Log 日志订阅者
builder.AddSubscriber<LogEventSubscriber>();
});
//缓存EDI数据
App.GetService<IDjyEdiSettingService>().CacheData();
//缓存字典数据
App.GetService<ISysDictDataService>().CacheData();
//租户参数
App.GetService<IDjyTenantParamService>().CacheData();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

Loading…
Cancel
Save