修改合约号管理增加船公司映射

usertest
jianghaiqing 4 months ago
parent f0aa90412a
commit e9a60e3328

@ -42,21 +42,41 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public string LaneCName { get; set; }
/// <summary>
/// 航线主键
/// </summary>
public Nullable<long> LaneId { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
public string PodCode { get; set; }
/// <summary>
/// 目的港主键
/// </summary>
public string PodId { get; set; }
/// <summary>
/// 目的港名称
/// </summary>
public string PodName { get; set; }
/// <summary>
/// 船公司主键
/// </summary>
public long CarrierId { get; set; }
public Nullable<long> CarrierId { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 合约方公司全称
/// </summary>

@ -42,20 +42,38 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 航线中文
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "航线中文", Length = 50, IsNullable = true)]
[SqlSugar.SugarColumn(ColumnDescription = "航线中文", Length = 60, IsNullable = true)]
public string LaneCName { get; set; }
/// <summary>
/// 航线主键
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "航线主键", IsNullable = true)]
public Nullable<long> LaneId { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "目的港代码", Length = 20, IsNullable = true)]
public string PodCode { get; set; }
/// <summary>
/// 目的港主键
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "目的港主键", IsNullable = true)]
public string PodId { get; set; }
/// <summary>
/// 目的港名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "目的港名称", Length = 60, IsNullable = true)]
public string PodName { get; set; }
/// <summary>
/// 船公司主键
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "船公司主键", IsNullable = true)]
public long CarrierId { get; set; }
public Nullable<long> CarrierId { get; set; }
/// <summary>
/// 船公司代码
@ -63,6 +81,12 @@ namespace DS.WMS.Core.Op.Entity
[SqlSugar.SugarColumn(ColumnDescription = "船公司代码", Length = 20, IsNullable = true)]
public string CarrierCode { get; set; }
/// <summary>
/// 船公司
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "船公司", Length = 100, IsNullable = true)]
public string Carrier { get; set; }
/// <summary>
/// 合约方公司全称
/// </summary>

@ -16,6 +16,8 @@ using System.Threading.Tasks;
using DS.Module.Core.Extensions;
using Microsoft.Owin.Security.Provider;
using Microsoft.AspNetCore.Identity;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Map.Dtos;
namespace DS.WMS.Core.Op.Method
{
@ -25,15 +27,20 @@ namespace DS.WMS.Core.Op.Method
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly ISysCacheService _sysCacheService;
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
//船公司基础映射模块
const string CONST_MAPPING_CARRIER_MODULE = "CarrierBaseMapping";
public BookingContractNoManageService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
_sysCacheService = _serviceProvider.GetRequiredService<ISysCacheService>();
}
#region 保存
@ -50,6 +57,26 @@ namespace DS.WMS.Core.Op.Method
try
{
List<MappingCarrierRes> mapCarrierList = new List<MappingCarrierRes>();
var cacheRlt = _sysCacheService.GetAllCommonCodeFromCache<MappingCarrierRes>(Sys.Method.SysCacheKeyEnum.CommonMappingCarrier)
.GetAwaiter().GetResult();
if(cacheRlt.Succeeded)
{
mapCarrierList = cacheRlt.Data;
if (model.CarrierId.HasValue && model.CarrierId.Value > 0)
{
var mapInfo = mapCarrierList.FirstOrDefault(a => a.Module == CONST_MAPPING_CARRIER_MODULE && a.LinkId == model.CarrierId.Value);
if (mapInfo != null)
{
model.CarrierCode = mapInfo.MapCode;
}
}
}
if (model.Id > 0)
{
info = await tenantDb.Queryable<BookingContractNoManage>().FirstAsync(t => t.Id == model.Id);

Loading…
Cancel
Save