@ -15,6 +15,7 @@ using Logger = NLog.Logger;
using Mapster ;
using Mapster ;
using Microsoft.AspNetCore.Identity ;
using Microsoft.AspNetCore.Identity ;
using DS.Module.Core.Constants ;
using DS.Module.Core.Constants ;
using Microsoft.AspNetCore.Http ;
namespace DS.WMS.Core.Op.Method
namespace DS.WMS.Core.Op.Method
{
{
@ -26,6 +27,7 @@ namespace DS.WMS.Core.Op.Method
private readonly ISaasDbService saasService ;
private readonly ISaasDbService saasService ;
private readonly ICommonService commonService ;
private readonly ICommonService commonService ;
private readonly ISeaExportCommonService seaComService ;
private readonly ISeaExportCommonService seaComService ;
private readonly IHttpContextAccessor accessor ;
private static readonly Logger _logger = LogManager . GetCurrentClassLogger ( ) ;
private static readonly Logger _logger = LogManager . GetCurrentClassLogger ( ) ;
/// <summary>
/// <summary>
///
///
@ -39,6 +41,7 @@ namespace DS.WMS.Core.Op.Method
saasService = _serviceProvider . GetRequiredService < ISaasDbService > ( ) ;
saasService = _serviceProvider . GetRequiredService < ISaasDbService > ( ) ;
commonService = _serviceProvider . GetRequiredService < ICommonService > ( ) ;
commonService = _serviceProvider . GetRequiredService < ICommonService > ( ) ;
seaComService = _serviceProvider . GetRequiredService < ISeaExportCommonService > ( ) ;
seaComService = _serviceProvider . GetRequiredService < ISeaExportCommonService > ( ) ;
accessor = _serviceProvider . GetRequiredService < IHttpContextAccessor > ( ) ;
}
}
/// <summary>
/// <summary>
/// 插入货运动态
/// 插入货运动态
@ -74,8 +77,10 @@ namespace DS.WMS.Core.Op.Method
continue ;
continue ;
}
}
}
}
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var tenantId = accessor . HttpContext . Request . Headers [ "PushBackKey" ] . FirstOrDefault ( ) ;
var tenantDb = saasService . GetBizDbScopeById ( tenantId ) ;
var businessId = item . BookingId ;
var businessId = item . BookingId ;
//TODO
var list = await tenantDb . Queryable < BookingStatus > ( ) . Filter ( null , true )
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 & & d . StatusGroup = = "booking_status_group_billtrace" & & d . BusinessId = = businessId ) . Select ( ( d , t ) = > new
{
{
@ -86,6 +91,13 @@ namespace DS.WMS.Core.Op.Method
Name = t . Name ,
Name = t . Name ,
Value = t . Value
Value = t . Value
} ) . ToListAsync ( ) ;
} ) . ToListAsync ( ) ;
// var list = await tenantDb.Queryable<BookingStatus>().Filter(null, true).Where(x=>x.StatusGroup == "booking_status_group_billtrace" && x.BusinessId == businessId).Select(d=> new
//{
// BusinessId = d.BusinessId,
// StatusCode = d.StatusCode,
// StatusName = d.StatusName,
// StatusTime = d.StatusTime
//}).ToListAsync();
var oldLog = await tenantDb . Queryable < BookingStatusLog > ( ) . Where ( x = > x . BusinessId = = businessId & & x . Group = = "yunzong" ) . FirstAsync ( ) ;
var oldLog = await tenantDb . Queryable < BookingStatusLog > ( ) . Where ( x = > x . BusinessId = = businessId & & x . Group = = "yunzong" ) . FirstAsync ( ) ;
//删除日志详情和日志
//删除日志详情和日志
@ -323,7 +335,7 @@ namespace DS.WMS.Core.Op.Method
#region 船舶动态: ATD ETD ATA ETA MDGETA MDGATA
#region 船舶动态: ATD ETD ATA ETA MDGETA MDGATA
if ( item . Status = = "ATD" | | item . Status = = "ETD" | | item . Status = = "ATA" | | item . Status = = "ETA" | | item . Status = = "MDGETA" | | item . Status = = "MDGATA" )
if ( item . Status = = "ATD" | | item . Status = = "ETD" | | item . Status = = "ATA" | | item . Status = = "ETA" | | item . Status = = "MDGETA" | | item . Status = = "MDGATA" )
{
{
var config = await tenantD b. Queryable < SysConfig > ( ) . FirstAsync ( x = > x . Code = = TenantParamCode . ENABLE_STATUS_TO_SAILING_DATE ) ;
var config = await d b. Queryable < SysConfig > ( ) . FirstAsync ( x = > x . Code = = TenantParamCode . ENABLE_STATUS_TO_SAILING_DATE ) ;
if ( config . IsNotNull ( ) & & config . Value = = "YES" )
if ( config . IsNotNull ( ) & & config . Value = = "YES" )
{
{