|
|
|
@ -30,11 +30,15 @@ using LanguageExt;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Masuit.Tools.Systems;
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using NLog;
|
|
|
|
|
using Spring.Expressions.Parser.antlr.debug;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using static iText.StyledXmlParser.Jsoup.Select.Evaluator;
|
|
|
|
|
using Logger = NLog.Logger;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method;
|
|
|
|
@ -562,6 +566,41 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
//return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
await tenantDb.Ado.CommitTranAsync();
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(info.MBLNO) && !string.IsNullOrEmpty(info.Yard) && (req.MBLNO != oldOrder.MBLNO || info.YardId != oldOrder.YardId || info.CarrierId != oldOrder.CarrierId))
|
|
|
|
|
{
|
|
|
|
|
_logger.Info($"数据有变化,更新运踪订阅");
|
|
|
|
|
//更改提单号重新订阅运踪
|
|
|
|
|
var traceReq = new List<BillTraceSendReq>(1);
|
|
|
|
|
traceReq.Add(new BillTraceSendReq()
|
|
|
|
|
{
|
|
|
|
|
BusinessId = info.Id.ToString(),
|
|
|
|
|
Carrier = info.Carrier,
|
|
|
|
|
CarrierId = info.CarrierId,
|
|
|
|
|
IsBook = true,
|
|
|
|
|
IsFrontPort = false,
|
|
|
|
|
MBLNO = info.MBLNO,
|
|
|
|
|
Yard = info.Yard,
|
|
|
|
|
YardId = info.YardId
|
|
|
|
|
});
|
|
|
|
|
await SendOrUpdateTrace(traceReq);
|
|
|
|
|
if (!string.IsNullOrEmpty(info.Id.ToString()))
|
|
|
|
|
{
|
|
|
|
|
_logger.Warn($"保存请求[{info.Id.ToString()}],更新运踪订阅完成");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(info.MBLNO) && !string.IsNullOrEmpty(oldOrder.MBLNO) && oldOrder.IsBookingYZ != "0")
|
|
|
|
|
{
|
|
|
|
|
// 在已经订阅运踪的情况下,如果操作员删除提单号,则取消订阅运踪
|
|
|
|
|
var unsubcribeDto = new List<BillTraceUnsubscribeList>(1)
|
|
|
|
|
{
|
|
|
|
|
new BillTraceUnsubscribeList(oldOrder.Id.ToString(), oldOrder.MBLNO)
|
|
|
|
|
};
|
|
|
|
|
await UnsubscribeBillTrace(unsubcribeDto);
|
|
|
|
|
if (!string.IsNullOrEmpty(info.Id.ToString()))
|
|
|
|
|
{
|
|
|
|
|
_logger.Warn($"保存请求[{info.Id.ToString()}],退订运踪完成");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
////保存会同步舱位
|
|
|
|
|
//await _bookingSlotService.SyncBookingOrderToSlot(new BookingOrderToSlotDto {
|
|
|
|
|
// BookingId = info.Id,
|
|
|
|
@ -732,6 +771,27 @@ public partial class SeaExportService : ISeaExportService
|
|
|
|
|
#endregion
|
|
|
|
|
//return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
|
|
|
|
|
await tenantDb.Ado.CommitTranAsync();
|
|
|
|
|
//发起运踪订阅
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.MBLNO) && !string.IsNullOrEmpty(entity.Yard))
|
|
|
|
|
{
|
|
|
|
|
var traceReq = new List<BillTraceSendReq>();
|
|
|
|
|
traceReq.Add(new BillTraceSendReq()
|
|
|
|
|
{
|
|
|
|
|
BusinessId = entity.Id.ToString(),
|
|
|
|
|
Carrier = entity.Carrier,
|
|
|
|
|
CarrierId = entity.CarrierId,
|
|
|
|
|
IsBook = true,
|
|
|
|
|
IsFrontPort = false,
|
|
|
|
|
MBLNO = entity.MBLNO,
|
|
|
|
|
Yard = entity.Yard,
|
|
|
|
|
YardId = entity.YardId
|
|
|
|
|
});
|
|
|
|
|
await SendOrUpdateTrace(traceReq);
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.Id.ToString()))
|
|
|
|
|
{
|
|
|
|
|
_logger.Warn($"保存请求[{entity.Id.ToString()}],更新运踪订阅完成");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return await Task.FromResult(DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess));
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|