|
|
|
@ -6,6 +6,7 @@ using Furion.FriendlyException;
|
|
|
|
|
using Furion.JsonSerialization;
|
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using ServiceProjectSyncWin;
|
|
|
|
@ -431,7 +432,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
|
|
|
|
|
1、更新任务台
|
|
|
|
|
2、更新舱位的截止时间记录
|
|
|
|
|
*/
|
|
|
|
|
var taskList = _db.Queryable<TaskBCEntity>().Where(a => (a.BUSI_TYPE == "BookingConfirmation" || a.BUSI_TYPE == "BookingAmendment") && a.TASK_ID == "08dc56ae-e1bd-4650-818e-85447143df67")
|
|
|
|
|
var taskList = _db.Queryable<TaskBCEntity>().Where(a => (a.BUSI_TYPE == "BookingConfirmation" || a.BUSI_TYPE == "BookingAmendment"))
|
|
|
|
|
.OrderBy(t=>t.CreatedTime)
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
@ -439,8 +440,8 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"批次={batchNo} 提取待处理任务 num={taskList.Count}");
|
|
|
|
|
|
|
|
|
|
string bcReadUrl = "http://localhost:5110/api/TaskBCParser/ExcuteBCFileRead";
|
|
|
|
|
string amendReadUrl = "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentRead";
|
|
|
|
|
string bcReadUrl = "http://47.104.73.97:7115/api/TaskBCParser/ExcuteBCFileRead";
|
|
|
|
|
string amendReadUrl = "http://47.104.73.97:7115/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentRead";
|
|
|
|
|
|
|
|
|
|
//foreach (var task in taskList)
|
|
|
|
|
for(int i=0;i<taskList.Count;i++)
|
|
|
|
@ -462,68 +463,120 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
|
|
|
|
|
|
|
|
|
|
var bcFileName = Path.GetFileName(bcFileFullPath);
|
|
|
|
|
|
|
|
|
|
if(!File.Exists(bcFileFullPath))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 取到文件不存在 path={bcFileFullPath}");
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskBCInfoReadDto BCReadInfo = GetBCReaderInfo(bcFileFullPath, bcFileName, task.TenantId.Value, task.TASK_ID, bcReadUrl).GetAwaiter().GetResult();
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 识别完文件 BCReadInfo={JSON.Serialize(BCReadInfo)}");
|
|
|
|
|
|
|
|
|
|
StringBuilder msgBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
if (BCReadInfo != null)
|
|
|
|
|
{
|
|
|
|
|
//SI_CUT_DATE
|
|
|
|
|
if (BCReadInfo.SICutDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
if (task.SI_CUT_DATE.HasValue && task.SI_CUT_DATE.Value == BCReadInfo.SICutDate.Value)
|
|
|
|
|
if (!task.SI_CUT_DATE.HasValue || task.SI_CUT_DATE.Value != BCReadInfo.SICutDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"SI_CUT_DATE org={task.SI_CUT_DATE} tar={BCReadInfo.SICutDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.SI_CUT_DATE = BCReadInfo.SICutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
task.SI_CUT_DATE = BCReadInfo.SICutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"SI_CUT_DATE org={task.SI_CUT_DATE} tar=null");
|
|
|
|
|
|
|
|
|
|
task.SI_CUT_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
//VGM_CUTOFF_TIME
|
|
|
|
|
if (BCReadInfo.VGMCutoffTime.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.VGM_CUTOFF_TIME = BCReadInfo.VGMCutoffTime.Value;
|
|
|
|
|
if (!task.VGM_CUTOFF_TIME.HasValue || task.VGM_CUTOFF_TIME.Value != BCReadInfo.VGMCutoffTime.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"VGM_CUTOFF_TIME org={task.VGM_CUTOFF_TIME} tar={BCReadInfo.VGMCutoffTime.Value}##");
|
|
|
|
|
|
|
|
|
|
task.VGM_CUTOFF_TIME = BCReadInfo.VGMCutoffTime.Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"VGM_CUTOFF_TIME org={task.VGM_CUTOFF_TIME} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.VGM_CUTOFF_TIME = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//MANIFEST_CUT_DATE
|
|
|
|
|
if (BCReadInfo.ManifestCutDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.MANIFEST_CUT_DATE = BCReadInfo.ManifestCutDate.Value;
|
|
|
|
|
if (!task.MANIFEST_CUT_DATE.HasValue || task.MANIFEST_CUT_DATE.Value != BCReadInfo.ManifestCutDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MANIFEST_CUT_DATE org={task.MANIFEST_CUT_DATE} tar={BCReadInfo.ManifestCutDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.MANIFEST_CUT_DATE = BCReadInfo.ManifestCutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MANIFEST_CUT_DATE org={task.MANIFEST_CUT_DATE} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.MANIFEST_CUT_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
//CY_CUTOFF_TIME
|
|
|
|
|
if (BCReadInfo.CYCutoffTime.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.CY_CUTOFF_TIME = BCReadInfo.CYCutoffTime.Value;
|
|
|
|
|
if (!task.MANIFEST_CUT_DATE.HasValue || task.MANIFEST_CUT_DATE.Value != BCReadInfo.CYCutoffTime.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CY_CUTOFF_TIME org={task.CY_CUTOFF_TIME} tar={BCReadInfo.CYCutoffTime.Value}##");
|
|
|
|
|
|
|
|
|
|
task.CY_CUTOFF_TIME = BCReadInfo.CYCutoffTime.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CY_CUTOFF_TIME org={task.CY_CUTOFF_TIME} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.CY_CUTOFF_TIME = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//MDGF_CUT_DATE
|
|
|
|
|
if (BCReadInfo.MDGFCutDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.MDGF_CUT_DATE = BCReadInfo.MDGFCutDate.Value;
|
|
|
|
|
if (!task.MDGF_CUT_DATE.HasValue || task.MDGF_CUT_DATE.Value != BCReadInfo.MDGFCutDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MDGF_CUT_DATE org={task.MDGF_CUT_DATE} tar={BCReadInfo.MDGFCutDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.MDGF_CUT_DATE = BCReadInfo.MDGFCutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MDGF_CUT_DATE org={task.MDGF_CUT_DATE} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.MDGF_CUT_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
//CLOSING_DATE
|
|
|
|
|
if (BCReadInfo.ClosingDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.CLOSING_DATE = BCReadInfo.ClosingDate.Value;
|
|
|
|
|
if (!task.CLOSING_DATE.HasValue || task.CLOSING_DATE.Value != BCReadInfo.ClosingDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CLOSING_DATE org={task.CLOSING_DATE} tar={BCReadInfo.ClosingDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.CLOSING_DATE = BCReadInfo.ClosingDate.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CLOSING_DATE org={task.CLOSING_DATE} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.CLOSING_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -538,6 +591,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
|
|
|
|
|
}).ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 识别完文件 有变更 结果={msgBuilder.ToString()}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (task.BUSI_TYPE == "BookingAmendment")
|
|
|
|
@ -550,62 +604,117 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
|
|
|
|
|
|
|
|
|
|
var bcFileName = Path.GetFileName(bcFileFullPath);
|
|
|
|
|
|
|
|
|
|
if (!File.Exists(bcFileFullPath))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 取到文件不存在 path={bcFileFullPath}");
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TaskBCInfoReadDto BCReadInfo = GetBCReaderInfo(bcFileFullPath, bcFileName, task.TenantId.Value, task.TASK_ID, amendReadUrl).GetAwaiter().GetResult();
|
|
|
|
|
|
|
|
|
|
StringBuilder msgBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
if (BCReadInfo != null)
|
|
|
|
|
{
|
|
|
|
|
//SI_CUT_DATE
|
|
|
|
|
if (BCReadInfo.SICutDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.SI_CUT_DATE = BCReadInfo.SICutDate.Value;
|
|
|
|
|
if (!task.SI_CUT_DATE.HasValue || task.SI_CUT_DATE.Value != BCReadInfo.SICutDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"SI_CUT_DATE org={task.SI_CUT_DATE} tar={BCReadInfo.SICutDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.SI_CUT_DATE = BCReadInfo.SICutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"SI_CUT_DATE org={task.SI_CUT_DATE} tar=null");
|
|
|
|
|
|
|
|
|
|
task.SI_CUT_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
//VGM_CUTOFF_TIME
|
|
|
|
|
if (BCReadInfo.VGMCutoffTime.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.VGM_CUTOFF_TIME = BCReadInfo.VGMCutoffTime.Value;
|
|
|
|
|
if (!task.VGM_CUTOFF_TIME.HasValue || task.VGM_CUTOFF_TIME.Value != BCReadInfo.VGMCutoffTime.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"VGM_CUTOFF_TIME org={task.VGM_CUTOFF_TIME} tar={BCReadInfo.VGMCutoffTime.Value}##");
|
|
|
|
|
|
|
|
|
|
task.VGM_CUTOFF_TIME = BCReadInfo.VGMCutoffTime.Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"VGM_CUTOFF_TIME org={task.VGM_CUTOFF_TIME} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.VGM_CUTOFF_TIME = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//MANIFEST_CUT_DATE
|
|
|
|
|
if (BCReadInfo.ManifestCutDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.MANIFEST_CUT_DATE = BCReadInfo.ManifestCutDate.Value;
|
|
|
|
|
if (!task.MANIFEST_CUT_DATE.HasValue || task.MANIFEST_CUT_DATE.Value != BCReadInfo.ManifestCutDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MANIFEST_CUT_DATE org={task.MANIFEST_CUT_DATE} tar={BCReadInfo.ManifestCutDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.MANIFEST_CUT_DATE = BCReadInfo.ManifestCutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MANIFEST_CUT_DATE org={task.MANIFEST_CUT_DATE} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.MANIFEST_CUT_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
//CY_CUTOFF_TIME
|
|
|
|
|
if (BCReadInfo.CYCutoffTime.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.CY_CUTOFF_TIME = BCReadInfo.CYCutoffTime.Value;
|
|
|
|
|
if (!task.MANIFEST_CUT_DATE.HasValue || task.MANIFEST_CUT_DATE.Value != BCReadInfo.CYCutoffTime.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CY_CUTOFF_TIME org={task.CY_CUTOFF_TIME} tar={BCReadInfo.CYCutoffTime.Value}##");
|
|
|
|
|
|
|
|
|
|
task.CY_CUTOFF_TIME = BCReadInfo.CYCutoffTime.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CY_CUTOFF_TIME org={task.CY_CUTOFF_TIME} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.CY_CUTOFF_TIME = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//MDGF_CUT_DATE
|
|
|
|
|
if (BCReadInfo.MDGFCutDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.MDGF_CUT_DATE = BCReadInfo.MDGFCutDate.Value;
|
|
|
|
|
if (!task.MDGF_CUT_DATE.HasValue || task.MDGF_CUT_DATE.Value != BCReadInfo.MDGFCutDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MDGF_CUT_DATE org={task.MDGF_CUT_DATE} tar={BCReadInfo.MDGFCutDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.MDGF_CUT_DATE = BCReadInfo.MDGFCutDate.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"MDGF_CUT_DATE org={task.MDGF_CUT_DATE} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.MDGF_CUT_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
//CLOSING_DATE
|
|
|
|
|
if (BCReadInfo.ClosingDate.HasValue)
|
|
|
|
|
{
|
|
|
|
|
task.CLOSING_DATE = BCReadInfo.ClosingDate.Value;
|
|
|
|
|
if (!task.CLOSING_DATE.HasValue || task.CLOSING_DATE.Value != BCReadInfo.ClosingDate.Value)
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CLOSING_DATE org={task.CLOSING_DATE} tar={BCReadInfo.ClosingDate.Value}##");
|
|
|
|
|
|
|
|
|
|
task.CLOSING_DATE = BCReadInfo.ClosingDate.Value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msgBuilder.Append($"CLOSING_DATE org={task.CLOSING_DATE} tar=null##");
|
|
|
|
|
|
|
|
|
|
task.CLOSING_DATE = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -619,6 +728,9 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
|
|
|
|
|
it.CLOSING_DATE
|
|
|
|
|
}).ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 识别完文件 有变更 结果={msgBuilder.ToString()}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|