From 38072f522dd49da33b22f604fb6b262e884b8a32 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 12 三月 2026 18:30:47 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShengZhiNeng/GaoPuLiTiKu

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs    |    3 +
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs    |   39 +++++++++++--------
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   28 +++++++++++---
 3 files changed, 46 insertions(+), 24 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index b89b523..63097eb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -18,6 +18,7 @@
 using AutoMapper;
 using SixLabors.ImageSharp.ColorSpaces;
 using SqlSugar;
+using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
 using WIDESEAWCS_BasicInfoService;
 using WIDESEAWCS_Common;
@@ -106,7 +107,7 @@
                             continue;
                             //throw new Exception(content.Message);
                         }
-                        if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode) != null)
+                        if (BaseDal.QueryFirst(x => x.WMSTaskNum == task.taskCode && x.TaskType == item.taskType) != null)
                         {
                             objects.Add(new
                             {
@@ -116,7 +117,7 @@
                             continue;
                             //throw new Exception($"浠诲姟鍙枫�恵task.taskCode}銆戝凡瀛樺湪浠诲姟");
                         }
-                        if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode) != null)
+                        if (BaseDal.QueryFirst(x => x.PalletCode == task.containerCode && x.TaskType == item.taskType) != null)
                         {
                             objects.Add(new
                             {
@@ -126,7 +127,7 @@
                             continue;
                             //throw new Exception($"鎵樼洏鍙枫�恵task.containerCode}銆戝凡瀛樺湪浠诲姟");
                         }
-                        if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode) != null)
+                        if (BaseDal.QueryFirst(x => x.SourceAddress == task.fromLocationCode && x.TaskType == item.taskType) != null)
                         {
                             objects.Add(new
                             {
@@ -232,6 +233,7 @@
                     if (apiInfo == null) throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                     string response = HttpHelper.Post(apiInfo.ApiAddress, KLS.Serialize());
                     GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
+                    content.OK(data: agvContent);
                     if (agvContent.success == true && agvContent.code == 0)
                     {
                         //鐩存帴绉诲叆鍘嗗彶
@@ -258,6 +260,7 @@
                     if (apiInfo == null) throw new Exception("鏈壘鍒板洓鍚戣溅AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                     string response = HttpHelper.Post(apiInfo.ApiAddress, cancelSXCTake.Serialize());
                     FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
+                    content.OK(data: fOURBOTReturn);
                     if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn.returnUserMsg == "鎴愬姛")
                     {
                         //鐩存帴绉诲叆鍘嗗彶
@@ -283,6 +286,7 @@
                     if (apiInfo == null) throw new Exception("鏈壘鍒板洓鍚戣溅AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                     string response = HttpHelper.Post(apiInfo.ApiAddress, cancelHIKROBOTTask.Serialize());
                     HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
+                    content.OK(data: hIKROBOTReturn);
                     if (hIKROBOTReturn.code == "SUCCESS" && hIKROBOTReturn.message == "鎴愬姛")
                     {
                         //鐩存帴绉诲叆鍘嗗彶
@@ -373,6 +377,7 @@
                     if (apiInfo == null) throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                     string response = HttpHelper.Post(apiInfo.ApiAddress, updateGALAXISTaskGrade.Serialize());
                     GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
+                    content.OK(data: agvContent);
                     if (agvContent.success == true && agvContent.code == 0)
                     {
 
@@ -398,6 +403,7 @@
                     if (apiInfo == null) throw new Exception("鏈壘鍒版洿鏂板洓鍚戣溅浠诲姟浼樺厛绾ф帴鍙i厤缃俊鎭紒璇锋鏌ユ帴鍙i厤缃�");
                     string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
                     FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
+                    content.OK(data: fOURBOTReturn);
                     if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn.returnUserMsg == "鎴愬姛")
                     {
                         BaseDal.UpdateData(dt_Task);
@@ -422,6 +428,7 @@
                     if (apiInfo == null) throw new Exception("鏈壘鍒板洓鍚戣溅AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                     string response = HttpHelper.Post(apiInfo.ApiAddress, Hkrequest.Serialize());
                     HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
+                    content.OK(data: hIKROBOTReturn);
                     if (hIKROBOTReturn.code == "SUCCESS0" && hIKROBOTReturn.message == "鎴愬姛")
                     {
                         BaseDal.UpdateData(dt_Task);
@@ -1079,11 +1086,15 @@
             try
             {
                 if (getLocationInfo == null) throw new Exception("璇锋眰鍙傛暟涓嶈兘涓虹┖锛�");
-                if (getLocationInfo.AreaCode == null) throw new Exception("搴撳尯缂栧彿涓嶈兘涓虹┖锛�");
+                //if (getLocationInfo.AreaCode == null) throw new Exception("搴撳尯缂栧彿涓嶈兘涓虹┖锛�");
                 if (getLocationInfo.WarehouseId == 0) throw new Exception("浠撳簱ID涓嶈兘涓虹┖锛�");
                 if (getLocationInfo.WarehouseId == 1)
                 {
-                    List<Dt_RGVLocationInfo> rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
+                    List<Dt_RGVLocationInfo> rGVLocationInfos = new List<Dt_RGVLocationInfo>();
+                    if (!string.IsNullOrEmpty(getLocationInfo.AreaCode))
+                        rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
+                    else
+                        rGVLocationInfos = _rGVLocationInfoService.Repository.QueryData();
                     foreach (var item in rGVLocationInfos)
                     {
                         list.Add(new
@@ -1097,7 +1108,11 @@
                 }
                 else if (getLocationInfo.WarehouseId == 2)
                 {
-                    List<Dt_KLSLocationInfo> rGVLocationInfos = _kLSLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
+                    List<Dt_KLSLocationInfo> rGVLocationInfos = new List<Dt_KLSLocationInfo>();
+                    if (!string.IsNullOrEmpty(getLocationInfo.AreaCode))
+                        rGVLocationInfos = _kLSLocationInfoService.Repository.QueryData(x => x.WarehouseId == getLocationInfo.AreaCode.ObjToInt());
+                    else
+                        rGVLocationInfos = _kLSLocationInfoService.Repository.QueryData();
                     foreach (var item in rGVLocationInfos)
                     {
                         list.Add(new
@@ -1222,6 +1237,7 @@
                 };
                 string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOToccupyStation.Serialize());
                 FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
+                content.OK(data: fOURBOTReturn);
                 if (fOURBOTReturn.returnCode != 0 /*&& fOURBOTReturn.returnUserMsg != $"绔欑偣宸茶鍗犵敤,(podID={iQC.ContainerCode})"*/)
                     throw new Exception(fOURBOTReturn.returnUserMsg);
                 #endregion
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
index 510a784..f461b56 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
@@ -8,6 +8,7 @@
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.RGV.FOURBOT;
 using WIDESEAWCS_Model.Models;
 
 namespace WIDESEAWCS_Tasks
@@ -41,7 +42,7 @@
                 Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("鏈壘鍒板嚡涔愬+AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
                 string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
                 GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
-                content.Data = agvContent;
+                content.OK(data: agvContent);
                 if (agvContent.success)
                 {
                     if (agvContent.data.returnStatus != 0) throw new Exception(agvContent.data.returnInfo);
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
index 1f4eef1..92b7341 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
@@ -51,7 +51,7 @@
                     {
                         string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize());
                         FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
-                        content.Data = fOURBOTReturn;
+                        content.OK(data: fOURBOTReturn);
                         if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
 
                         string dataJson = fOURBOTReturn.data.ToString();
@@ -113,7 +113,7 @@
                     fOURBOTnewMovePodTask.desNodeID = item.NextAddress;
                     string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize());
                     FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
-                    content.Data = fOURBOTReturn;
+                    content.OK(data: fOURBOTReturn);
                     if (fOURBOTReturn.returnCode == 0)
                     {
                         string dataJson = fOURBOTReturn.data.ToString();
@@ -172,7 +172,7 @@
                 //content.candidatePodIDs = tasks.Select(x => x.PalletCode).ToList();
                 string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
                 FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
-                content.Data = fOURBOTReturn;
+                content.OK(data: fOURBOTReturn);
                 if (fOURBOTReturn.returnCode == 0)
                 {
                     //ReturnBlockPodResultDto getBlockPod = fOURBOTReturn.data as ReturnBlockPodResultDto ?? throw new Exception("鏈幏鍙栧埌闃荤鎵樼洏鍏崇郴鏁版嵁");
@@ -266,7 +266,7 @@
 
                             string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize());
                             var fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
-                            content.Data = fOURBOTReturn;
+                            content.OK(data: fOURBOTReturn);
                             if (fOURBOTReturn.returnCode == 0)
                             {
                                 var data = fOURBOTReturn.data.ToString();
@@ -278,12 +278,12 @@
                                 locationsToUpdate.Add(rGVLocationInfo);
 
                                 #region 閲婃斁鍏ュ簱绔欏彴
-                                var stationManger = _stationMangerService.GetInStationInfo(item.SourceAddress);
-                                if (stationManger != null)
-                                {
-                                    stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
-                                    stationsToUpdate.Add(stationManger);
-                                }
+                                //var stationManger = _stationMangerService.GetInStationInfo(item.SourceAddress);
+                                //if (stationManger != null)
+                                //{
+                                //    stationManger.IsOccupied = LocationStatusEnum.Free.ObjToInt();
+                                //    stationsToUpdate.Add(stationManger);
+                                //}
                                 content.OK();
                                 #endregion
                             }
@@ -386,8 +386,8 @@
                             _taskService.UpdateData(tasksToUpdate);
                         if (locationsToUpdate.Any())
                             _rGVLocationInfoService.UpdateData(locationsToUpdate);
-                        if (stationsToUpdate.Any())
-                            _stationMangerService.UpdateData(stationsToUpdate);
+                        //if (stationsToUpdate.Any())
+                        //    _stationMangerService.UpdateData(stationsToUpdate);
 
                         _unitOfWorkManage.CommitTran();
                     }
@@ -445,6 +445,7 @@
                         //FOURBOTnewMovePodTaskResponseData fOURBO = fOURBOTReturn.data as FOURBOTnewMovePodTaskResponseData ?? throw new Exception("鏈幏鍙栧埌鍥涘悜杞﹁繑鍥炵殑浠诲姟ID");
                         string dataJson = fOURBOTReturn.data.ToString();
                         FOURBOTnewMovePodTaskResponseData? fOURBO = JsonConvert.DeserializeObject<FOURBOTnewMovePodTaskResponseData>(dataJson);
+                        content.OK(data: fOURBO);
                         if (fOURBO == null || fOURBO.taskID == 0)
                         {
                             throw new Exception($"鏈幏鍙栧埌鍥涘悜杞﹁繑鍥炵殑浠诲姟ID锛岃繑鍥炴暟鎹細{response}");
@@ -537,7 +538,7 @@
                 }
                 string response = HttpHelper.Post(apiInfo.ApiAddress, moveBlock.Serialize());
                 FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
-                content.Data = fOURBOTReturn;
+                content.OK(data: fOURBOTReturn);
                 if (fOURBOTReturn.returnCode == 0)
                 {
                     string dataJson = fOURBOTReturn.data.ToString();
@@ -607,8 +608,12 @@
                 {
                     i++;
                     var stationManger = _stationMangerService.GetOutStationInfo(item.TargetAddress);
+                    //if (stationManger.IsOccupied != LocationStatusEnum.Free.ObjToInt())
+                    //{
+                    //    item.ExceptionMessage = $"鍑哄簱绔欏彴銆恵stationManger.StationCode}銆戣鍗犵敤";
+                    //    continue;
+                    //}
                     item.NextAddress = stationManger.StationCode;
-                    if (stationManger.IsOccupied != LocationStatusEnum.Free.ObjToInt()) continue;
                     #region 涓嬪彂鍑哄簱浠诲姟
                     fOURBOTnewMovePodTask.priority = item.Grade;
                     fOURBOTnewMovePodTask.podID = item.PalletCode;
@@ -626,7 +631,7 @@
                     fOURBOTnewMovePodTask.requestID = DateTime.Now.ToString("yyyyMMddHHmmss") + i;
                     string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize());
                     FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
-                    content.Data = fOURBOTReturn;
+                    content.OK(data: fOURBOTReturn);
                     if (fOURBOTReturn.returnCode == 0)
                     {
                         string dataJson = fOURBOTReturn.data.ToString();
@@ -637,8 +642,8 @@
                         }
                         item.RGVTaskId = fOURBO.taskID;
                         item.TaskState = (int)TaskStatusEnum.Execut;
-                        stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
-                        _stationMangerService.UpdateData(stationManger);
+                        //stationManger.IsOccupied = LocationStatusEnum.Lock.ObjToInt();
+                        //_stationMangerService.UpdateData(stationManger);
                     }
                     #endregion
                 }

--
Gitblit v1.9.3