booking_auth_dev
wet 2 years ago
parent e7b1f69176
commit 0c2a5cb181

@ -565,6 +565,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 获取货运动态 /// 获取货运动态
/// </summary> /// </summary>
[HttpGet("/BookingOrder/GetStatusLog")]
public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id) public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id)
{ {

@ -133,10 +133,13 @@ public class CommonConst
/// </summary> /// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_PACKAGE = "CommonDbMappingPackage"; public const string CACHE_KEY_COMMON_DB_MAPPING_PACKAGE = "CommonDbMappingPackage";
/// <summary> /// <summary>
/// 包装映射 /// 运输条款
/// </summary> /// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_SERVICE = "CommonDbMappingService"; public const string CACHE_KEY_COMMON_DB_MAPPING_SERVICE = "CommonDbMappingService";
/// <summary>
/// 签单方式
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE = "CommonDbCodeIssueType";
/// <summary> /// <summary>
/// 字典映射 /// 字典映射
/// </summary> /// </summary>

@ -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
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
}

@ -1,4 +1,5 @@
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using Myshipping.Core.Entity.CommonDB;
using Myshipping.Core.Service.Dict.Dto; using Myshipping.Core.Service.Dict.Dto;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -258,6 +259,20 @@ public interface ISysCacheService
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task SetAllMappingService(List<MappingService> list); Task SetAllMappingService(List<MappingService> list);
/// <summary>
/// 获取公共库 签单方式
/// </summary>
/// <returns></returns>
Task<List<CodeIssueType>> GetAllCodeIssueType();
/// <summary>
/// 设置公共库 签单方式
/// </summary>
/// <returns></returns>
Task SetAllCodeIssueType(List<CodeIssueType> list);
#endregion #endregion
#region DJY #region DJY

@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using Myshipping.Core.Entity.CommonDB;
using Myshipping.Core.Service.Dict.Dto; using Myshipping.Core.Service.Dict.Dto;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -619,14 +620,33 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
public Task<List<MappingService>> GetAllMappingService() public Task<List<MappingService>> GetAllMappingService()
{ {
return _cache.GetAsync<List<MappingService>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE); return _cache.GetAsync<List<MappingService>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE);
} /// <summary> }
/// 设置公共库 运输条款映射 /// <summary>
/// </summary> /// 设置公共库 运输条款映射
/// <returns></returns> /// </summary>
/// <returns></returns>
public Task SetAllMappingService(List<MappingService> list) public Task SetAllMappingService(List<MappingService> list)
{ {
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE, list); return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE, list);
} }
/// <summary>
/// 获取公共库 签单方式
/// </summary>
/// <returns></returns>
public Task<List<CodeIssueType>> GetAllCodeIssueType()
{
return _cache.GetAsync<List<CodeIssueType>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE);
}
/// <summary>
/// 设置公共库 签单方式
/// </summary>
/// <returns></returns>
public Task SetAllCodeIssueType(List<CodeIssueType> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE, list);
}
#endregion #endregion
#region DJY #region DJY

@ -11,6 +11,7 @@ using System.Collections.Generic;
using System; using System;
using Myshipping.Core.Service.CommonDB.Dto; using Myshipping.Core.Service.CommonDB.Dto;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Myshipping.Core.Entity.CommonDB;
namespace Myshipping.Core.Service; namespace Myshipping.Core.Service;
/// <summary> /// <summary>
@ -40,6 +41,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
private readonly SqlSugarRepository<MappingPackage> _mappingPackageRep; private readonly SqlSugarRepository<MappingPackage> _mappingPackageRep;
private readonly SqlSugarRepository<MappingService> _mappingServiceRep; private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
private readonly ISysCacheService _sysCacheService; private readonly ISysCacheService _sysCacheService;
private readonly SqlSugarRepository<CodeIssueType> _codeIssueTypeRep;
private readonly ILogger<CommonDBService> _logger; private readonly ILogger<CommonDBService> _logger;
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep, public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
SqlSugarRepository<CodeVessel> codeVesselRep, SqlSugarRepository<CodeVessel> codeVesselRep,
@ -60,6 +62,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
SqlSugarRepository<MappingPort> mappingPortRep, SqlSugarRepository<MappingPort> mappingPortRep,
SqlSugarRepository<MappingPackage> mappingPackageRep, SqlSugarRepository<MappingPackage> mappingPackageRep,
SqlSugarRepository<MappingService> mappingServiceRep, SqlSugarRepository<MappingService> mappingServiceRep,
SqlSugarRepository<CodeIssueType> codeIssueTypeRep,
ILogger<CommonDBService> logger, ILogger<CommonDBService> logger,
ISysCacheService sysCacheService) ISysCacheService sysCacheService)
{ {
@ -83,6 +86,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_mappingPortRep = mappingPortRep; _mappingPortRep = mappingPortRep;
_mappingPackageRep = mappingPackageRep; _mappingPackageRep = mappingPackageRep;
_mappingServiceRep = mappingServiceRep; _mappingServiceRep = mappingServiceRep;
_codeIssueTypeRep = codeIssueTypeRep;
_logger = logger; _logger = logger;
} }
@ -785,13 +789,44 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
} }
#endregion #endregion
#region 签单方式
/// <summary>
/// 获取签单方式信息
/// </summary>
[HttpGet("/commondb/codeissuetypelist")]
public async Task<dynamic> CodeIssueTypeList([FromQuery] NameQueryDto input)
{
List<CodeIssueType> list = await _sysCacheService.GetAllCodeIssueType();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
/// <summary>
/// 新增签单方式
/// </summary>
[HttpPost("/commondb/addcodeissuetype")]
public async Task AddCodeIssueType([FromBody] CodeIssueTypeDto dto)
{
var entity = dto.Adapt<CodeIssueType>();
entity.GID = Guid.NewGuid().ToString();
entity.CreateTime = DateTime.Now;
entity.CreateUser = UserManager.DjyUserId;
await _codeIssueTypeRep.InsertAsync(entity);
await GetAllCodeIssueType();
}
#endregion
#region 实现接口,获取公共数据并缓存 #region 实现接口,获取公共数据并缓存
[NonAction] [NonAction]
public async Task<List<CodeCarrier>> GetAllCarrier() public async Task<List<CodeCarrier>> GetAllCarrier()
{ {
var list = await _codeCarrierRep.ToListAsync(); var list = await _codeCarrierRep.ToListAsync();
_logger.LogInformation("船公司缓存");
_logger.LogInformation(list.ToJsonString());
await _sysCacheService.SetAllCodeCarrier(list); await _sysCacheService.SetAllCodeCarrier(list);
return list; return list;
} }
@ -966,6 +1001,13 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
return list; return list;
} }
public async Task<List<CodeIssueType>> GetAllCodeIssueType()
{
var list = await _codeIssueTypeRep.ToListAsync();
await _sysCacheService.SetAllCodeIssueType(list);
return list;
}
#endregion #endregion
} }

@ -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
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
}

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>

Loading…
Cancel
Save