huangxiaoqiang
3 天以前 74d731cd8ac6bd995fbda485ee3371300af29a74
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -205,20 +205,52 @@
            Dt_StationManager station;
            if (stationOut.WorkstationO == "0")
            {
                var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::1");
                if (hasTaskOne == null)
                {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::1" && x.stationType == 2);
            }
            else if (stationOut.WorkstationT == "0")
                else
                {
                    if (stationOut.WorkstationT == "0")
                    {
                        var hasTaskTwo = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2");
                        if (hasTaskTwo == null)
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2);
            }
            else
            {
                            return content.Error("未找到可用站台,请查看站台是否存在任务");
                        }
                    }
                    else
                    {
                return content.Error("出库站台状态不是空闲,请确认再下发出库任务");
            }
            if (station == null)
            {
                return content.Error("未找到出库站台信息");
            }
            }
            else if (stationOut.WorkstationT == "0")
            {
                var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2");
                if (hasTaskOne == null)
                {
                    station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2);
                }
                else
                {
                    return content.Error("未找到可用站台,请查看站台是否存在任务");
                }
            }
            else
            {
                return content.Error("出库站台状态不是空闲,请确认再下发出库任务");
            }
            //if (station == null)
            //{
            //    return content.Error("未找到出库站台信息");
            //}
            Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == taskDTO.PalletCode);
            if (task != null)
@@ -272,22 +304,67 @@
                return content.Error("获取出库站台信息失败,请重新出库");
            }
            Dt_StationManager station;
            //if (stationOut.WorkstationO == "0")
            //{
            //    station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::1" && x.stationType == 1);
            //}
            //else if (stationOut.WorkstationT == "0")
            //{
            //    station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::2" && x.stationType == 1);
            //}
            //else
            //{
            //    return content.Error("出库站台状态不是空闲,请确认再下发出库任务");
            //}
            //if (station == null)
            //{
            //    return content.Error("未找到出库站台信息");
            //}
            if (stationOut.WorkstationO == "0")
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::1" && x.stationType == 1);
            }
            else if (stationOut.WorkstationT == "0")
                var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::1");
                if (hasTaskOne == null)
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::2" && x.stationType == 1);
                    station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::1" && x.stationType == 2);
                }
                else
                {
                    if (stationOut.WorkstationT == "0")
                    {
                        var hasTaskTwo = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2");
                        if (hasTaskTwo == null)
                        {
                            station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2);
                        }
                        else
                        {
                            return content.Error("未找到可用站台,请查看站台是否存在任务");
                        }
            }
            else
            {
                return content.Error("出库站台状态不是空闲,请确认再下发出库任务");
            }
            if (station == null)
            {
                return content.Error("未找到出库站台信息");
            }
            }
            else if (stationOut.WorkstationT == "0")
            {
                var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2");
                if (hasTaskOne == null)
                {
                    station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2);
                }
                else
                {
                    return content.Error("未找到可用站台,请查看站台是否存在任务");
                }
            }
            else
            {
                return content.Error("出库站台状态不是空闲,请确认再下发出库任务");
            }
            var stock = _stockInfoRepository.QueryFirst(x => x.LocationCode == taskDTO.SourceAddress);
            if (stock == null)
            {