diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index d55ce212..bb9c5f0c 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -565,6 +565,7 @@ namespace Myshipping.Application /// /// 获取货运动态 /// + [HttpGet("/BookingOrder/GetStatusLog")] public async Task> GetBookingStatusLog(long Id) { diff --git a/Myshipping.Core/Const/CommonConst.cs b/Myshipping.Core/Const/CommonConst.cs index e0210c43..e8cf7b00 100644 --- a/Myshipping.Core/Const/CommonConst.cs +++ b/Myshipping.Core/Const/CommonConst.cs @@ -133,10 +133,13 @@ public class CommonConst /// public const string CACHE_KEY_COMMON_DB_MAPPING_PACKAGE = "CommonDbMappingPackage"; /// - /// 包装映射 + /// 运输条款 /// public const string CACHE_KEY_COMMON_DB_MAPPING_SERVICE = "CommonDbMappingService"; - + /// + /// 签单方式 + /// + public const string CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE = "CommonDbCodeIssueType"; /// /// 字典映射 /// diff --git a/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs b/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs new file mode 100644 index 00000000..cababfb4 --- /dev/null +++ b/Myshipping.Core/Entity/CommonDB/CodeIssueType.cs @@ -0,0 +1,48 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Core.Entity.CommonDB +{ + + + [SugarTable("CodeIssueType")] + [Description("签单方式")] + public class CodeIssueType : CommonDbEntity + { + /// + /// 代码 + /// + public string Code { get; set; } + + /// + /// 英文名称 + /// + public string EnName { get; set; } + + /// + /// 中文名称 + /// + public string CnName { get; set; } + + /// + /// 描述 + /// + public string Description { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 排序 + /// + public int Sort { get; set; } + + } +} diff --git a/Myshipping.Core/Service/Cache/ISysCacheService.cs b/Myshipping.Core/Service/Cache/ISysCacheService.cs index fab152ab..d7df2a35 100644 --- a/Myshipping.Core/Service/Cache/ISysCacheService.cs +++ b/Myshipping.Core/Service/Cache/ISysCacheService.cs @@ -1,4 +1,5 @@ using Myshipping.Core.Entity; +using Myshipping.Core.Entity.CommonDB; using Myshipping.Core.Service.Dict.Dto; using System; using System.Collections.Generic; @@ -258,6 +259,20 @@ public interface ISysCacheService /// /// Task SetAllMappingService(List list); + + + + /// + /// 获取公共库 签单方式 + /// + /// + Task> GetAllCodeIssueType(); + + /// + /// 设置公共库 签单方式 + /// + /// + Task SetAllCodeIssueType(List list); #endregion #region DJY diff --git a/Myshipping.Core/Service/Cache/SysCacheService.cs b/Myshipping.Core/Service/Cache/SysCacheService.cs index 6f81f816..b75695c1 100644 --- a/Myshipping.Core/Service/Cache/SysCacheService.cs +++ b/Myshipping.Core/Service/Cache/SysCacheService.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Myshipping.Core.Entity; +using Myshipping.Core.Entity.CommonDB; using Myshipping.Core.Service.Dict.Dto; using System; using System.Collections.Generic; @@ -619,14 +620,33 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet public Task> GetAllMappingService() { return _cache.GetAsync>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE); - } /// - /// 设置公共库 运输条款映射 - /// - /// + } + /// + /// 设置公共库 运输条款映射 + /// + /// public Task SetAllMappingService(List list) { return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE, list); } + + + /// + /// 获取公共库 签单方式 + /// + /// + public Task> GetAllCodeIssueType() + { + return _cache.GetAsync>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE); + } + /// + /// 设置公共库 签单方式 + /// + /// + public Task SetAllCodeIssueType(List list) + { + return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE, list); + } #endregion #region DJY @@ -688,6 +708,6 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet { return _cache.SetAsync(CommonConst.CACHE_KEY_DJY_EDI_SETTING, list); } - + #endregion } diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index eaa84535..7ddc082a 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -11,6 +11,7 @@ using System.Collections.Generic; using System; using Myshipping.Core.Service.CommonDB.Dto; using Microsoft.Extensions.Logging; +using Myshipping.Core.Entity.CommonDB; namespace Myshipping.Core.Service; /// @@ -40,6 +41,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie private readonly SqlSugarRepository _mappingPackageRep; private readonly SqlSugarRepository _mappingServiceRep; private readonly ISysCacheService _sysCacheService; + private readonly SqlSugarRepository _codeIssueTypeRep; private readonly ILogger _logger; public CommonDBService(SqlSugarRepository codeCarrierRep, SqlSugarRepository codeVesselRep, @@ -60,6 +62,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie SqlSugarRepository mappingPortRep, SqlSugarRepository mappingPackageRep, SqlSugarRepository mappingServiceRep, + SqlSugarRepository codeIssueTypeRep, ILogger logger, ISysCacheService sysCacheService) { @@ -83,6 +86,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie _mappingPortRep = mappingPortRep; _mappingPackageRep = mappingPackageRep; _mappingServiceRep = mappingServiceRep; + _codeIssueTypeRep = codeIssueTypeRep; _logger = logger; } @@ -783,15 +787,46 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie } await GetAllMappingFrt(); } - #endregion + #endregion + + #region 签单方式 + /// + /// 获取签单方式信息 + /// + [HttpGet("/commondb/codeissuetypelist")] + public async Task CodeIssueTypeList([FromQuery] NameQueryDto input) + { + List list = await _sysCacheService.GetAllCodeIssueType(); + + var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); + + return queryList.ToList(); + } + + /// + /// 新增签单方式 + /// + [HttpPost("/commondb/addcodeissuetype")] + public async Task AddCodeIssueType([FromBody] CodeIssueTypeDto dto) + { + var entity = dto.Adapt(); + entity.GID = Guid.NewGuid().ToString(); + entity.CreateTime = DateTime.Now; + entity.CreateUser = UserManager.DjyUserId; + await _codeIssueTypeRep.InsertAsync(entity); + await GetAllCodeIssueType(); + } + #endregion + + + + #region 实现接口,获取公共数据并缓存 [NonAction] public async Task> GetAllCarrier() { var list = await _codeCarrierRep.ToListAsync(); - _logger.LogInformation("船公司缓存"); - _logger.LogInformation(list.ToJsonString()); await _sysCacheService.SetAllCodeCarrier(list); return list; } @@ -966,6 +1001,13 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie return list; } + + public async Task> GetAllCodeIssueType() + { + var list = await _codeIssueTypeRep.ToListAsync(); + await _sysCacheService.SetAllCodeIssueType(list); + return list; + } #endregion } diff --git a/Myshipping.Core/Service/CommonDB/Dto/CodeIssueTypeDto.cs b/Myshipping.Core/Service/CommonDB/Dto/CodeIssueTypeDto.cs new file mode 100644 index 00000000..d0870cf3 --- /dev/null +++ b/Myshipping.Core/Service/CommonDB/Dto/CodeIssueTypeDto.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Core.Service.CommonDB.Dto +{ + public class CodeIssueTypeDto + { + /// + /// 代码 + /// + public string Code { get; set; } + + /// + /// 英文名称 + /// + public string EnName { get; set; } + + /// + /// 中文名称 + /// + public string CnName { get; set; } + + /// + /// 描述 + /// + public string Description { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 排序 + /// + public int Sort { get; set; } + } +} diff --git a/Myshipping.Report/Myshipping.Report.csproj.user b/Myshipping.Report/Myshipping.Report.csproj.user index 5831b7bf..c54031d1 100644 --- a/Myshipping.Report/Myshipping.Report.csproj.user +++ b/Myshipping.Report/Myshipping.Report.csproj.user @@ -8,7 +8,7 @@ - Debug|Any CPU + Release|Any CPU