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_DTO/AGV/HIKROBOT/CancelHIKROBOTTask.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 23 ++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs | 103 +++++++++++-
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs | 36 ++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/RGV/RGVController.cs | 64 +++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 84 +++++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HIKROBOTTaskProcessReport.cs | 113 ++++++++++++++
7 files changed, 405 insertions(+), 20 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/CancelHIKROBOTTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/CancelHIKROBOTTask.cs"
index d913ed3..ed908fe 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/CancelHIKROBOTTask.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/CancelHIKROBOTTask.cs"
@@ -19,7 +19,7 @@
/// <summary>
- /// 浠诲姟鍙栨秷绫诲瀷
+ /// 浠诲姟鍙栨秷绫诲瀷 "CANCEL"鍘熻蒋鍙栨秷锛� "DROP "浜哄伐浠嬪叆锛堝師纭彇娑堬級
/// </summary>
public string cancelType { get; set; }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HIKROBOTTaskProcessReport.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HIKROBOTTaskProcessReport.cs"
index 9d7be35..b8e3c43 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HIKROBOTTaskProcessReport.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HIKROBOTTaskProcessReport.cs"
@@ -25,6 +25,117 @@
/// <summary>
/// 鑷畾涔夋墿灞曞瓧娈�
/// </summary>
- public object extra { get; set; }
+ public HikExtra extra { get; set; }
+ }
+ /// <summary>
+ /// 鑷畾涔夋墿灞曞瓧娈�
+ /// </summary>
+ public class HikExtra
+ {
+ /// <summary>
+ /// 鎵╁睍瀛楁鐨勫��
+ /// </summary>
+ public HikValues values { get; set; }
+ }
+
+ /// <summary>
+ /// 鎵╁睍瀛楁鐨勫��
+ /// </summary>
+ public class HikValues
+ {
+ /// <summary>
+ /// 鍦板浘缂栧彿
+ /// </summary>
+ public string mapCode { get; set; }
+
+ /// <summary>
+ /// 浠诲姟鎵ц杩囩▼涓秷鎭笂鎶ョ殑鏂规硶鍚�
+ /// start : 浠诲姟寮�濮�
+ /// outbin : 璧板嚭鍌ㄤ綅
+ /// end : 浠诲姟瀹屾垚
+ /// </summary>
+ public string method { get; set; }
+
+ /// <summary>
+ /// 杞藉叿缂栧彿
+ /// </summary>
+ public string carrierCode { get; set; }
+
+ /// <summary>
+ /// 杞藉叿鍚嶇О
+ /// </summary>
+ public string carrierName { get; set; }
+
+ /// <summary>
+ /// 杞藉叿绫诲瀷
+ /// </summary>
+ public string carrierType { get; set; }
+
+ /// <summary>
+ /// 杞藉叿绉嶇被
+ /// </summary>
+ public string carrierCategory { get; set; }
+
+ /// <summary>
+ /// 杞藉叿瑙掑害 (鍙��)
+ /// </summary>
+ public string carrierDir { get; set; }
+
+ /// <summary>
+ /// 褰撳墠绔欑偣缂栧彿
+ /// outbin锛氳捣鐐�
+ /// end锛氱洰鏍囩偣
+ /// </summary>
+ public string slotCode { get; set; }
+
+ /// <summary>
+ /// 绔欑偣鍒悕
+ /// </summary>
+ public string slotName { get; set; }
+
+ /// <summary>
+ /// 瀛樺偍绫诲瀷锛屾灇涓惧�硷細BIN(浠撲綅)銆丼ITE(绔欑偣)
+ /// </summary>
+ public string slotCategory { get; set; }
+
+ /// <summary>
+ /// 鏈哄櫒浜哄綋鍓嶄綅缃畑鍧愭爣
+ /// </summary>
+ public string x { get; set; }
+
+ /// <summary>
+ /// 鏈哄櫒浜哄綋鍓嶄綅缃畒鍧愭爣
+ /// </summary>
+ public string y { get; set; }
+
+ /// <summary>
+ /// 鏈哄櫒浜虹绫�
+ /// </summary>
+ public string amrCategory { get; set; }
+
+ /// <summary>
+ /// 鏈哄櫒浜虹被鍨�
+ /// </summary>
+ public string amrType { get; set; }
+
+ /// <summary>
+ /// 鏈哄櫒浜虹紪鍙凤紝涓巗ingleRobotCode鐩稿悓
+ /// </summary>
+ public string amrCode { get; set; }
+
+ /// <summary>
+ /// 鍖哄煙缂栧彿
+ /// </summary>
+ public string zoneCode { get; set; }
+
+ /// <summary>
+ /// 鍫嗗彔灞傚彿锛岃浇鍏蜂綅浜庣鍑犲眰
+ /// </summary>
+ public int? layerNo { get; set; }
+
+ /// <summary>
+ /// 杞藉叿閲嶉噺锛圕TU鏀寔锛夛紝鍗曚綅锛歡
+ /// </summary>
+ public string carrierWeight { get; set; }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index 328d00b..ab4439a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -35,6 +35,7 @@
using WIDESEAWCS_Common.LocationEnum;
using Microsoft.VisualBasic;
using System.Web;
+using WIDESEAWCS_DTO.RGV.FOURBOT;
namespace WIDESEAWCS_ITaskInfoService
{
@@ -215,6 +216,8 @@
/// <param name="sequenceName"></param>
/// <returns></returns>
int GetTaskNum(string sequenceName);
+
+
WebResponseContent UpdateTaskStatus(object TaskDTO, DeviceTypeEnum deviceTypeEnum);
/// <summary>
/// 淇敼璐т綅鐘舵��
@@ -223,7 +226,7 @@
/// <param name="deviceTypeEnum"></param>
/// <param name="locationStatusEnum"></param>
/// <returns></returns>
- WebResponseContent UpdateLocationStatus(string LocationCode, DeviceTypeEnum deviceTypeEnum, LocationStatusEnum locationStatusEnum);
+ WebResponseContent UpdateLocationStatus(Dt_Task task, DeviceTypeEnum deviceTypeEnum, LocationStatusEnum locationStatusEnum);
WebResponseContent ModifyWMSLayoutZone(WMSUpdateLocationArea wMSUpdateLocationArea);
@@ -267,7 +270,25 @@
/// <param name="wMSMoveLocationFeedback"></param>
/// <returns></returns>
public WebResponseContent WcsMovingDataBack(WMSMoveLocationFeedback wMSMoveLocationFeedback);
+
+ /// <summary>
+ /// WMS瀹瑰櫒娴佸姩璇锋眰
+ /// </summary>
+ /// <param name="wMSContainerFlow"></param>
+ /// <returns></returns>
WebResponseContent ContainerRequest(WMSContainerFlow wMSContainerFlow);
+
+ /// <summary>
+ /// 璐ㄦ缁撴灉鍙嶉
+ /// </summary>
+ /// <param name="iQC"></param>
+ /// <returns></returns>
WebResponseContent IQCResult(IQCResultDTO iQC);
+
+ /// <summary>
+ /// 鎵归噺鏇存柊鍌ㄤ綅鐘舵��
+ /// </summary>
+ /// <returns></returns>
+ WebResponseContent multiSetNodeStatus(FOURBOTStorageStatusNotify fOURBOTStorageStatusNotify);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs"
index 735a2bf..89ff123 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/KHAGVController.cs"
@@ -1,5 +1,10 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using WIDESEAWCS_Common;
+using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.RGV.FOURBOT;
+using WIDESEAWCS_ITaskInfoService;
namespace WIDESEAWCS_Server.Controllers.AGV
{
@@ -7,5 +12,34 @@
[ApiController]
public class KHAGVController : ControllerBase
{
+ private readonly ITaskService _taskService;
+
+ public KHAGVController(ITaskService taskService)
+ {
+ _taskService = taskService;
+ }
+ /// <summary>
+ /// 浠诲姟鐘舵�佹洿鏂�
+ /// </summary>
+ /// <param name="taskDTOs"></param>
+ /// <returns></returns>
+ [HttpPost, Route("UpdateTaskStatus"), AllowAnonymous]
+ public HIKROBOTReturn UpdateTaskStatus([FromBody] object TaskDTO)
+ {
+ HIKROBOTReturn returnHK = new HIKROBOTReturn();
+ var take = _taskService.UpdateTaskStatus(TaskDTO, DeviceTypeEnum.YuanLiJuHe);
+ if (take.Status)
+ {
+ returnHK.code = "SUCCESS";
+ returnHK.message = "succ";
+ }
+ else
+ {
+ returnHK.code = "404";
+ returnHK.message = take.Message;
+ }
+
+ return returnHK;
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/RGV/RGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/RGV/RGVController.cs"
index 4685814..9d5dfda 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/RGV/RGVController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/RGV/RGVController.cs"
@@ -1,5 +1,10 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using WIDESEAWCS_Common;
+using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.RGV.FOURBOT;
+using WIDESEAWCS_ITaskInfoService;
namespace WIDESEAWCS_Server.Controllers.RGV
{
@@ -7,5 +12,62 @@
[ApiController]
public class RGVController : ControllerBase
{
+ private readonly ITaskService _taskService;
+
+ public RGVController(ITaskService taskService)
+ {
+ _taskService = taskService;
+ }
+ /// <summary>
+ /// 浠诲姟鐘舵�佹洿鏂�
+ /// </summary>
+ /// <param name="taskDTOs"></param>
+ /// <returns></returns>
+ [HttpPost, Route("UpdateTaskStatus"), AllowAnonymous]
+ public FOURBOTReturn UpdateTaskStatus([FromBody] object TaskDTO)
+ {
+ FOURBOTReturn returnRGV = new FOURBOTReturn();
+ var take = _taskService.UpdateTaskStatus(TaskDTO, DeviceTypeEnum.YuanLiJuHe);
+ if (take.Status)
+ {
+ returnRGV.returnCode = 0;
+ returnRGV.returnMsg = "succ";
+ returnRGV.returnUserMsg = "鎴愬姛";
+ }
+ else
+ {
+ returnRGV.returnCode = 404;
+ returnRGV.returnMsg = take.Message;
+ returnRGV.returnUserMsg = "澶辫触";
+ }
+
+ return returnRGV;
+ }
+
+
+ /// <summary>
+ /// 鎵归噺鏇存柊鍌ㄤ綅鐘舵��
+ /// </summary>
+ /// <param name="fOURBOTStorageStatusNotify"></param>
+ /// <returns></returns>
+ [HttpPost, Route("multiSetNodeStatus"), AllowAnonymous]
+ public FOURBOTReturn multiSetNodeStatus([FromBody] FOURBOTStorageStatusNotify fOURBOTStorageStatusNotify)
+ {
+ FOURBOTReturn returnRGV = new FOURBOTReturn();
+ var take = _taskService.multiSetNodeStatus(fOURBOTStorageStatusNotify);
+ if (take.Status)
+ {
+ returnRGV.returnCode = 0;
+ returnRGV.returnMsg = "succ";
+ returnRGV.returnUserMsg = "鎴愬姛";
+ }
+ else
+ {
+ returnRGV.returnCode = 404;
+ returnRGV.returnMsg = take.Message;
+ returnRGV.returnUserMsg = "澶辫触";
+ }
+ return returnRGV;
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
index b5f2ecc..618e8ce 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
@@ -14,6 +14,8 @@
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.AGV.HIKROBOT;
+using WIDESEAWCS_DTO.RGV.FOURBOT;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_Model.Models;
@@ -35,6 +37,8 @@
WebResponseContent content = new WebResponseContent();
GALAXISUpdateTaskStatus gALAXIS = new();
+ FOURBOTTaskStatusNotify Rgv = new();//鍥涘悜杞︿换鍔$姸鎬侀�氱煡
+ HIKROBOTTaskProcessReport hIKROBOT = new();//娴峰悍鏈哄櫒浜�
try
{
if (deviceTypeEnum == DeviceTypeEnum.GALAXIS)
@@ -59,13 +63,45 @@
}
else if (deviceTypeEnum == DeviceTypeEnum.HIKROBOT)
{
-
+ hIKROBOT=TaskDTO.Serialize().DeserializeObject<HIKROBOTTaskProcessReport>();
+ if (hIKROBOT==null) throw new Exception("鍙傛暟杞崲澶辫触锛�");
+ var task = BaseDal.QueryFirst(x => x.WMSTaskNum == hIKROBOT.robotTaskCode);
+ if (task == null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟缂栧彿銆恵hIKROBOT.robotTaskCode}銆�");
+ switch (hIKROBOT.extra.values.method)
+ {
+ case "start":
+ TaskCompleted(task, deviceTypeEnum);
+ break;
+ case "end":
+ TaskFromCompleted(task, deviceTypeEnum);
+ break;
+ default:
+ task.TaskState = ReturnTaskStatus(gALAXIS.taskStatus, deviceTypeEnum);
+ BaseDal.UpdateData(task);
+ break;
+ }
}
else //鍥涘悜杞�
{
+ Rgv = TaskDTO.Serialize().DeserializeObject<FOURBOTTaskStatusNotify>();
+ if (Rgv==null) throw new Exception("鍙傛暟杞崲澶辫触锛�");
+ var task = BaseDal.QueryFirst(x => x.WMSTaskNum == Rgv.taskID.ToString());
+ if (task==null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟缂栧彿銆恵Rgv.taskID}銆�");
+ switch (Rgv.status)
+ {
+ case 2:
+ TaskCompleted(task, deviceTypeEnum);
+ break;
+ case 4:
+ TaskFromCompleted(task, deviceTypeEnum);
+ break;
+ default:
+ task.TaskState = ReturnTaskStatus(gALAXIS.taskStatus, deviceTypeEnum);
+ break;
+ }
+
}
- //return WebResponseContent.Instance.OK();
return content.OK();
}
catch (Exception ex)
@@ -74,7 +110,30 @@
}
finally
{
- _trackloginfoService.AddTrackLog(gALAXIS, content, "涓嬪彂鍑箰澹獳GV浠诲姟", "", "");
+ // 鍦� finally 涓垽鏂摢涓璞¤璧嬪�间簡
+ object logObject = null;
+ string deviceName = "";
+
+ if (gALAXIS != null && gALAXIS.taskId != null)
+ {
+ logObject = gALAXIS;
+ deviceName = "鍑箰澹獳GV";
+ }
+ else if (hIKROBOT != null && hIKROBOT.robotTaskCode != null)
+ {
+ logObject = hIKROBOT;
+ deviceName = "娴峰悍鏈哄櫒浜�";
+ }
+ else if (Rgv != null && Rgv.taskID != 0)
+ {
+ logObject = Rgv;
+ deviceName = "鍥涘悜杞�";
+ }
+
+ if (logObject != null)
+ {
+ _trackloginfoService.AddTrackLog(logObject, content, $"涓嬪彂{deviceName}浠诲姟", "", "");
+ }
}
}
#endregion
@@ -134,7 +193,7 @@
{
dt_Task.TaskState = TaskStatusEnum.TakeFinish.ObjToInt();
Db.Ado.BeginTran();
- UpdateLocationStatus(dt_Task.SourceAddress, deviceTypeEnum, LocationStatusEnum.Free);
+ UpdateLocationStatus(dt_Task, deviceTypeEnum, LocationStatusEnum.Free);
BaseDal.UpdateData(dt_Task);
Db.Ado.CommitTran();
return WebResponseContent.Instance.OK();
@@ -186,7 +245,7 @@
if (agvContent.code != 0) dt_Task.ExceptionMessage = agvContent.msg;
}
Db.Ado.BeginTran();
- UpdateLocationStatus(dt_Task.TargetAddress, deviceTypeEnum, LocationStatusEnum.InStock);
+ UpdateLocationStatus(dt_Task, deviceTypeEnum, LocationStatusEnum.InStock);
if (agvContent != null && agvContent.code == 0)
BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.鑷姩瀹屾垚);
else
@@ -210,33 +269,59 @@
/// <param name="deviceTypeEnum"></param>
/// <param name="locationStatusEnum"></param>
/// <returns></returns>
- public WebResponseContent UpdateLocationStatus(string LocationCode, DeviceTypeEnum deviceTypeEnum, LocationStatusEnum locationStatusEnum)
+ public WebResponseContent UpdateLocationStatus(Dt_Task takse, DeviceTypeEnum deviceTypeEnum, LocationStatusEnum locationStatusEnum)
{
try
{
if (deviceTypeEnum == DeviceTypeEnum.GALAXIS)
{
- Dt_KLSLocationInfo? dt_KLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
+ Dt_KLSLocationInfo? dt_KLSLocationInfo = _kLSLocationInfoService.Repository.QueryFirst(x => x.LocationCode == takse.SourceAddress);
if (dt_KLSLocationInfo != null)
{
+ if (locationStatusEnum== LocationStatusEnum.Free) //濡傛灉璧风偣瀹屾垚灏辩粰璐т綅璧嬪�兼墭鐩樺彿
+ {
+ dt_KLSLocationInfo.PalletCode = "";
+ }
+ else
+ {
+ dt_KLSLocationInfo.PalletCode = takse.PalletCode;
+ }
dt_KLSLocationInfo.LocationStatus = locationStatusEnum.ObjToInt();
_kLSLocationInfoService.Repository.UpdateData(dt_KLSLocationInfo);
}
}
else if (deviceTypeEnum == DeviceTypeEnum.HIKROBOT)
{
- Dt_HKLocationInfo? dt_HKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
+ Dt_HKLocationInfo? dt_HKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == takse.SourceAddress);
if (dt_HKLocationInfo != null)
{
+ if (locationStatusEnum == LocationStatusEnum.Free) //濡傛灉璧风偣瀹屾垚灏辩粰璐т綅璧嬪�兼墭鐩樺彿
+ {
+ dt_HKLocationInfo.PalletCode = "";
+ }
+ else
+ {
+ dt_HKLocationInfo.PalletCode = takse.PalletCode;
+ }
dt_HKLocationInfo.LocationStatus = locationStatusEnum.ObjToInt();
_hKLocationInfoService.Repository.UpdateData(dt_HKLocationInfo);
}
}
else if (deviceTypeEnum == DeviceTypeEnum.YuanLiJuHe)
{
- Dt_RGVLocationInfo dt_RGVLocationInfo = _rGVLocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode);
+ Dt_RGVLocationInfo dt_RGVLocationInfo = _rGVLocationInfoService.Repository.QueryFirst(x => x.LocationCode == takse.SourceAddress);
+ //杩欓噷灏嗕换鍔$殑鎵樼洏鍙风粰璐т綅琛ㄤ腑鐨凱alletCode瀛楁銆�
+
if (dt_RGVLocationInfo != null)
{
+ if (locationStatusEnum == LocationStatusEnum.Free) //濡傛灉璧风偣瀹屾垚灏辩粰璐т綅璧嬪�兼墭鐩樺彿
+ {
+ dt_RGVLocationInfo.PalletCode = "";
+ }
+ else
+ {
+ dt_RGVLocationInfo.PalletCode = takse.PalletCode;
+ }
dt_RGVLocationInfo.LocationStatus = locationStatusEnum.ObjToInt();
_rGVLocationInfoService.Repository.UpdateData(dt_RGVLocationInfo);
}
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