From 22cc8cacc4f4fc3c880d42862e5e2644ca172716 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Fri, 16 Aug 2024 15:13:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/TaskFlowDataNameConst.cs | 2 +- .../TaskPlat/Method/TaskManageBCService.cs | 28 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs index 8ccd5643..dc900d43 100644 --- a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs @@ -41,7 +41,7 @@ namespace DS.Module.Core /// BC对比订单后是否存在差异 /// /// 类型: - public const string BcCompareBcWithSeaExportIsExistsDiff = "BcCompareBcWithSeaExportIsExistsDiff"; + public const string BcCompareWithSeaExportResult = "BcCompareWithSeaExportResult"; /// /// BC文件 diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs index 5a5b0c5e..6cc08fe0 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs @@ -1136,7 +1136,7 @@ namespace DS.WMS.Core.TaskPlat.Method /// /// 对比BC与海运出口订单(任务台使用) /// - public async Task)>> CompareBcWithSeaExportTask(TaskFlowDataContext dataContext) + public async Task> CompareBcWithSeaExportTask(TaskFlowDataContext dataContext) { var taskBcInfo = dataContext.Get(TaskFlowDataNameConst.TaskBCInfo) ?? throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskBCInfo)}"); var taskBcCtnList = dataContext.Get?>(TaskFlowDataNameConst.TaskBCCtnList) ?? throw new ArgumentException($"缺少参数:{nameof(TaskFlowDataNameConst.TaskBCCtnList)}"); @@ -1174,18 +1174,19 @@ namespace DS.WMS.Core.TaskPlat.Method SeaExport = seaExport, OpCtnList = seaExportCtnList }; - (bool isExistsDiff, List) result = await CompareBcWithSeaExport(compareDto); + var result = await CompareBcWithSeaExport(compareDto); - dataContext.Set(TaskFlowDataNameConst.BcCompareBcWithSeaExportIsExistsDiff, result.isExistsDiff); + dataContext.Set(TaskFlowDataNameConst.BcCompareWithSeaExportResult, result); - return DataResult<(bool isExistsDiff, List)>.Success(result); + return DataResult.Success(result); } /// /// 对比BC与海运出口订单 /// - public async Task<(bool isExistsDiff, List)> CompareBcWithSeaExport(CompareBcWithSeaExportDto compareDto) + public async Task CompareBcWithSeaExport(CompareBcWithSeaExportDto compareDto) { + var taskBcInfo = compareDto.TaskBCInfo; var taskBcCtnList = compareDto.TaskBCCtnList; var seaExport = compareDto.SeaExport; @@ -1257,7 +1258,7 @@ namespace DS.WMS.Core.TaskPlat.Method logger.LogInformation($"批次={batchNo} taskBcInfo.id={taskBcInfo.Id} seaExport.id={seaExport.Id} 请求BC对比订单结果完成,耗时:{timeDiff}ms,是否成功:{(compareResult?.succ == true ? "成功" : "失败")} "); - if (compareResult != null) + if (compareResult != null && compareResult?.succ == true) { logger.LogInformation($"批次={batchNo} BC对比订单结果={JsonConvert.SerializeObject(compareResult)}"); DateTime nowDate = DateTime.Now; @@ -1303,13 +1304,22 @@ namespace DS.WMS.Core.TaskPlat.Method it.UpdateUserName }).ExecuteCommandAsync(); } - - return (compareResult.extra.IsExistsDiff, compareResult.extra.ShowDetailList); + return new CompareResultInfo() + { + IsExistsDiff = compareResult.extra.IsExistsDiff, + ShowDetailList = compareResult.extra.ShowDetailList, + DetailList = compareResult.extra.DetailList, + IsSuccess = true + }; + //return (compareResult.extra.IsExistsDiff, compareResult.extra.ShowDetailList); } else { logger.LogError($"批次={batchNo} BC对比订单结果为空"); - throw new Exception($"批次={batchNo} BC对比订单结果为空"); + return new CompareResultInfo() + { + IsSuccess = false + }; } }