From 855813477525f7a40feec686a5cf971ed895c371 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 31 Jul 2024 19:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AF=94=E5=AF=B9=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/ITaskManageBCService.cs | 8 +++++ .../TaskPlat/Method/TaskManageBCService.cs | 34 +++++++++++++++++++ .../Controllers/TaskManageBCController.cs | 15 ++++++++ 3 files changed, 57 insertions(+) diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs index c7e2a786..1e87f3f9 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs @@ -1,5 +1,6 @@ using DS.Module.Core; using DS.Module.DjyServiceStatus; +using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.TaskPlat.Dtos; using Microsoft.AspNetCore.Http; @@ -19,5 +20,12 @@ namespace DS.WMS.Core.TaskPlat.Interface /// /// BC任务主键 Task> GetInfoByTaskId(long taskId); + + /// + /// 获取当前比对结果 + /// + /// BC任务主键 + /// 返回回执 + Task>> GetCompareResult(long taskId); } } 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 529d31be..e4c95f61 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs @@ -11,6 +11,7 @@ using DS.WMS.Core.Map.Interface; using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Interface; +using DS.WMS.Core.Op.Method; using DS.WMS.Core.Sys.Interface; using DS.WMS.Core.TaskPlat.Dtos; using DS.WMS.Core.TaskPlat.Entity; @@ -20,6 +21,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Newtonsoft.Json; +using NPOI.XWPF.UserModel; using SqlSugar; namespace DS.WMS.Core.TaskPlat.Method @@ -1169,5 +1171,37 @@ namespace DS.WMS.Core.TaskPlat.Method } #endregion + #region 获取当前比对结果 + /// + /// 获取当前比对结果 + /// + /// BC任务主键 + /// 返回回执 + public async Task>> GetCompareResult(long taskId) + { + var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId); + + var queryList = await tenantDb.Queryable() + .InnerJoin((a, b) => a.Id == b.TASK_ID) + .Where((a, b) => a.Id == taskId) + .Select((a, b) => new { Base = a, BC = b }) + .ToListAsync(); + + //任务主键{taskPkId}无法获取业务信息 + if (queryList.Count == 0) + throw new Exception(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.TaskBaseInfoFromTaskIdNull)), taskId)); + + var taskBCInfo = queryList.FirstOrDefault().BC; + + if (taskBCInfo.BOOKING_SLOT_ID.HasValue) + { + return await bookingSlotService.Value.GetSlotCompareResult(taskBCInfo.BOOKING_SLOT_ID.Value, taskBCInfo.BATCH_NO); + } + else + { + return DataResult>.FailedData(new List()); + } + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs index 3722e186..67ddd8b7 100644 --- a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs +++ b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskManageBCController.cs @@ -1,9 +1,11 @@ using DS.Module.Core; using DS.Module.DjyServiceStatus; +using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.TaskPlat.Dtos; using DS.WMS.Core.TaskPlat.Interface; using DS.WMS.Core.TaskPlat.Method; using Microsoft.AspNetCore.Mvc; +using Microsoft.Owin.Security.Provider; namespace DS.WMS.TaskApi.Controllers { @@ -39,5 +41,18 @@ namespace DS.WMS.TaskApi.Controllers var result = await _taskManageBCService.CreateBookingAndSlot(model); return result; } + + #region 获取当前比对结果 + /// + /// 获取当前比对结果 + /// + /// BC任务主键 + /// 返回回执 + [HttpGet("GetCompareResult")] + public async Task>> GetCompareResult(long taskId) + { + return await _taskManageBCService.GetCompareResult(taskId); + } + #endregion } }