修改下货纸比对

optimize
jianghaiqing 1 year ago
parent 3b8ec05a4d
commit 22d3f61ae6

@ -242,5 +242,10 @@ namespace Myshipping.Application
/// 有返场日期箱数
/// </summary>
public int ExistsReturnYardDateCtnNum { get; set; }
/// <summary>
/// 有集装箱号的合计数
/// </summary>
public int ExistsCtnNo { get; set; }
}
}

@ -16,6 +16,7 @@ using Myshipping.Core.Service;
using Org.BouncyCastle.Asn1.X9;
using StackExchange.Profiling.Internal;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
@ -74,7 +75,15 @@ namespace Myshipping.Application
return await InnerExcuteShippingOrderCompareAsync(bookingId);
}
private async Task<TaskManageExcuteResultDto> InnerExcuteShippingOrderCompareAsync(string bookingId)
#region 执行下货纸比对
/// <summary>
/// 执行下货纸比对
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <param name="LstShipOrderCompareMode">比对模式MANUAL-手工 AUTO-自动)</param>
/// <returns>返回回执</returns>
private async Task<TaskManageExcuteResultDto> InnerExcuteShippingOrderCompareAsync(string bookingId,
string LstShipOrderCompareMode = "MANUAL")
{
string batchNo = IDGen.NextID().ToString();
@ -151,21 +160,73 @@ namespace Myshipping.Application
if (compareResult.succ)
{
orderInfo.LstShipOrderCompareMode = "MANUAL";
orderInfo.LstShipOrderCompareMode = LstShipOrderCompareMode;
/*
isComplete
1
2
*/
bool isComplete = false;
bool isBefore = false;
//需要细分状态,返场前和返场后
if (compareResult.yardStatInfo != null)
{
var yardStatInfo = compareResult.yardStatInfo as YardStatInfo;
//如果场站集装箱都有了返场时间,即认为下货纸自动任务结束
if (yardStatInfo.LstReturnYardDate.HasValue && yardStatInfo.ContaNum >= 1 &&
yardStatInfo.ContaNum == yardStatInfo.ExistsReturnYardDateCtnNum)
{
isComplete = true;
}
if (yardStatInfo.ExistsCtnNo < yardStatInfo.ContaNum)
isBefore = true;
}
DateTime etd = DateTime.MinValue;
if(model.ATD.HasValue)
{
etd = model.ATD.Value;
}
else if (model.ETD.HasValue)
{
etd = model.ETD.Value;
}
if (etd != DateTime.MinValue && etd <= DateTime.Now)
isComplete = true;
if (compareResult.extra.IsExistsDiff)
{
orderInfo.LstShipOrderCompareRlt = "DIFF";
orderInfo.LstShipOrderCompareRltName = "有差异";
if(isComplete)
{
orderInfo.LstShipOrderCompareRlt = "DIFF";
orderInfo.LstShipOrderCompareRltName = "有差异";
}
else
{
if (isBefore)
{
orderInfo.LstShipOrderCompareRlt = "BEFORE_DIFF";
orderInfo.LstShipOrderCompareRltName = "返场前比对有差异";
}
else
{
orderInfo.LstShipOrderCompareRlt = "DIFF_U";
orderInfo.LstShipOrderCompareRltName = "有差异未结束";
}
}
}
else
{
orderInfo.LstShipOrderCompareRlt = "NO_DIFF";
orderInfo.LstShipOrderCompareRltName = "正常";
//推送状态JHQ
if (App.Configuration["ServiceStatusOpenAuto"] == "1")
if (isComplete)
{
orderInfo.LstShipOrderCompareRlt = "NO_DIFF";
orderInfo.LstShipOrderCompareRltName = "正常";
//比对成功后触发下货纸比对状态
var saveStatusRlt = await _bookingValueAddedService.SaveServiceStatus(new ModifyServiceProjectStatusDto
{
@ -177,6 +238,30 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} 异步推送下货纸比对状态完成,结果={rlt}", batchNo, JSON.Serialize(saveStatusRlt));
}
else
{
if (isBefore)
{
orderInfo.LstShipOrderCompareRlt = "BEFORE_EQUAL";
orderInfo.LstShipOrderCompareRltName = "返场前比对正常";
}
else
{
orderInfo.LstShipOrderCompareRlt = "NO_DIFF_U";
orderInfo.LstShipOrderCompareRltName = "正常未结束";
//比对成功后触发下货纸比对状态
var saveStatusRlt = await _bookingValueAddedService.SaveServiceStatus(new ModifyServiceProjectStatusDto
{
BookingId = long.Parse(bookingId),
SourceType = TrackingSourceTypeEnum.AUTO,
StatusCodes = new List<ModifyServiceProjectStatusDetailDto> {
new ModifyServiceProjectStatusDetailDto { StatusCode = "XHZBDCHG" } }
});
_logger.LogInformation("批次={no} 异步推送下货纸比对状态完成,结果={rlt}", batchNo, JSON.Serialize(saveStatusRlt));
}
}
}
}
else
@ -219,6 +304,7 @@ namespace Myshipping.Application
return result;
}
#endregion
/// <summary>
/// 批量执行下货纸比对
@ -472,7 +558,7 @@ namespace Myshipping.Application
5
*/
return await InnerExcuteShippingOrderCompareAsync(bookingId);
return await InnerExcuteShippingOrderCompareAsync(bookingId, "AUTO");
}
#endregion
}

Loading…
Cancel
Save