diff --git a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs index b2a4e7c8..543faac8 100644 --- a/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/TaskFlowDataNameConst.cs @@ -40,8 +40,8 @@ namespace DS.Module.Core /// /// BC对比订单后是否存在差异 /// - /// 类型:CompareResultInfo - public const string BcCompareWithSeaExportResult = "BcCompareWithSeaExportResult"; + /// 类型: + public const string BcCompareBcWithSeaExportIsExistsDiff = "BcCompareBcWithSeaExportIsExistsDiff"; /// /// 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 fa981b49..9fae4037 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs @@ -1136,12 +1136,12 @@ 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)}"); - var seaExport = await tenantDb.Queryable().Where(x => x.ParentId == 0 && taskBcInfo.MBL_NO == x.MBLNO).Select(x => new SeaExport() + var seaExport = await tenantDb.Queryable().Where(x => x.Id == taskBcInfo.BOOKING_ORDER_ID).Select(x => new SeaExport() { Id = x.Id, MBLNO = x.MBLNO, @@ -1174,19 +1174,18 @@ namespace DS.WMS.Core.TaskPlat.Method SeaExport = seaExport, OpCtnList = seaExportCtnList }; - var result = await CompareBcWithSeaExport(compareDto); + (bool isExistsDiff, List) result = await CompareBcWithSeaExport(compareDto); - dataContext.Set(TaskFlowDataNameConst.BcCompareWithSeaExportResult, result); + dataContext.Set(TaskFlowDataNameConst.BcCompareBcWithSeaExportIsExistsDiff, result.isExistsDiff); - return DataResult.Success(result); + return DataResult<(bool isExistsDiff, List)>.Success(result); } /// /// 对比BC与海运出口订单 /// - public async Task CompareBcWithSeaExport(CompareBcWithSeaExportDto compareDto) + public async Task<(bool isExistsDiff, List)> CompareBcWithSeaExport(CompareBcWithSeaExportDto compareDto) { - var taskBcInfo = compareDto.TaskBCInfo; var taskBcCtnList = compareDto.TaskBCCtnList; var seaExport = compareDto.SeaExport; @@ -1258,7 +1257,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 && compareResult?.succ == true) + if (compareResult != null) { logger.LogInformation($"批次={batchNo} BC对比订单结果={JsonConvert.SerializeObject(compareResult)}"); DateTime nowDate = DateTime.Now; @@ -1304,22 +1303,13 @@ namespace DS.WMS.Core.TaskPlat.Method it.UpdateUserName }).ExecuteCommandAsync(); } - return new CompareResultInfo() - { - IsExistsDiff = compareResult.extra.IsExistsDiff, - ShowDetailList = compareResult.extra.ShowDetailList, - DetailList = compareResult.extra.DetailList, - IsSuccess = true - }; - //return (compareResult.extra.IsExistsDiff, compareResult.extra.ShowDetailList); + + return (compareResult.extra.IsExistsDiff, compareResult.extra.ShowDetailList); } else { logger.LogError($"批次={batchNo} BC对比订单结果为空"); - return new CompareResultInfo() - { - IsSuccess = false - }; + throw new Exception($"批次={batchNo} BC对比订单结果为空"); } } #region 生成并推送邮件