From c3877b2ebec19f473f45e8c2245926f65d2a3948 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期三, 10 九月 2025 09:26:23 +0800 Subject: [PATCH] 代码提交 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 89 +++++++++++++++++++++++++++++++++++++------- 1 files changed, 75 insertions(+), 14 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" index db6332d..a1698a9 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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) { @@ -370,7 +431,7 @@ public DtLocationInfo GetLocation() { List<DtLocationInfo> locations = _locationRepository.QueryData(x => x.LocationStatus == (int)LocationEnum.Free); - var location = locations.OrderBy(x => x.Column).ThenBy(x => x.Layer).ThenBy(x => x.Row).FirstOrDefault(); + var location = locations.OrderBy(x => x.Row).ThenBy(x => x.Column).ThenBy(x => x.Layer).FirstOrDefault(); if(location != null) { var task = BaseDal.QueryFirst(x => x.SourceAddress == location.LocationName || x.TargetAddress == location.LocationName); -- Gitblit v1.9.3