From e8323315b683a76509b9c1ecc717bb5b6a9ee08a Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期二, 14 四月 2026 18:07:04 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShengZhiNeng/GaoPuLiTiKu

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs |   45 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 38 insertions(+), 7 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs"
index bc292cc..4ad2f40 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs"
@@ -34,6 +34,10 @@
             try
             {
                 Dt_HKLocationInfo? hKLocationInfo = null;
+                if (taskType==(int)TaskTypeEnum.STURR)
+                {
+                    var reslut=_stationInfo.Repository.QueryFirst(x=>x.StationCode==taskDTO.fromLocationCode) ?? throw new Exception($"鏈壘鍒拌捣鐐硅揣浣嶃�恵taskDTO.fromLocationCode}銆�");
+                }
                 #region 鐐瑰埌鐐�
                 if (!string.IsNullOrEmpty(taskDTO.toLocationCode))
                 {
@@ -44,14 +48,14 @@
                 //鑾峰彇璐т綅淇℃伅
                 else
                     hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
-                if (taskType==(int)TaskTypeEnum.Q1TSJ4)
+                if (taskType == (int)TaskTypeEnum.Q1TSJ4)
                 {
                     var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
                     if (device.IsConnected)
                     {
                         var reslu = device.GetValue<HoistEnum, string>(HoistEnum.Emptycontainernumber);
                         var result = reslu?.TrimEnd('\0')?.Substring(2);
-                        if (reslu== taskDTO.containerCode&&result!=null)
+                        if (reslu == taskDTO.containerCode && result != null)
                         {
                             throw new Exception($"褰撳墠鐨勬枡绠卞彿涓簕reslu}涓巤taskDTO.containerCode}鏂欑鍙蜂笉鍖归厤");
                         }
@@ -126,12 +130,20 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
+                //4妤煎簱鍐呭埌鎻愬崌鏈�
                 Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"鏈壘鍒拌捣鐐瑰簱浣嶃�恵taskDTO.fromLocationCode}銆戯紒");
                 if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"璧风偣搴撲綅銆恵taskDTO.fromLocationCode}銆戝綋鍓嶅簱浣嶇姸鎬佷笉鍙嚭搴擄紒");
                 if (hKLocationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"璧风偣搴撲綅銆恵taskDTO.fromLocationCode}銆戠粦瀹氭枡绠卞彿銆恵hKLocationInfo.PalletCode}銆戜笌浠诲姟鏂欑鍙枫�恵taskDTO.containerCode}銆戜笉鍖归厤锛�");
-                //搴撳唴鍒板簱澶栫殑鐐瑰埌鐐逛换鍔★紝鏄惁闇�瑕佸垽鏂揣浣嶇姸鎬侊紵
-
-                Dt_Task dt_Task = new Dt_Task()
+                //搴撳唴鍒扮幇杈圭殑鐐瑰埌鐐逛换鍔★紝鏄惁闇�瑕佸垽鏂揣浣嶇姸鎬侊紵
+                if (taskType == (int)TaskTypeEnum.STU0003)
+                {
+                    var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"鏈壘鍒扮粓鐐硅揣浣嶃�恵taskDTO.toLocationCode}銆�");
+                    if (reslut.StationStatus != (int)LocationStatusEnum.Free)
+                    {
+                        throw new Exception($"缁堢偣绔欏彴銆恵taskDTO.toLocationCode}銆戠姸鎬佷笉涓虹┖闂诧紒");
+                    }
+                }
+                    Dt_Task dt_Task = new Dt_Task()
                 {
                     TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                     WMSTaskNum = taskDTO.taskCode,
@@ -246,8 +258,7 @@
                 hIKROBOTTaskSubmit.initPriority = task.Grade;
                 hIKROBOTTaskSubmit.robotTaskCode = task.WMSTaskNum;
                 hIKROBOTTaskSubmit.taskType = tasktype.ToString(); ExtraDto extraDto = new ExtraDto();
-                if (task.TaskType != (int)TaskTypeEnum.MOVE &&task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK &&
-                    task.TaskType != (int)TaskTypeEnum.F01)
+                if (task.TaskType != (int)TaskTypeEnum.MOVE && task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK && task.TaskType != (int)TaskTypeEnum.F01)
                 {
                     CarrierInfoDto carrierInfoDto = new CarrierInfoDto()
                     {
@@ -353,6 +364,26 @@
                             hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
                         }
                         break;
+                    case TaskTypeEnum.STUPTBY:
+                        {
+                            TargetRouteDto target = new TargetRouteDto()
+                            {
+                                code = task.CurrentAddress,
+                                operation = "DELIVERY",//鍙栬揣
+                                seq = 0,
+                                type = "STORAGE",
+                            };
+                            TargetRouteDto targetRoute = new TargetRouteDto()
+                            {
+                                code = task.NextAddress,
+                                operation = "DELIVERY",//閫佽揣
+                                seq = 1,
+                                type = "STORAGE",
+                            };
+                            hIKROBOTTaskSubmit.targetRoute.Add(target);
+                            hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
+                        }
+                        break;
                     case TaskTypeEnum.CPMoveInventory:
                         break;
                     default:

--
Gitblit v1.9.3