修改任务台

master
jianghaiqing 8 months ago
parent bb06fe2bd1
commit e5484906bd

@ -2853,6 +2853,8 @@ namespace Myshipping.Application
} }
} }
slotId = bcTaskInfo.BOOKING_SLOT_ID.Value;
var bcInfo = _taskBaseRepository.AsQueryable().Filter(null, true).Where(a => a.MBL_NO == bcTaskInfo.MBL_NO && a.CARRIER_ID == bcTaskInfo.CARRIERID var bcInfo = _taskBaseRepository.AsQueryable().Filter(null, true).Where(a => a.MBL_NO == bcTaskInfo.MBL_NO && a.CARRIER_ID == bcTaskInfo.CARRIERID
&& a.TASK_TYPE == TaskBaseTypeEnum.BC.ToString() && a.IsDeleted == false && a.TenantId == UserManager.TENANT_ID).First(); && a.TASK_TYPE == TaskBaseTypeEnum.BC.ToString() && a.IsDeleted == false && a.TenantId == UserManager.TENANT_ID).First();

@ -6,6 +6,7 @@ using Furion.FriendlyException;
using Furion.JsonSerialization; using Furion.JsonSerialization;
using Furion.RemoteRequest.Extensions; using Furion.RemoteRequest.Extensions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using ServiceProjectSyncWin; using ServiceProjectSyncWin;
@ -431,7 +432,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
1 1
2 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) .OrderBy(t=>t.CreatedTime)
.ToList(); .ToList();
@ -439,8 +440,8 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
_logger.LogInformation($"批次={batchNo} 提取待处理任务 num={taskList.Count}"); _logger.LogInformation($"批次={batchNo} 提取待处理任务 num={taskList.Count}");
string bcReadUrl = "http://localhost:5110/api/TaskBCParser/ExcuteBCFileRead"; string bcReadUrl = "http://47.104.73.97:7115/api/TaskBCParser/ExcuteBCFileRead";
string amendReadUrl = "http://localhost:5110/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentRead"; string amendReadUrl = "http://47.104.73.97:7115/api/TaskBookingAmendmentParser/ExcuteBookingAmendmentRead";
//foreach (var task in taskList) //foreach (var task in taskList)
for(int i=0;i<taskList.Count;i++) for(int i=0;i<taskList.Count;i++)
@ -462,68 +463,120 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
var bcFileName = Path.GetFileName(bcFileFullPath); 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(); 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)}"); _logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 识别完文件 BCReadInfo={JSON.Serialize(BCReadInfo)}");
StringBuilder msgBuilder = new StringBuilder();
if (BCReadInfo != null) if (BCReadInfo != null)
{ {
//SI_CUT_DATE //SI_CUT_DATE
if (BCReadInfo.SICutDate.HasValue) 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 else
{ {
msgBuilder.Append($"SI_CUT_DATE org={task.SI_CUT_DATE} tar=null");
task.SI_CUT_DATE = null; task.SI_CUT_DATE = null;
} }
//VGM_CUTOFF_TIME //VGM_CUTOFF_TIME
if (BCReadInfo.VGMCutoffTime.HasValue) 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 else
{ {
msgBuilder.Append($"VGM_CUTOFF_TIME org={task.VGM_CUTOFF_TIME} tar=null##");
task.VGM_CUTOFF_TIME = null; task.VGM_CUTOFF_TIME = null;
} }
//MANIFEST_CUT_DATE //MANIFEST_CUT_DATE
if (BCReadInfo.ManifestCutDate.HasValue) 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 else
{ {
msgBuilder.Append($"MANIFEST_CUT_DATE org={task.MANIFEST_CUT_DATE} tar=null##");
task.MANIFEST_CUT_DATE = null; task.MANIFEST_CUT_DATE = null;
} }
//CY_CUTOFF_TIME //CY_CUTOFF_TIME
if (BCReadInfo.CYCutoffTime.HasValue) 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 else
{ {
msgBuilder.Append($"CY_CUTOFF_TIME org={task.CY_CUTOFF_TIME} tar=null##");
task.CY_CUTOFF_TIME = null; task.CY_CUTOFF_TIME = null;
} }
//MDGF_CUT_DATE //MDGF_CUT_DATE
if (BCReadInfo.MDGFCutDate.HasValue) 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 else
{ {
msgBuilder.Append($"MDGF_CUT_DATE org={task.MDGF_CUT_DATE} tar=null##");
task.MDGF_CUT_DATE = null; task.MDGF_CUT_DATE = null;
} }
//CLOSING_DATE //CLOSING_DATE
if (BCReadInfo.ClosingDate.HasValue) 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 else
{ {
msgBuilder.Append($"CLOSING_DATE org={task.CLOSING_DATE} tar=null##");
task.CLOSING_DATE = null; task.CLOSING_DATE = null;
} }
@ -538,6 +591,7 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
}).ExecuteCommand(); }).ExecuteCommand();
} }
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 识别完文件 有变更 结果={msgBuilder.ToString()}");
} }
} }
else if (task.BUSI_TYPE == "BookingAmendment") else if (task.BUSI_TYPE == "BookingAmendment")
@ -550,62 +604,117 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
var bcFileName = Path.GetFileName(bcFileFullPath); 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(); TaskBCInfoReadDto BCReadInfo = GetBCReaderInfo(bcFileFullPath, bcFileName, task.TenantId.Value, task.TASK_ID, amendReadUrl).GetAwaiter().GetResult();
StringBuilder msgBuilder = new StringBuilder();
if (BCReadInfo != null) if (BCReadInfo != null)
{ {
//SI_CUT_DATE //SI_CUT_DATE
if (BCReadInfo.SICutDate.HasValue) 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 else
{ {
msgBuilder.Append($"SI_CUT_DATE org={task.SI_CUT_DATE} tar=null");
task.SI_CUT_DATE = null; task.SI_CUT_DATE = null;
} }
//VGM_CUTOFF_TIME //VGM_CUTOFF_TIME
if (BCReadInfo.VGMCutoffTime.HasValue) 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 else
{ {
msgBuilder.Append($"VGM_CUTOFF_TIME org={task.VGM_CUTOFF_TIME} tar=null##");
task.VGM_CUTOFF_TIME = null; task.VGM_CUTOFF_TIME = null;
} }
//MANIFEST_CUT_DATE //MANIFEST_CUT_DATE
if (BCReadInfo.ManifestCutDate.HasValue) 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 else
{ {
msgBuilder.Append($"MANIFEST_CUT_DATE org={task.MANIFEST_CUT_DATE} tar=null##");
task.MANIFEST_CUT_DATE = null; task.MANIFEST_CUT_DATE = null;
} }
//CY_CUTOFF_TIME //CY_CUTOFF_TIME
if (BCReadInfo.CYCutoffTime.HasValue) 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 else
{ {
msgBuilder.Append($"CY_CUTOFF_TIME org={task.CY_CUTOFF_TIME} tar=null##");
task.CY_CUTOFF_TIME = null; task.CY_CUTOFF_TIME = null;
} }
//MDGF_CUT_DATE //MDGF_CUT_DATE
if (BCReadInfo.MDGFCutDate.HasValue) 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 else
{ {
msgBuilder.Append($"MDGF_CUT_DATE org={task.MDGF_CUT_DATE} tar=null##");
task.MDGF_CUT_DATE = null; task.MDGF_CUT_DATE = null;
} }
//CLOSING_DATE //CLOSING_DATE
if (BCReadInfo.ClosingDate.HasValue) 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 else
{ {
msgBuilder.Append($"CLOSING_DATE org={task.CLOSING_DATE} tar=null##");
task.CLOSING_DATE = null; task.CLOSING_DATE = null;
} }
@ -619,6 +728,9 @@ public class SyncHisRecord: ISyncHisRecord,ITransient
it.CLOSING_DATE it.CLOSING_DATE
}).ExecuteCommand(); }).ExecuteCommand();
} }
_logger.LogInformation($"批次={batchNo} 提取待处理任务 MBLNO={task.MBL_NO} 识别完文件 有变更 结果={msgBuilder.ToString()}");
} }
} }

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<History>True|2023-09-11T12:42:58.0481784Z;True|2023-09-11T20:42:47.7986046+08:00;True|2023-09-04T17:20:02.6360803+08:00;True|2023-09-04T10:10:54.4958128+08:00;</History> <History>True|2024-04-09T05:04:05.3631882Z;True|2024-04-09T13:01:10.1980474+08:00;True|2024-04-09T12:57:25.4926925+08:00;True|2023-09-11T20:42:58.0481784+08:00;True|2023-09-11T20:42:47.7986046+08:00;True|2023-09-04T17:20:02.6360803+08:00;True|2023-09-04T10:10:54.4958128+08:00;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save