diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 742eb489..7a865400 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1006,7 +1006,7 @@ namespace Myshipping.Application return ordOut; } - + /// /// 在订舱台账保存单证备注、操作备注等功能 @@ -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); } /// @@ -2164,13 +2166,13 @@ namespace Myshipping.Application public async Task LetteryardSave(UpdateBookingLetteryardInput input) { long rtnId = 0; - + if (input.Id == 0) { var entity = input.Adapt(); 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 /// 放舱推送东胜 /// /// - public async Task SendLetterYard(long bookingId) + public async Task 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) //有数据填写了箱封号,不再处理 {