wanshenmean
9 小时以前 f423e1277f91427f0a767bd1224c1260dcb73086
Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Outbound.cs
@@ -1,9 +1,11 @@
using System.Diagnostics;
using WIDESEA_Common.Constants;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
using WIDESEA_DTO.MES;
using WIDESEA_DTO.Task;
using WIDESEA_IBasicService;
@@ -58,6 +60,7 @@
        /// </summary>
        public async Task<WebResponseContent> OutboundFinishTaskAsync(CreateTaskDto taskDto)
        {
            var stopwatch = Stopwatch.StartNew();
            try
            {
                var task = await BaseDal.QueryFirstAsync(s => s.PalletCode == taskDto.PalletCode);
@@ -135,9 +138,21 @@
                        LocalTime = DateTime.Now,
                        ContainerCode = taskDto.PalletCode
                    };
                    string requestJson = outboundRequest.ToJson();
                    var outboundResult = string.IsNullOrWhiteSpace(token)
                        ? _mesService.OutboundInContainer(outboundRequest)
                        : _mesService.OutboundInContainer(outboundRequest, token);
                    stopwatch.Stop();
                    await _mesLogService.LogAsync(new MesApiLogDto
                    {
                        ApiType = "UnbindContainer",
                        RequestJson = requestJson,
                        ResponseJson = System.Text.Json.JsonSerializer.Serialize(outboundResult),
                        IsSuccess = outboundResult.IsSuccess,
                        ErrorMessage = outboundResult.ErrorMessage,
                        ElapsedMs = (int)stopwatch.ElapsedMilliseconds,
                        Creator = "systeam"
                    });
                    if (outboundResult == null || outboundResult.Data == null || !outboundResult.Data.IsSuccess)
                    {
                        return content.Error($"出库完成失败:MES出站失败: {outboundResult?.Data?.Msg ?? outboundResult?.ErrorMessage ?? "未知错误"}");