booking_auth_dev
wet 2 years ago
parent e7b1f69176
commit 0c2a5cb181

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

@ -133,10 +133,13 @@ public class CommonConst
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_PACKAGE = "CommonDbMappingPackage";
/// <summary>
/// 包装映射
/// 运输条款
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_SERVICE = "CommonDbMappingService";
/// <summary>
/// 签单方式
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE = "CommonDbCodeIssueType";
/// <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.CommonDB;
using Myshipping.Core.Service.Dict.Dto;
using System;
using System.Collections.Generic;
@ -258,6 +259,20 @@ public interface ISysCacheService
/// </summary>
/// <returns></returns>
Task SetAllMappingService(List<MappingService> list);
/// <summary>
/// 获取公共库 签单方式
/// </summary>
/// <returns></returns>
Task<List<CodeIssueType>> GetAllCodeIssueType();
/// <summary>
/// 设置公共库 签单方式
/// </summary>
/// <returns></returns>
Task SetAllCodeIssueType(List<CodeIssueType> list);
#endregion
#region DJY

@ -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,7 +620,8 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
public Task<List<MappingService>> GetAllMappingService()
{
return _cache.GetAsync<List<MappingService>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE);
} /// <summary>
}
/// <summary>
/// 设置公共库 运输条款映射
/// </summary>
/// <returns></returns>
@ -627,6 +629,24 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
{
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
#region DJY

@ -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;
/// <summary>
@ -40,6 +41,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
private readonly SqlSugarRepository<MappingPackage> _mappingPackageRep;
private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
private readonly ISysCacheService _sysCacheService;
private readonly SqlSugarRepository<CodeIssueType> _codeIssueTypeRep;
private readonly ILogger<CommonDBService> _logger;
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
SqlSugarRepository<CodeVessel> codeVesselRep,
@ -60,6 +62,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
SqlSugarRepository<MappingPort> mappingPortRep,
SqlSugarRepository<MappingPackage> mappingPackageRep,
SqlSugarRepository<MappingService> mappingServiceRep,
SqlSugarRepository<CodeIssueType> codeIssueTypeRep,
ILogger<CommonDBService> logger,
ISysCacheService sysCacheService)
{
@ -83,6 +86,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_mappingPortRep = mappingPortRep;
_mappingPackageRep = mappingPackageRep;
_mappingServiceRep = mappingServiceRep;
_codeIssueTypeRep = codeIssueTypeRep;
_logger = logger;
}
@ -785,13 +789,44 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
}
#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 实现接口,获取公共数据并缓存
[NonAction]
public async Task<List<CodeCarrier>> 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<List<CodeIssueType>> GetAllCodeIssueType()
{
var list = await _codeIssueTypeRep.ToListAsync();
await _sysCacheService.SetAllCodeIssueType(list);
return list;
}
#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 />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

Loading…
Cancel
Save