@ -15,6 +15,7 @@ using Logger = NLog.Logger;
using Mapster ;
using Microsoft.AspNetCore.Identity ;
using DS.Module.Core.Constants ;
using Microsoft.AspNetCore.Http ;
namespace DS.WMS.Core.Op.Method
{
@ -26,6 +27,7 @@ namespace DS.WMS.Core.Op.Method
private readonly ISaasDbService saasService ;
private readonly ICommonService commonService ;
private readonly ISeaExportCommonService seaComService ;
private readonly IHttpContextAccessor accessor ;
private static readonly Logger _logger = LogManager . GetCurrentClassLogger ( ) ;
/// <summary>
///
@ -39,6 +41,7 @@ namespace DS.WMS.Core.Op.Method
saasService = _serviceProvider . GetRequiredService < ISaasDbService > ( ) ;
commonService = _serviceProvider . GetRequiredService < ICommonService > ( ) ;
seaComService = _serviceProvider . GetRequiredService < ISeaExportCommonService > ( ) ;
accessor = _serviceProvider . GetRequiredService < IHttpContextAccessor > ( ) ;
}
/// <summary>
/// 插入货运动态
@ -74,8 +77,10 @@ namespace DS.WMS.Core.Op.Method
continue ;
}
}
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var tenantId = accessor . HttpContext . Request . Headers [ "PushBackKey" ] . FirstOrDefault ( ) ;
var tenantDb = saasService . GetBizDbScopeById ( tenantId ) ;
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
{
@ -86,6 +91,13 @@ namespace DS.WMS.Core.Op.Method
Name = t . Name ,
Value = t . Value
} ) . 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 ( ) ;
//删除日志详情和日志
@ -323,7 +335,7 @@ namespace DS.WMS.Core.Op.Method
#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" )
{
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" )
{