1
dengjunjie
2025-03-18 9f225bb1f1e26d25c1652d3e1ec2a8f239f69615
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -86,7 +86,7 @@
                {
                    if (BaseDal.QueryFirst(x => x.TaskNum == item.TaskNum || x.PalletCode == item.PalletCode) != null)
                    {
                        continue;
                        throw new Exception($"任务号【{item.TaskNum}已存在任务】");
                    }
                    Dt_Task task = _mapper.Map<Dt_Task>(item);
                    task.Creater = "WMS";
@@ -96,7 +96,8 @@
                        //暂不考虑多路径
                        if (routers.Count > 0)
                        {
                            task.TaskState = (int)TaskOutStatusEnum.OutNew;
                            task.TaskState = item.SourceIsPickPlace ? TaskOutStatusEnum.Car_OutFinish.ObjToInt() : TaskOutStatusEnum.OutNew.ObjToInt();
                            task.CurrentAddress = item.SourceAddress;
                            task.NextAddress = routers.FirstOrDefault().ChildPosi;
                        }
@@ -107,7 +108,8 @@
                        //暂不考虑多路径
                        if (routers.Count > 0)
                        {
                            task.TaskState = (int)TaskInStatusEnum.InNew;
                            if (task.TaskType != TaskInboundTypeEnum.PalletInbound.ObjToInt())
                                task.TaskState = (int)TaskInStatusEnum.InNew;
                            task.CurrentAddress = item.SourceAddress;
                            task.NextAddress = routers.FirstOrDefault().ChildPosi;
                        }
@@ -215,9 +217,9 @@
            Dt_Task task = null;
            List<Dt_Task> tasks = new List<Dt_Task>();
            if (string.IsNullOrEmpty(currentAddress))
                tasks = BaseDal.QueryData(x => x.Roadway == deviceNo && TaskRelocationTypes.Contains(x.TaskType) && x.TaskState < TaskRelocationStatusEnum.SC_RelocationExecuting.ObjToInt()).OrderBy(x => x.TaskNum).ToList();
                tasks = BaseDal.QueryData(x => x.Roadway == deviceNo && TaskRelocationTypes.Contains(x.TaskType) && x.TaskState < TaskRelocationStatusEnum.SC_RelocationFinish.ObjToInt()).OrderBy(x => x.TaskNum).ToList();
            else
                tasks = BaseDal.QueryData(x => x.Roadway == deviceNo && x.CurrentAddress == currentAddress && TaskRelocationTypes.Contains(x.TaskType) && x.TaskState < TaskRelocationStatusEnum.SC_RelocationExecuting.ObjToInt()).OrderBy(x => x.TaskNum).ToList();
                tasks = BaseDal.QueryData(x => x.Roadway == deviceNo && x.CurrentAddress == currentAddress && TaskRelocationTypes.Contains(x.TaskType) && x.TaskState < TaskRelocationStatusEnum.SC_RelocationFinish.ObjToInt()).OrderBy(x => x.TaskNum).ToList();
            if (tasks != null && tasks.Count > 0)
            {
                task = tasks.First();
@@ -394,9 +396,10 @@
                        return content = WebResponseContent.Instance.Error($"该任务状态不可跳转到下一步,任务号:【{task.TaskNum}】,任务状态:【{task.TaskState}】");
                    }
                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskRelocationStatusEnum>();
                    task.TaskState = nextStatus;
                    if (task.SourceIsPickPlace && task.TaskState == TaskRelocationStatusEnum.RelocationNew.ObjToInt())
                        task.TaskState = TaskRelocationStatusEnum.SC_RelocationExecuting.ObjToInt();
                    else
                        task.TaskState = nextStatus;
                }
                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup)//库内移车
                {