huangxiaoqiang
7 天以前 2d5cf3b7ed3be90f1d25d3adda26013cc9575be9
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -113,7 +113,7 @@
                        Dt_StationManager stationManagerStart = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTOs.EndPoint);
                        if (stationManagerStart == null)
                        {
                            return content.Error("未找到出库站台信息");
                            throw new Exception("未找到出库站台信息");
                        }
                        task = new Dt_Task()
                        {
@@ -140,10 +140,10 @@
                        if (taskDTOs.EndPoint == "3004")
                        {
                            var newTask = BaseDal.QueryFirst(x => x.SourceAddress == "3001" && x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState != (int)TaskInStatusEnum.HoistNew && x.TaskState != (int)TaskInStatusEnum.HoistInExecuting && x.TaskState > 225);
                            var newTask = BaseDal.QueryFirst(x => x.SourceAddress == "3002" && x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState != (int)TaskInStatusEnum.HoistNew && x.TaskState != (int)TaskInStatusEnum.HoistInExecuting && x.TaskState > 225);
                            if (newTask != null)
                            {
                                return content.Error("已存在入库任务,出库任务不可下发");
                                throw new Exception("已存在入库任务,出库任务不可下发");
                            }
                        }
@@ -151,7 +151,7 @@
                        Dt_StationManager stationManagerEnd = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTOs.EndPoint);
                        if (stationManagerEnd == null)
                        {
                            return content.Error("未找到出库站台信息");
                            throw new Exception("未找到出库站台信息");
                        }
                        Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == GetScCode(Convert.ToInt32(targetCodes[0])) && x.stationType == 2 && x.stationFloor == stationManagerEnd.stationFloor);
@@ -188,7 +188,7 @@
                        }
                        if(taskDTOs.EndPoint == "1004")
                        {
                            return content.Error("该点位不是出库点位");
                            throw new Exception("该点位不是出库点位");
                        }
                        if (GetScCode(Convert.ToInt32(targetCodes[0])) == "SC06" && taskDTOs.EndPoint == "1002")
                        {
@@ -235,7 +235,7 @@
                        Dt_StationManager stationManagerStart = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTOs.BeginPoint);
                        if (stationManagerStart == null)
                        {
                            return content.Error("未找到出库站台信息");
                            throw new Exception("未找到出库站台信息");
                        }
                        task = new Dt_Task()
                        {
@@ -290,14 +290,14 @@
                            task.TargetStation = stationManager.stationRemark;
                            if (GetScCode(Convert.ToInt32(targetCodes[0])) == "SC01" && (taskDTOs.BeginPoint == "1030" || taskDTOs.EndPoint == "1029"))
                            if ((GetScCode(Convert.ToInt32(targetCodes[0])) == "SC01" && (taskDTOs.BeginPoint == "1030" || taskDTOs.EndPoint == "1029")) || (GetScCode(Convert.ToInt32(targetCodes[0])) == "SC01" && task.RGVName == "RGV02"))
                            {
                                Dt_StationManager stationTransfer = _stationManagerRepository.QueryFirst(x => x.stationChildCode == "1026");
                                task.TargetStation = stationTransfer.stationRemark;
                                task.Remark = "1026";
                            }
                            if (GetScCode(Convert.ToInt32(targetCodes[0])) == "SC06" && (taskDTOs.BeginPoint == "1002" || taskDTOs.BeginPoint == "1004"))
                            if ((GetScCode(Convert.ToInt32(targetCodes[0])) == "SC06" && (taskDTOs.BeginPoint == "1002" || taskDTOs.BeginPoint == "1004")) || (GetScCode(Convert.ToInt32(targetCodes[0])) == "SC06" && task.RGVName == "RGV01"))
                            {
                                Dt_StationManager stationTransfer = _stationManagerRepository.QueryFirst(x => x.stationChildCode == "1026");
                                task.TargetStation = stationTransfer.stationRemark;
@@ -307,7 +307,7 @@
                        }
                        else
                        {
                            return content.Error($"未找到该托盘【{taskDTOs.TPbarcode}】任务");
                            throw new Exception($"未找到该托盘【{taskDTOs.TPbarcode}】任务");
                        }
                    }
                }
@@ -341,7 +341,7 @@
                    Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.SourceAddress);
                    if (stationManager == null)
                    {
                        return content.Error("未找到起点站台");
                        throw new Exception("未找到起点站台");
                    }
                    
                    if (task != null)
@@ -442,11 +442,11 @@
            {
                return "SC04";
            }
            else if (number >= 15 && number <= 18)
            else if (number >= 15 && number <= 17)
            {
                return "SC05";
            }
            else if (number >= 19 && number <= 22)
            else if (number >= 18 && number <= 21)
            {
                return "SC06";
            }
@@ -595,7 +595,7 @@
        /// <returns></returns>
        public Dt_Task QueryRGVExecutingTask(string deviceNo)
        {
            return BaseDal.QueryFirst(x => (x.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish|| x.TaskState == (int)TaskInStatusEnum.RGV_InAwaitWMS|| x.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish) && x.RGVName == deviceNo);
            return BaseDal.QueryFirst(x => (x.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish|| x.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish) && x.RGVName == deviceNo);
        }
        /// <summary>
@@ -606,7 +606,7 @@
        /// <returns></returns>
        public Dt_Task QueryRGVExecutingTask(string deviceNo,int taskNum)
        {
            return BaseDal.QueryFirst(x => (x.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InAwaitWMS) && x.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish && x.RGVName == deviceNo&&x.TaskNum==taskNum);
            return BaseDal.QueryFirst(x => (x.TaskState == (int)TaskInStatusEnum.RGV_IndispatchFinish) && x.TaskState == (int)TaskOutStatusEnum.RGV_OutdispatchFinish && x.RGVName == deviceNo&&x.TaskNum==taskNum);
        }
        /// <summary>
@@ -662,7 +662,7 @@
        public List<Dt_Task> QueryRGVTask()
        {
            return BaseDal.QueryData(x => ((TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew) || (TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.Line_OutFinish) && x.Floor == "1F"), TaskOrderBy);
            return BaseDal.QueryData(x => ((TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew) || (TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.Line_OutFinish)) && x.Floor == "1F", TaskOrderBy);
        }
        /// <summary>