From 375bad8fd1e5650859456f4b31486d43e4c49371 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期六, 21 三月 2026 11:47:56 +0800
Subject: [PATCH] 添加job
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 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 2eabbce..b87085b 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"
@@ -13,6 +13,7 @@
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.AGV.HIKROBOT;
using System.Diagnostics.CodeAnalysis;
+using System.Reflection.PortableExecutable;
namespace WIDESEAWCS_TaskInfoService
{
@@ -322,5 +323,65 @@
}
return hIKROBOTTaskSubmit;
}
+
+
+ /// <summary>
+ /// 娴峰悍AGV浠诲姟缁х画鎵ц
+ /// </summary>
+ /// <param name="TaskCode">浠诲姟鍙�</param>
+ /// <returns></returns>
+ public WebResponseContent Hikvisiontaskscontinue(string TaskCode,string Address=null)
+ {
+ WebResponseContent content = new WebResponseContent();
+ HIKROBOTReturn hIKROBOTReturn = null;
+ HIKROBOTTaskContinue hIKROBOTTaskContinue =null;
+ try
+ {
+ // 1. 鍙傛暟楠岃瘉
+ if (string.IsNullOrWhiteSpace(TaskCode))
+ {
+ throw new Exception("浠诲姟缂栫爜涓嶈兘涓虹┖");
+ }
+ Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(HIKROBOTTaskContinue)) ?? throw new Exception("鏈壘鍒版捣搴稟GV缁х画鎵ц鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ hIKROBOTTaskContinue = new HIKROBOTTaskContinue()
+ {
+ triggerCode = TaskCode,
+ triggerType="TASK",//鍥哄畾鍊�
+ targetRoute=string.IsNullOrEmpty(Address)?null:
+ new TargetRouteDto()
+ {
+ code = Address,
+ type = "SITE",
+ }
+ };
+ var headers = new Dictionary<string, string>
+ {
+ { "X-lr-request-id", DateTimeOffset.Now.ToUnixTimeSeconds().ToString() }
+ };
+ string response = HttpHelper.Post(apiInfo.ApiAddress, hIKROBOTTaskContinue.Serialize(),headers: headers);
+ hIKROBOTReturn = response.DeserializeObject<HIKROBOTReturn>();
+
+ if (hIKROBOTReturn.code == "SUCCESS")
+ {
+ var data = hIKROBOTReturn.data.ToString().DeserializeObject<HIKROBOTReturnData>();
+ content.OK(data: data);
+ }
+ else
+ {
+ throw new Exception(hIKROBOTReturn.message);
+ }
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ finally
+ {
+ _trackloginfoService.AddTrackLog(hIKROBOTTaskContinue, content, "娴峰悍AGV缁х画鎵ц浠诲姟", "", hIKROBOTReturn.message);
+
+ }
+ return content;
+ }
+
}
}
--
Gitblit v1.9.3