肖洋
2025-01-04 a07e4702be045efa9b04b49a561463875dd28e0a
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -169,12 +169,19 @@
                        var agingOutputDto = MapToAgingOutputDto(stock);
                        content = await _agingInOrOutInputService.GetOCVOutputAsync(agingOutputDto);
                        var result = JsonConvert.DeserializeObject<BasicResult>(content.Data.ToString());
                        task.Remark = result.Success ? null : "NG";
                        if (!result.Success && result.MessageCode == "E10001")
                        if (content.Status)
                        {
                            await HandleOutBoundError(stock, task);
                            var result = JsonConvert.DeserializeObject<BasicResult>(content.Data.ToString());
                            task.Remark = result.Success ? null : "NG";
                            if (!result.Success && result.MessageCode == "E10001")
                            {
                                await HandleOutBoundError(stock, task);
                            }
                        }
                        else
                        {
                            task.Remark = "NG";
                        }
                    }
                }
@@ -276,7 +283,7 @@
        //task.CurrentAddress = task.NextAddress;
        //task.NextAddress = task.TargetAddress;
        _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery,task.TaskNum);
        _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum);
        LogFactory.GetLog("任务完成").Info(true, "更新库存状态与任务状态");
        return (location, task);
@@ -352,7 +359,7 @@
        try
        {
            // 更新货位和库存信息
           (DtStockInfo updateStock, DtLocationInfo locationInForm, DtLocationInfo locationInfoTo) = UpdateStockLocation(stock, task);
            (DtStockInfo updateStock, DtLocationInfo locationInForm, DtLocationInfo locationInfoTo) = UpdateStockLocation(stock, task);
            var taskHty = CreateHistoricalTask(task);
            LogFactory.GetLog("任务完成").InfoFormat(true, "移库任务完成", $"货位地址:{task.TargetAddress},修改后库存数据:{JsonConvert.SerializeObject(updateStock)},原先货位数据:{locationInForm}");
@@ -560,7 +567,7 @@
            Remark = boxing.BoxingInfoDetails.Count().ToString(),
        };
        if (boxing.ProcessCode != "OCVB" || !task.Roadway.Contains("FR"))
        if (boxing.ProcessCode != "OCVB" && !task.Roadway.Contains("FR"))
        {
            // 处理请求参数
            AgingInputDto agingInputDto = new AgingInputDto()
@@ -959,12 +966,17 @@
            // 创建并获取整盘电芯状态
            TrayCellsStatusDto trayCells = CreateTrayCellsStatusDto(area, input.PalletCode);
            content = await GetTrayCellStatusAsync(trayCells);
            if (!content.Status) return content;
            if (!content.Status)
            {
                ConsoleHelper.WriteErrorLine($"获取电芯状态失败:{content.Message}");
                return content;
            }
            var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString());
            if (!result.Success)
            {
                ConsoleHelper.WriteErrorLine($"获取电芯状态失败:{result.MOMMessage}");
                if (result.SerialNos.Count <= 0)
                {
                    // 空托盘入库逻辑
@@ -982,17 +994,27 @@
                    return content.Error(result.MOMMessage);
            }
            // 处理异常电芯情况
            var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
            if (serialNosError.Count > 0)
            if (result.SerialNos.Count <= 0)
            {
                return await HandleErrorCells(input, area, serialNosError);
                return await RequestTrayInTaskAsync(input);
            }
            else
            {
            var boxing = CreateBoxingInfo(result, input.PalletCode);
            if (boxing == null) return content.Error("组盘失败");
            return await ProcessBasedOnProcessCode(boxing, area, input, result);
                // 处理异常电芯情况
                var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
                if (serialNosError.Count > 0)
                {
                    return await HandleErrorCells(input, area, serialNosError);
                }
                var boxing = CreateBoxingInfo(result, input.PalletCode);
                if (boxing == null) return content.Error("组盘失败");
                return await ProcessBasedOnProcessCode(boxing, area, input, result);
            }
        }
        catch (Exception err)
        {