|
|
|
@ -2071,10 +2071,11 @@ namespace Myshipping.Application
|
|
|
|
|
else if (string.IsNullOrEmpty(entity.MBLNO) && !string.IsNullOrEmpty(mlist.MBLNO) && mlist.IsBookingYZ != "0")
|
|
|
|
|
{
|
|
|
|
|
// 在已经订阅运踪的情况下,如果操作员删除提单号,则取消订阅运踪
|
|
|
|
|
await UnsubscribeBillTrace(new List<BillTraceUnsubscribeList>(1)
|
|
|
|
|
var unsubcribeDto = new List<BillTraceUnsubscribeList>(1)
|
|
|
|
|
{
|
|
|
|
|
new BillTraceUnsubscribeList(mlist.Id.ToString(), mlist.MBLNO)
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BillTrace:Unsubscribe", new { Data = unsubcribeDto, TenentId = UserManager.TENANT_ID, UserId = UserManager.UserId, UserName = UserManager.Name, DjyUserId = UserManager.DjyUserId }));
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(reqId))
|
|
|
|
|
{
|
|
|
|
@ -2403,8 +2404,6 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("未获取到相关url,请联系管理员!");
|
|
|
|
|
}
|
|
|
|
|
// 要取消订阅运踪的列表
|
|
|
|
|
List<BillTraceUnsubscribeList> waitUnsubscribeBilltrace = new(arr.Count());
|
|
|
|
|
|
|
|
|
|
var tenantParamList = await _cache.GetAllTenantParam();
|
|
|
|
|
var isAskDs = tenantParamList.FirstOrDefault(x => x.TenantId == UserManager.TENANT_ID && x.ParaCode == TenantParamCode.ASK_DS_BEFORE_DELETE_BOOKING_ORDER);
|
|
|
|
@ -2463,7 +2462,14 @@ namespace Myshipping.Application
|
|
|
|
|
_logger.LogInformation(mblno + "删除成功!");
|
|
|
|
|
|
|
|
|
|
// 取消订阅运踪
|
|
|
|
|
waitUnsubscribeBilltrace.Add(new BillTraceUnsubscribeList(Id.ToString(), mblno));
|
|
|
|
|
if (!string.IsNullOrEmpty(order.IsBookingYZ) && order.IsBookingYZ != "0")
|
|
|
|
|
{
|
|
|
|
|
var unsubcribeDto = new List<BillTraceUnsubscribeList>(1)
|
|
|
|
|
{
|
|
|
|
|
new BillTraceUnsubscribeList(Id.ToString(), order.MBLNO)
|
|
|
|
|
};
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BillTrace:Unsubscribe", new { Data = unsubcribeDto, TenentId = UserManager.TENANT_ID, UserId = UserManager.UserId, UserName = UserManager.Name, DjyUserId = UserManager.DjyUserId }));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isCancelAllocationSlot == "YES")
|
|
|
|
|
{
|
|
|
|
@ -2498,8 +2504,14 @@ namespace Myshipping.Application
|
|
|
|
|
await _bookingEDIExt.UpdateAsync(x => x.BookingId == Id && x.IsDeleted == false, x => new BookingEDIExt { IsDeleted = true });
|
|
|
|
|
_logger.LogInformation(mblno + "删除成功!");
|
|
|
|
|
|
|
|
|
|
// 取消订阅运踪
|
|
|
|
|
waitUnsubscribeBilltrace.Add(new BillTraceUnsubscribeList(Id.ToString(), mblno));
|
|
|
|
|
if (!string.IsNullOrEmpty(order.IsBookingYZ) && order.IsBookingYZ != "0")
|
|
|
|
|
{
|
|
|
|
|
var unsubcribeDto = new List<BillTraceUnsubscribeList>(1)
|
|
|
|
|
{
|
|
|
|
|
new BillTraceUnsubscribeList(Id.ToString(), order.MBLNO)
|
|
|
|
|
};
|
|
|
|
|
await _publisher.PublishAsync(new ChannelEventSource("BillTrace:Unsubscribe", new { Data = unsubcribeDto, TenentId = UserManager.TENANT_ID, UserId = UserManager.UserId, UserName = UserManager.Name, DjyUserId = UserManager.DjyUserId }));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isCancelAllocationSlot == "YES")
|
|
|
|
|
{
|
|
|
|
@ -2528,12 +2540,6 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 取消订阅运踪
|
|
|
|
|
if (waitUnsubscribeBilltrace.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
await UnsubscribeBillTrace(waitUnsubscribeBilltrace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 消息队列推送删除信息
|
|
|
|
|
//var itemcode = _cache.GetAllTenantParam().Result.Where(x => x.ParaCode == "BOOKING_DATA_PUSH" && x.TenantId == UserManager.TENANT_ID).Select(x => x.ItemCode).FirstOrDefault();
|
|
|
|
|
//if (!string.IsNullOrEmpty(itemcode))
|
|
|
|
@ -3587,74 +3593,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 退订运踪
|
|
|
|
|
/// </summary>
|
|
|
|
|
public async Task UnsubscribeBillTrace(List<BillTraceUnsubscribeList> billtraces)
|
|
|
|
|
{
|
|
|
|
|
if (billtraces == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("未传入正确参数!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var key = _webAccountConfig.GetAccountConfig("seae_billtraceurl", UserManager.UserId).Result;
|
|
|
|
|
if (key == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("调用运踪接口相关账号未维护!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var url = _cache.GetAllDictData().Result?.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_unsubscribe_seae_billtrace_url")?.Value;
|
|
|
|
|
if (string.IsNullOrEmpty(url))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("未配置退订运踪接口地址!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BillTraceUnsubscribeDto reqDto = new BillTraceUnsubscribeDto()
|
|
|
|
|
{
|
|
|
|
|
Children = new List<BillTraceUnsubscribeList>(),
|
|
|
|
|
Key = key.Account,
|
|
|
|
|
PWD = key.Password,
|
|
|
|
|
Gid = UserManager.DjyUserId
|
|
|
|
|
};
|
|
|
|
|
foreach (BillTraceUnsubscribeList item in billtraces)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("调用退订运踪接口,提单号:" + item.MBLNO);
|
|
|
|
|
if (string.IsNullOrEmpty(item.BusinessId))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("订舱记录主键不能为空!");
|
|
|
|
|
}
|
|
|
|
|
reqDto.Children.Add(new BillTraceUnsubscribeList(item.BusinessId, item.MBLNO));
|
|
|
|
|
|
|
|
|
|
////添加booking日志
|
|
|
|
|
var bid = await _bookinglog.InsertReturnSnowflakeIdAsync(new BookingLog
|
|
|
|
|
{
|
|
|
|
|
Type = "Trace",
|
|
|
|
|
BookingId = Convert.ToInt64(item.BusinessId),
|
|
|
|
|
TenantId = Convert.ToInt64(UserManager.TENANT_ID),
|
|
|
|
|
CreatedTime = DateTime.Now,
|
|
|
|
|
CreatedUserId = UserManager.UserId,
|
|
|
|
|
CreatedUserName = UserManager.Name
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await _bookinglogdetail.InsertReturnSnowflakeIdAsync(new BookingLogDetail
|
|
|
|
|
{
|
|
|
|
|
PId = bid,
|
|
|
|
|
Field = "",
|
|
|
|
|
OldValue = "",
|
|
|
|
|
NewValue = "退订运踪",
|
|
|
|
|
});
|
|
|
|
|
await _rep.UpdateAsync(x => x.Id == Convert.ToInt64(item.BusinessId), x => new BookingOrder { IsBookingYZ = "0" });
|
|
|
|
|
}
|
|
|
|
|
var json = reqDto.ToJsonString();
|
|
|
|
|
_logger.LogInformation("调用退订运踪接口发送json:" + json);
|
|
|
|
|
var html = await url.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
|
|
|
|
|
_logger.LogInformation("调用退订运踪接口返回" + html.ToJsonString());
|
|
|
|
|
if (html.Success != true)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("调用退订运踪接口返回:" + html.ToJsonString());
|
|
|
|
|
throw Oops.Bah(html.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 放舱(入货通知)
|
|
|
|
|