自动箱号引入开关

optimize
wanghaomei 1 year ago
parent cae6b4ce13
commit ad194c37e8

@ -1006,7 +1006,7 @@ namespace Myshipping.Application
return ordOut;
}
/// <summary>
/// 在订舱台账保存单证备注、操作备注等功能
@ -1029,12 +1029,14 @@ namespace Myshipping.Application
throw Oops.Bah("无权修改");
}
var orderCompare = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == model.Id);
model.Adapt(order);
order.VERSION = Guid.NewGuid().ToString();
await _rep.UpdateAsync(order);
//todo:记录修改日志,等待抽取方法
//记录修改日志
await SaveLog(order, orderCompare);
}
/// <summary>
@ -2164,13 +2166,13 @@ namespace Myshipping.Application
public async Task<long> LetteryardSave(UpdateBookingLetteryardInput input)
{
long rtnId = 0;
if (input.Id == 0)
{
var entity = input.Adapt<BookingLetteryard>();
await _repLetterYard.InsertAsync(entity);
rtnId = entity.Id;
}
else
{
@ -2178,7 +2180,7 @@ namespace Myshipping.Application
input.Adapt(entity);
await _repLetterYard.UpdateAsync(entity);
rtnId = entity.Id;
}
var order = _rep.FirstOrDefault(x => x.Id == input.BookingId);
@ -2197,7 +2199,7 @@ namespace Myshipping.Application
await VgmLink(input.BookingId);
}
await SendLetterYard(input.BookingId);
await SendLetterYard(input.BookingId);
return rtnId;
}
@ -2205,10 +2207,10 @@ namespace Myshipping.Application
/// 放舱推送东胜
/// </summary>
/// <returns></returns>
public async Task<dynamic> SendLetterYard(long bookingId)
public async Task<dynamic> SendLetterYard(long bookingId)
{
var entity= _repLetterYard.AsQueryable().Filter(null, true).First(x => x.BookingId == bookingId);
var json = entity.ToJsonString();
var entity = _repLetterYard.AsQueryable().Filter(null, true).First(x => x.BookingId == bookingId);
var json = entity.ToJsonString();
try
{
const string MqActionExchangeName = "djy.output.dingcang.ds6";
@ -7585,6 +7587,14 @@ namespace Myshipping.Application
private async Task AutoYardData(long bookId)
{
var order = _rep.AsQueryable().Filter(null, true).First(x => x.Id == bookId);
var paraAuto = _cache.GetAllTenantParam().Result.FirstOrDefault(x => x.TenantId == order.TenantId && x.ParaCode == "AUTO_CNTRNO_SEALNO_IMPORT");
if (paraAuto == null || paraAuto.ItemCode != "YES")
{
_logger.LogInformation($"{order.TenantName}未开启自动箱号引入");
return;
}
var ctns = _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == bookId).ToList();
if (ctns.Count(x => !string.IsNullOrEmpty(x.CNTRNO) || !string.IsNullOrEmpty(x.SEALNO)) > 0) //有数据填写了箱封号,不再处理
{

Loading…
Cancel
Save