@ -79,6 +79,8 @@ using System.Collections;
using System.Security.Principal ;
using System.Security.Principal ;
using Myshipping.Core.Const ;
using Myshipping.Core.Const ;
using ICSharpCode.SharpZipLib.BZip2 ;
using ICSharpCode.SharpZipLib.BZip2 ;
using Furion.ClayObject ;
using System.Dynamic ;
namespace Myshipping.Application
namespace Myshipping.Application
{
{
@ -134,6 +136,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository < BookingExtendState > _repextendstate ;
private readonly SqlSugarRepository < BookingExtendState > _repextendstate ;
private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService ;
private readonly IServiceWorkFlowManageService _serviceWorkFlowManageService ;
private readonly IDjyUserConfigService _djyUserConfigService ;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING" ;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING" ;
@ -157,7 +160,7 @@ namespace Myshipping.Application
SqlSugarRepository < SysTenant > repTenant , SqlSugarRepository < BookingStatus > repBookingStatus , SqlSugarRepository < BookingEDIExt > bookingEDIExt , SqlSugarRepository < BookingServiceItem > serviceItem ,
SqlSugarRepository < SysTenant > repTenant , SqlSugarRepository < BookingStatus > repBookingStatus , SqlSugarRepository < BookingEDIExt > bookingEDIExt , SqlSugarRepository < BookingServiceItem > serviceItem ,
SqlSugarRepository < ParaContractNoInfo > paraContractNoInfoRepository , IHttpContextAccessor httpContextAccessor , IBookingGoodsStatusConfigService GoodsConfig , SqlSugarRepository < DjyWebsiteAccountConfig > djyWebsiteAccountConfigRepository ,
SqlSugarRepository < ParaContractNoInfo > paraContractNoInfoRepository , IHttpContextAccessor httpContextAccessor , IBookingGoodsStatusConfigService GoodsConfig , SqlSugarRepository < DjyWebsiteAccountConfig > djyWebsiteAccountConfigRepository ,
ISysOrgService orgService , SqlSugarRepository < BookingLineOpMgrConfig > repLineOpMgrConfig , SqlSugarRepository < SysEmp > repSysEmp , SqlSugarRepository < BookingAutoYardImport > repAutoYard ,
ISysOrgService orgService , SqlSugarRepository < BookingLineOpMgrConfig > repLineOpMgrConfig , SqlSugarRepository < SysEmp > repSysEmp , SqlSugarRepository < BookingAutoYardImport > repAutoYard ,
IServiceWorkFlowManageService serviceWorkFlowManageService )
IServiceWorkFlowManageService serviceWorkFlowManageService , IDjyUserConfigService djyUserConfigService )
{
{
this . _logger = logger ;
this . _logger = logger ;
this . _rep = rep ;
this . _rep = rep ;
@ -203,6 +206,7 @@ namespace Myshipping.Application
this . _repAutoYard = repAutoYard ;
this . _repAutoYard = repAutoYard ;
this . _repextendstate = repextendstate ;
this . _repextendstate = repextendstate ;
_serviceWorkFlowManageService = serviceWorkFlowManageService ;
_serviceWorkFlowManageService = serviceWorkFlowManageService ;
_djyUserConfigService = djyUserConfigService ;
}
}
#region 主表和箱信息
#region 主表和箱信息
@ -466,21 +470,38 @@ namespace Myshipping.Application
var itgoodsStatus = new List < ITGoodsStatusDto > ( ) ;
var itgoodsStatus = new List < ITGoodsStatusDto > ( ) ;
var itconfigs = new List < ITConfigsDto > ( ) ;
var itconfigs = new List < ITConfigsDto > ( ) ;
//是否展示服务状态列表
bool isUserShowGoodsStatus = true ;
List < ServiceProjectStatusDto > statusList = new List < ServiceProjectStatusDto > ( ) ;
List < ServiceProjectStatusDto > statusList = new List < ServiceProjectStatusDto > ( ) ;
if ( App . Configuration [ "ServiceStatusOpenAuto" ] = = "1" )
if ( App . Configuration [ "ServiceStatusOpenAuto" ] = = "1" )
{
{
QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch
var djyUserCfg = _djyUserConfigService . Multi ( new string [ ] { "booking_list_column" } )
. GetAwaiter ( ) . GetResult ( ) . FirstOrDefault ( ) ;
if ( djyUserCfg ! = null )
{
{
BookingIds = bookingidlist . ToArray ( ) ,
//如果不存在goodsStatusList则不获取服务状态详情
QueryType = TrackingQueryTypeEnum . QUERY_SERVICE_ALL ,
isUserShowGoodsStatus = ! Regex . IsMatch ( djyUserCfg . ConfigJson , "\\bfield\\b.*?\\bgoodsStatusList\\b" ) ;
TenantId = list . Items . FirstOrDefault ( ) . TenantId . Value
}
} ;
var queryRlt = _serviceWorkFlowManageService . GetEnableStatusListByBusinessBatch ( batchQuery )
. GetAwaiter ( ) . GetResult ( ) ;
if ( queryRlt. succ )
if ( isUserShowGoodsStatus )
{
{
statusList = JSON . Deserialize < List < ServiceProjectStatusDto > > ( JSON . Serialize ( queryRlt . ext ) ) ;
QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch
{
BookingIds = bookingidlist . ToArray ( ) ,
QueryType = TrackingQueryTypeEnum . QUERY_SERVICE_ALL ,
TenantId = list . Items . FirstOrDefault ( ) . TenantId . Value
} ;
var queryRlt = _serviceWorkFlowManageService . GetEnableStatusListByBusinessBatch ( batchQuery )
. GetAwaiter ( ) . GetResult ( ) ;
if ( queryRlt . succ )
{
statusList = JSON . Deserialize < List < ServiceProjectStatusDto > > ( JSON . Serialize ( queryRlt . ext ) ) ;
}
}
}
}
}
else
else
@ -609,37 +630,53 @@ namespace Myshipping.Application
if ( App . Configuration [ "ServiceStatusOpenAuto" ] = = "1" )
if ( App . Configuration [ "ServiceStatusOpenAuto" ] = = "1" )
{
{
var currStatusList = statusList . Where ( a = > long . Parse ( a . BusiId ) = = item . Id ) . ToList ( ) ;
if ( isUserShowGoodsStatus )
if ( currStatusList . Count > 0 )
{
{
if ( currStatusList . Any ( a = > a . StatusSKUCode . Equals ( "YFVGM" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) )
var currStatusList = statusList . Where ( a = > long . Parse ( a . BusiId ) = = item . Id ) . ToList ( ) ;
{
item . IsVGM = currStatusList . FirstOrDefault ( a = >
if ( currStatusList . Count > 0 )
a . StatusSKUCode . Equals ( "YFVGM" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) . ActDate . Value ;
}
if ( currStatusList . Any ( a = > a . StatusSKUCode . Equals ( "YFCD" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) )
{
{
item . IsCanDan = currStatusList . FirstOrDefault ( a = >
if ( currStatusList . Any ( a = > a . StatusSKUCode . Equals ( "YFVGM" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) )
a . StatusSKUCode . Equals ( "YFCD" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) . ActDate . Value ;
{
var currSt = currStatusList . FirstOrDefault ( a = >
a . StatusSKUCode . Equals ( "YFVGM" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) ;
if ( currSt ! = null & & currSt . ActDate . HasValue )
item . IsVGM = currSt . ActDate . Value ;
}
if ( currStatusList . Any ( a = > a . StatusSKUCode . Equals ( "YFCD" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) )
{
var currSt = currStatusList . FirstOrDefault ( a = >
a . StatusSKUCode . Equals ( "YFCD" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) ;
if ( currSt ! = null & & currSt . ActDate . HasValue )
item . IsCanDan = currSt . ActDate . Value ;
}
if ( currStatusList . Any ( a = > a . StatusSKUCode . Equals ( "ZZFX" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) )
{
var currSt = currStatusList . FirstOrDefault ( a = >
a . StatusSKUCode . Equals ( "ZZFX" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) ;
if ( currSt ! = null & & currSt . ActDate . HasValue )
item . IsZZFX = currSt . ActDate . Value ;
}
item . GoodsStatusList = currStatusList . OrderBy ( a = > a . CalcSortNo )
. Select ( a = > new GoodsStatusList
{
FinishTime = a . ActDate ,
IsLast = a . IsEnd ,
Sort = a . ActSortNo ,
StatusName = a . ShowName ,
SystemCode = a . StatusSKUCode ,
ExtData = ! string . IsNullOrWhiteSpace ( a . ActVal ) ? a . ActVal : string . Empty ,
Remark = ! string . IsNullOrWhiteSpace ( a . ActRemark ) ? a . ActRemark : string . Empty
} ) . ToList ( ) ;
}
}
if ( currStatusList . Any ( a = > a . StatusSKUCode . Equals ( "ZZFX" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) )
else
{
{
item . IsZZFX = currStatusList . FirstOrDefault ( a = >
item . GoodsStatusList = new List < GoodsStatusList > ( ) ;
a . StatusSKUCode . Equals ( "ZZFX" , StringComparison . OrdinalIgnoreCase ) & & a . IsYield ) . ActDate . Value ;
}
}
item . GoodsStatusList = currStatusList . OrderBy ( a = > a . CalcSortNo )
. Select ( a = > new GoodsStatusList
{
FinishTime = a . ActDate ,
IsLast = a . IsEnd ,
Sort = a . ActSortNo ,
StatusName = a . ShowName ,
SystemCode = a . StatusSKUCode ,
ExtData = ! string . IsNullOrWhiteSpace ( a . ActVal ) ? a . ActVal : string . Empty ,
Remark = ! string . IsNullOrWhiteSpace ( a . ActRemark ) ? a . ActRemark : string . Empty
} ) . ToList ( ) ;
}
}
else
else
{
{
@ -9218,8 +9255,10 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
if ( statusList ! = null )
if ( statusList ! = null )
{
{
var maxStatus = statusList . Where ( a = > a . IsYield )
var maxStatus = statusList . Where ( a = > a . IsYield )
. OrderByDescending ( a = > a . WFSortNo )
//.OrderByDescending(a=>a.WFSortNo)
. ThenByDescending ( a = > a . CalcSortNo ) . FirstOrDefault ( ) ;
//.ThenByDescending(a => a.CalcSortNo)
. OrderByDescending ( a = > a . SortNo )
. FirstOrDefault ( ) ;
if ( maxStatus ! = null )
if ( maxStatus ! = null )
{
{
@ -9227,7 +9266,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
. First ( a = > a . Id = = bookingId ) ;
. First ( a = > a . Id = = bookingId ) ;
model . BSSTATUSNAME = maxStatus . ShowName ;
model . BSSTATUSNAME = maxStatus . ShowName ;
model . VERSION = IDGen . NextID ( ) . ToString ( ) . Replace ( "-" , "" ) ;
//model.VERSION = IDGen.NextID().ToString().Replace("-", "") ;
//更新订舱
//更新订舱
_rep . AsUpdateable ( model )
_rep . AsUpdateable ( model )
@ -9311,8 +9350,10 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
if ( statusList ! = null )
if ( statusList ! = null )
{
{
var maxStatus = statusList . Where ( a = > a . IsYield )
var maxStatus = statusList . Where ( a = > a . IsYield )
. OrderByDescending ( a = > a . WFSortNo )
//.OrderByDescending(a => a.WFSortNo)
. ThenByDescending ( a = > a . CalcSortNo ) . FirstOrDefault ( ) ;
//.ThenByDescending(a => a.CalcSortNo)
. OrderByDescending ( a = > a . SortNo )
. FirstOrDefault ( ) ;
var model = _rep . AsQueryable ( ) . Filter ( null , true )
var model = _rep . AsQueryable ( ) . Filter ( null , true )
. First ( a = > a . Id = = bookingId ) ;
. First ( a = > a . Id = = bookingId ) ;
@ -9326,7 +9367,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
model . BSSTATUSNAME = string . Empty ;
model . BSSTATUSNAME = string . Empty ;
}
}
model . VERSION = IDGen . NextID ( ) . ToString ( ) . Replace ( "-" , "" ) ;
//model.VERSION = IDGen.NextID().ToString().Replace("-", "") ;
//更新订舱
//更新订舱
_rep . AsUpdateable ( model )
_rep . AsUpdateable ( model )
@ -9352,7 +9393,7 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
/// <param name="bookingId"></param>
/// <param name="bookingId"></param>
/// <param name="isAutoSyncDS">是否默认同步东胜 true-自动同步 false-不自动同步</param>
/// <param name="isAutoSyncDS">是否默认同步东胜 true-自动同步 false-不自动同步</param>
/// <returns></returns>
/// <returns></returns>
public async Task SetBooking Order GoodsStatus( long bookingId , bool isAutoSyncDS = false )
public async Task SetBooking GoodsStatus( long bookingId , bool isAutoSyncDS = false )
{
{
var bookingOrder = _rep . AsQueryable ( ) . Filter ( null , true )
var bookingOrder = _rep . AsQueryable ( ) . Filter ( null , true )
. First ( a = > a . Id = = bookingId ) ;
. First ( a = > a . Id = = bookingId ) ;
@ -9373,8 +9414,10 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
if ( statusList ! = null )
if ( statusList ! = null )
{
{
var maxStatus = statusList . Where ( a = > a . IsYield )
var maxStatus = statusList . Where ( a = > a . IsYield )
. OrderByDescending ( a = > a . WFSortNo )
//.OrderByDescending(a => a.WFSortNo)
. ThenByDescending ( a = > a . CalcSortNo ) . FirstOrDefault ( ) ;
//.ThenByDescending(a => a.CalcSortNo)
. OrderByDescending ( a = > a . SortNo )
. FirstOrDefault ( ) ;
var model = _rep . AsQueryable ( ) . Filter ( null , true )
var model = _rep . AsQueryable ( ) . Filter ( null , true )
. First ( a = > a . Id = = bookingId ) ;
. First ( a = > a . Id = = bookingId ) ;