xxyy
2025-02-15 abff6261e5e74ff16a844f4739f84d49b6133000
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -1,4 +1,5 @@
using Masuit.Tools;
using WIDESEA_Common;
using WIDESEA_Common.CustomModels;
//using WIDESEA_Common.CustomModels;
@@ -200,7 +201,8 @@
                    TaskType = (int)TaskOutboundTypeEnum.InToOut,
                    TaskNum = await BaseDal.GetTaskNo(),
                    Creater = "Systeam",
                    ProductionLine = result.ProductionLine
                    ProductionLine = result.ProductionLine,
                    ProcessCode = result.ProcessCode,
                };
                return taskNG;
            }
@@ -258,7 +260,8 @@
                        TaskType = (int)TaskOutboundTypeEnum.InToOut,
                        TaskNum = await BaseDal.GetTaskNo(),
                        Creater = "Systeam",
                        ProductionLine = result.ProductionLine
                        ProductionLine = result.ProductionLine,
                        ProcessCode = result.ProcessCode,
                    };
                    return taskNG;
                }
@@ -291,7 +294,8 @@
                TaskType = (int)TaskOutboundTypeEnum.InToOut,
                TaskNum = await BaseDal.GetTaskNo(),
                Creater = "Systeam",
                ProductionLine = result.ProductionLine
                ProductionLine = result.ProductionLine,
                ProcessCode = result.ProcessCode,
            };
            return task;
        }
@@ -368,7 +372,8 @@
                    TaskType = (int)TaskOutboundTypeEnum.InToOut,
                    TaskNum = await BaseDal.GetTaskNo(),
                    Creater = "Systeam",
                    ProductionLine = result.ProductionLine
                    ProductionLine = result.ProductionLine,
                    ProcessCode = result.ProcessCode,
                };
                return taskNG;
            }
@@ -418,6 +423,7 @@
            TaskNum = await BaseDal.GetTaskNo(),
            Creater = "Systeam",
            ProductionLine = result.ProductionLine,
            ProcessCode = result.ProcessCode,
        };
        int lastStatus = locationInfo.LocationStatus;
        ConsoleHelper.WriteSuccessLine($"修改前:" + lastStatus.ToString());
@@ -653,6 +659,7 @@
                    TaskNum = await BaseDal.GetTaskNo(),
                    Creater = "Systeam",
                    ProductionLine = result.ProductionLine,
                    ProcessCode = result.ProcessCode,
                };
                return Epmtytask;
            }
@@ -714,6 +721,7 @@
                TaskNum = await BaseDal.GetTaskNo(),
                Creater = "Systeam",
                ProductionLine = result.ProductionLine,
                ProcessCode = result.ProcessCode,
            };
            var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing);
@@ -872,7 +880,7 @@
        WebResponseContent content = new WebResponseContent();
        try
        {
            var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTO.Position);
            var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTO.Position && x.stationStatus == "1");
            var locations = _locationRepository.QueryData(x => x.RoadwayNo == station.Roadway && x.LocationStatus == (int)LocationEnum.Free && x.LocationType == 1);
            if (locations.Count > 10)
@@ -1002,6 +1010,7 @@
                TaskNum = await BaseDal.GetTaskNo(),
                Creater = "Systeam",
                ProductionLine = stockInfo.ProductionLine,
                ProcessCode = stockInfo.ProcessCode,
            };
            WMSTaskDTO taskDTO = CreateTaskDTO(task);
@@ -1145,4 +1154,43 @@
    }
    #endregion
    #region 分容空框入库改为直接出库
    public async Task<WebResponseContent> SetEmptyOutbyInToOutAsync(RequestTaskDto request)
    {
        WebResponseContent content = new WebResponseContent();
        var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode && x.CurrentAddress == request.Position);
        if (!task.IsNullOrEmpty())
        {
            var fromStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == request.Position);
            var toStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == fromStation.productLine && x.stationArea == fromStation.stationArea);
            if (!toStation.IsNullOrEmpty())
            {
                task.TargetAddress = toStation.stationLocation;
                task.NextAddress = toStation.stationChildCode;
                task.Grade = 3;
                task.TaskType = (int)TaskOutboundTypeEnum.InToOut;
                var location = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress);
                location.LocationStatus = (int)LocationEnum.Free;
                await _locationRepository.UpdateDataAsync(location);
                await BaseDal.UpdateDataAsync(task);
                return content.OK("成功");
            }
            else
            {
                ConsoleHelper.WriteErrorLine("分容空框入库改为直接出库:未找到对应站台");
                content.Error("未找到对应站台");
            }
        }
        else
        {
            ConsoleHelper.WriteErrorLine("分容空框入库改为直接出库:未找到任务");
            content.Error("未找到任务");
        }
        return content;
    }
    #endregion
}