huangxiaoqiang
2025-05-10 a982b8c9f5922684216cbc307a8507a627dde8d0
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -237,38 +237,38 @@
            }
            // 处理异常电芯情况
            var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
            if (serialNosError.Count > 0)
            {
                if (stationManager.stationType != 3)
                {
                    var taskNG = new Dt_Task
                    {
                        CurrentAddress = input.Position,
                        Grade = 1,
                        Roadway = input.Roadways,
                        TargetAddress = stationManager.stationNGLocation,
                        Dispatchertime = DateTime.Now,
                        MaterialNo = "",
                        NextAddress = stationManager.stationNGChildCode,
                        OrderNo = null,
                        PalletCode = input.PalletCode,
                        SourceAddress = stationManager.stationLocation,
                        TaskState = (int)TaskInStatusEnum.Line_InFinish,
                        TaskType = (int)TaskOutboundTypeEnum.InToOut,
                        TaskNum = await BaseDal.GetTaskNo(),
                        Creater = "System",
                        ProductionLine = result.ProductionLine,
                        ProcessCode = result.ProcessCode,
                    };
                    return taskNG;
                }
                else
                {
                    Console.WriteLine($"站台{stationManager.stationChildCode}MOM返回电芯异常:{result.MOMMessage}");
                    return null;
                }
            }
            //var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
            //if (serialNosError.Count > 0)
            //{
            //    if (stationManager.stationType != 3)
            //    {
            //        var taskNG = new Dt_Task
            //        {
            //            CurrentAddress = input.Position,
            //            Grade = 1,
            //            Roadway = input.Roadways,
            //            TargetAddress = stationManager.stationNGLocation,
            //            Dispatchertime = DateTime.Now,
            //            MaterialNo = "",
            //            NextAddress = stationManager.stationNGChildCode,
            //            OrderNo = null,
            //            PalletCode = input.PalletCode,
            //            SourceAddress = stationManager.stationLocation,
            //            TaskState = (int)TaskInStatusEnum.Line_InFinish,
            //            TaskType = (int)TaskOutboundTypeEnum.InToOut,
            //            TaskNum = await BaseDal.GetTaskNo(),
            //            Creater = "System",
            //            ProductionLine = result.ProductionLine,
            //            ProcessCode = result.ProcessCode,
            //        };
            //        return taskNG;
            //    }
            //    else
            //    {
            //        Console.WriteLine($"站台{stationManager.stationChildCode}MOM返回电芯异常:{result.MOMMessage}");
            //        return null;
            //    }
            //}
            //else
            //{
            //    throw new Exception($"站台{stationManager.stationChildCode}MOM返回电芯异常:{result.MOMMessage}");
@@ -1043,7 +1043,8 @@
                .Where(x => x.DeviceCode.Contains("CWSC")) // 过滤条件
                .ToList().Select(x => x.DeviceCode).ToList();
            var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
            //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
            var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList();
            List<string>? materielCodes = outBoundMateriel.Count != 0
                ? outBoundMateriel.Where(x => x.ProductionLine == station.productLine && x.ProcessCode == "CWSC3")
                                  .Select(x => x.MaterielCode)