|
|
|
@ -16,6 +16,7 @@ using Mapster;
|
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
using DS.Module.Core.Constants;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
@ -52,13 +53,20 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (req.Count == 0)
|
|
|
|
|
// 当BusinessId不为空时,将BusinessId的值转为订舱主键;否则仍然使用BookingId作为订舱记录主键
|
|
|
|
|
if (!string.IsNullOrEmpty(req[0].BusinessId))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
if (long.TryParse(req[0].BusinessId, out long itemBusinessId))
|
|
|
|
|
{
|
|
|
|
|
req[0].BookingId = itemBusinessId;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_logger.Error($"在将item.BusinessId转为BookingId时发生异常,货运动态插入失败;item.BusinessId的值为:{req[0].BusinessId}");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_logger.Info($"货运动态回调:"+ JsonConvert.SerializeObject(req));
|
|
|
|
|
//订舱状态
|
|
|
|
|
var dicList = db.Queryable<SysDictData>().Where(x => x.TypeId == 1788810332945387520).ToList();
|
|
|
|
|
foreach (var item in req)
|
|
|
|
@ -82,7 +90,9 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
var businessId = item.BookingId;
|
|
|
|
|
//TODO
|
|
|
|
|
var list = await tenantDb.Queryable<BookingStatus>().Filter(null, true)
|
|
|
|
|
.InnerJoin<SysDictData>((d, t) => d.StatusCode == t.Value && d.StatusGroup == "booking_status_group_billtrace" && d.BusinessId == businessId).Select((d, t) => new
|
|
|
|
|
.InnerJoin<SysDictData>((d, t) => d.StatusCode == t.Value && t.TypeId == 1788810332945387520 && d.StatusGroup == "booking_status_group_billtrace"
|
|
|
|
|
&& d.BusinessId == businessId, "shippingweb8_dev.sys_dict_data")
|
|
|
|
|
.Select((d, t) => new
|
|
|
|
|
{
|
|
|
|
|
BusinessId = d.BusinessId,
|
|
|
|
|
StatusCode = d.StatusCode,
|
|
|
|
@ -100,10 +110,16 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
//}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
var oldLog = await tenantDb.Queryable<BookingStatusLog>().Where(x => x.BusinessId == businessId && x.Group == "yunzong").FirstAsync();
|
|
|
|
|
if (oldLog.IsNotNull()) {
|
|
|
|
|
//删除日志详情和日志
|
|
|
|
|
var oldLogDetails = await tenantDb.Queryable<BookingStatusLogDetail>().Where(x => x.PId == oldLog.Id).ToListAsync();
|
|
|
|
|
if (oldLogDetails.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
await tenantDb.Deleteable(oldLogDetails).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await tenantDb.Deleteable(oldLog).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 日志
|
|
|
|
|
//新增数据
|
|
|
|
@ -450,7 +466,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|