From af7d711002c16d219eba4b823a3cdae38a2ccfad Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 05 三月 2026 15:40:23 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 84 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 78 insertions(+), 6 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 a16c631..7e831ac 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"
@@ -16,13 +16,10 @@
#endregion << 鐗� 鏈� 娉� 閲� >>
using AutoMapper;
-using Dm;
using SqlSugar;
using System.Diagnostics.CodeAnalysis;
-using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common;
-using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
@@ -30,6 +27,7 @@
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.AGV.HIKROBOT;
using WIDESEAWCS_DTO.RGV.FOURBOT;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_DTO.WMS;
@@ -160,7 +158,7 @@
bool isHK = dt_Task.TaskType == (int)TaskTypeEnum.Carry || dt_Task.TaskType == (int)TaskTypeEnum.CJInbound || dt_Task.TaskType == (int)TaskTypeEnum.CJInbound || dt_Task.TaskType == (int)TaskTypeEnum.CJOutbound;
//杩欓噷灏嗙姸鎬佹敼鍙樹簡198鍙栨秷浠诲姟
dt_Task.TaskType = TaskStatusEnum.WMSCancel.ObjToInt();
- #region
+ #region 鍑箰澹�
if (isGALAXISTask)
{
var KLS = new CancelGALAXISTask
@@ -208,6 +206,32 @@
return content.Error($"浠诲姟澶辫触{fOURBOTReturn.data}");
}
}
+ #endregion
+ #region 娴峰悍
+ if (isHK)
+ {
+ CancelHIKROBOTTask cancelHIKROBOTTask = new CancelHIKROBOTTask
+ {
+ robotTaskCode = dt_Task.WMSTaskNum,
+ cancelType = "CANCEL"//鍘熻蒋鍙栨秷锛孌ROP浜哄伐浠嬪叆锛堝師纭彇娑堬級
+ };
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(CancelHIKROBOTTask));
+ if (apiInfo == null) throw new Exception("鏈壘鍒板洓鍚戣溅AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiInfo.ApiAddress, cancelHIKROBOTTask.Serialize());
+ HIKROBOTReturn hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
+ if (hIKROBOTReturn.code == "SUCCESS" && hIKROBOTReturn.message == "鎴愬姛")
+ {
+ //鐩存帴绉诲叆鍘嗗彶
+ BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.鑷姩瀹屾垚);
+ return content.OK("鍙栨秷浠诲姟鎴愬姛", dt_Task);
+ }
+ else
+ {
+ return content.Error($"浠诲姟澶辫触{hIKROBOTReturn.data}");
+ }
+
+ }
+
#endregion
}
catch (Exception ex)
@@ -283,7 +307,7 @@
FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
if (fOURBOTReturn.returnCode == 0 && fOURBOTReturn.returnUserMsg == "鎴愬姛")
{
-
+ BaseDal.UpdateData(dt_Task);
return content.OK("淇敼浠诲姟浼樺厛绾ф垚鍔�", dt_Task);
}
else
@@ -291,8 +315,31 @@
return content.Error($"浠诲姟澶辫触{fOURBOTReturn.data}");
}
}
- #endregion
+ #endregion
+ #region 娴峰悍
+ if (isHK)
+ {
+ var request = new HIKROBOTTaskGrade
+ {
+ robotTaskCode = dt_Task.WMSTaskNum,//浠诲姟鍙�
+ initPriority = updateTaskPriority.taskPriority//浼樺厛绾�
+ };
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(HIKROBOTTaskGrade));
+ if (apiInfo == null) throw new Exception("鏈壘鍒板洓鍚戣溅AGV浠诲姟涓嬪彂鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
+ HIKROBOTReturn hIKROBOTReturn=response.DeserializeObject<HIKROBOTReturn>();
+ if (hIKROBOTReturn.code == "SUCCESS0"&&hIKROBOTReturn.message=="鎴愬姛")
+ {
+ BaseDal.UpdateData(dt_Task);
+ return content.OK("淇敼浠诲姟浼樺厛绾ф垚鍔�", dt_Task);
+ }
+ else
+ {
+ return content.Error($"浠诲姟澶辫触{hIKROBOTReturn.data}");
+ }
+ }
+ #endregion
}
catch (Exception ex)
{
@@ -1014,5 +1061,30 @@
return WebResponseContent.Instance.Error(ex.Message);
}
}
+
+ /// <summary>
+ /// 鎵归噺鏇存柊鍌ㄤ綅鐘舵��
+ /// </summary>
+ /// <param name="fOURBOTStorageStatusNotify"></param>
+ /// <returns></returns>
+ /// <exception cref="NotImplementedException"></exception>
+ public WebResponseContent multiSetNodeStatus(FOURBOTStorageStatusNotify fOURBOTStorageStatusNotify)
+ {
+ try
+ {
+ var Agvlocation = _rGVLocationInfoService.Repository.QueryData(x=> fOURBOTStorageStatusNotify.storageCode.Contains(x.LocationCode));
+ foreach (var item in Agvlocation)
+ {
+ item.LocationStatus = (int)(fOURBOTStorageStatusNotify.disable==0?EnableStatusEnum.Normal:EnableStatusEnum.Disable);
+ }
+ _rGVLocationInfoService.UpdateData(Agvlocation);
+ return WebResponseContent.Instance.OK();
+ }
+ catch (Exception ex)
+ {
+
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
}
}
--
Gitblit v1.9.3