huangxiaoqiang
6 天以前 c3877b2ebec19f473f45e8c2245926f65d2a3948
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -205,20 +205,52 @@
            Dt_StationManager station;
            if (stationOut.WorkstationO == "0")
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::1" && x.stationType == 2);
                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")
                    {
                        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("出库站台状态不是空闲,请确认再下发出库任务");
                    }
                }
            }
            else if (stationOut.WorkstationT == "0")
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2);
                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("未找到出库站台信息");
            }
            //if (station == null)
            //{
            //    return content.Error("未找到出库站台信息");
            //}
            Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == taskDTO.PalletCode);
            if (task != null)
@@ -266,7 +298,7 @@
        try
        {
            StationStatus stationOut = _stationManagerService.GetStationStatus("B002");
            StationStatus stationOut = _stationManagerService.GetStationStatus("B001");
            if (stationOut == null)
            {
                return content.Error("获取出库站台信息失败,请重新出库");
@@ -274,20 +306,49 @@
            Dt_StationManager station;
            if (stationOut.WorkstationO == "0")
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::1" && x.stationType == 1);
                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")
                    {
                        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("出库站台状态不是空闲,请确认再下发出库任务");
                    }
                }
            }
            else if (stationOut.WorkstationT == "0")
            {
                station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::2" && x.stationType == 1);
                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("未找到出库站台信息");
            }
            var stock = _stockInfoRepository.QueryFirst(x => x.LocationCode == taskDTO.SourceAddress);
            if (stock == null)
            {