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 |   75 ++++++++++++++++++++++++++++++++-----
 1 files changed, 65 insertions(+), 10 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 6aec781..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"
@@ -14,6 +14,7 @@
 using WIDESEAWCS_DTO.AGV.HIKROBOT;
 using System.Diagnostics.CodeAnalysis;
 using System.Reflection.PortableExecutable;
+using WIDESEAWCS_QuartzJob;
 
 namespace WIDESEAWCS_TaskInfoService
 {
@@ -33,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))
                 {
@@ -43,6 +48,23 @@
                 //鑾峰彇璐т綅淇℃伅
                 else
                     hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"鏈壘鍒扮粓鐐瑰簱鍖恒�恵taskDTO.toAreaCode}銆戝彲鐢ㄧ┖璐т綅锛�");
+                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)
+                        {
+                            throw new Exception($"褰撳墠鐨勬枡绠卞彿涓簕reslu}涓巤taskDTO.containerCode}鏂欑鍙蜂笉鍖归厤");
+                        }
+                    }
+                    else
+                    {
+                        throw new Exception("鎻愬崌鏈轰俊鎭澶囪繛鎺ュけ璐�");
+                    }
+                }
                 Dt_Task dt_Task = new Dt_Task()
                 {
                     TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -108,10 +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,
@@ -226,21 +258,22 @@
                 hIKROBOTTaskSubmit.initPriority = task.Grade;
                 hIKROBOTTaskSubmit.robotTaskCode = task.WMSTaskNum;
                 hIKROBOTTaskSubmit.taskType = tasktype.ToString(); ExtraDto extraDto = new ExtraDto();
-                CarrierInfoDto carrierInfoDto = new CarrierInfoDto()
+                if (task.TaskType != (int)TaskTypeEnum.MOVE && task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK && task.TaskType != (int)TaskTypeEnum.F01)
                 {
-                    carrierCode = task.PalletCode,
-                    carrierType = task.PalletCode.Contains("LXM") ? "DX" : "SX"
-                };
-                extraDto.carrierInfo.Add(carrierInfoDto);
-                hIKROBOTTaskSubmit.extra = extraDto;
+                    CarrierInfoDto carrierInfoDto = new CarrierInfoDto()
+                    {
+                        carrierCode = task.PalletCode,
+                        carrierType = task.PalletCode.Contains("LXM") ? "DX" : "SX"
+                    };
+                    extraDto.carrierInfo.Add(carrierInfoDto);
+                    hIKROBOTTaskSubmit.extra = extraDto;
+                }
                 switch (tasktype)
                 {
                     case TaskTypeEnum.CPInbound:
                     case TaskTypeEnum.CPOutbound:
                     case TaskTypeEnum.MLInbound:
                     case TaskTypeEnum.MLOutbound:
-                        break;
-                    case TaskTypeEnum.F01:
                         break;
                     case TaskTypeEnum.RK3F:
                     case TaskTypeEnum.CK3F:
@@ -266,6 +299,7 @@
                             hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
                         }
                         break;
+                    case TaskTypeEnum.STURR:
                     case TaskTypeEnum.Q1TSJ4:
                         {
                             TargetRouteDto target = new TargetRouteDto()
@@ -309,7 +343,8 @@
                         break;
                     case TaskTypeEnum.Q3RK:
                     case TaskTypeEnum.Q3CK:
-                    case TaskTypeEnum.Move:
+                    case TaskTypeEnum.MOVE:
+                    case TaskTypeEnum.F01:
                         {
                             TargetRouteDto target = new TargetRouteDto()
                             {
@@ -329,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