From 733c975cd8647f6d006736f1863bad731e32e6fb Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期日, 26 十月 2025 17:15:52 +0800
Subject: [PATCH] 上传最新代码,ERP接口,MES接口优化,WMS业务优化等
---
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs | 75 ++++++++++++++++++++++---------------
1 files changed, 45 insertions(+), 30 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
index 8e1d69a..7169de3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
@@ -7,9 +7,14 @@
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks;
+using WIDESEAWCS_Tasks.ConveyorLineJob;
+using WIDESEAWCS_Tasks.DBNames;
+using WIDESEAWCS_Tasks.StackPlateJob;
namespace WIDESEAWCS_WCSServer.Controllers.Task
{
@@ -20,11 +25,13 @@
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IRouterExtension _routerExtension;
//private readonly WebSocketServer _webSocketServer;
+ private readonly IStationMangerRepository _stationMangerRepository;
- public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/) : base(service)
+ public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/, IStationMangerRepository stationMangerRepository) : base(service)
{
_httpContextAccessor = httpContextAccessor;
_routerExtension = routerExtension;
+ _stationMangerRepository=stationMangerRepository;
//_webSocketServer = webSocketServer;
}
@@ -64,26 +71,10 @@
return Service.RollbackTaskStatusToLast(taskNum);
}
- /// <summary>
- /// 鍥炲AGV瀹夊叏淇″彿
- /// </summary>
- /// <param name="taskNum"></param>
- /// <returns></returns>
- [HttpPost, HttpGet, Route("SendSecureReplyToAgv")]
- public WebResponseContent SendSecureReplyToAgv(int taskNum)
- {
- return Service.SendSecureReplyToAgv(taskNum);
- }
-
[HttpPost, HttpGet, Route("GetRouteEndPoint"), AllowAnonymous]
public WebResponseContent GetRouteEndPoint(string startPoint, int routeType)
{
return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType));
- }
- [HttpPost, HttpGet, Route("AgvCarrying"), AllowAnonymous]
- public WebResponseContent AgvCarrying(int row, int startColumn, int endColumn, int layer, int targetLayer)
- {
- return Service.AgvCarrying(row, startColumn, endColumn, layer, targetLayer);
}
/// <summary>
/// 娴嬭瘯鍫嗗灈鏈哄嚭搴�
@@ -107,6 +98,11 @@
};
return Service.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
}
+ [HttpPost, HttpGet, Route("AssignCPRoadwayNo"), AllowAnonymous]
+ public WebResponseContent AssignCPRoadwayNo()
+ {
+ return Service.AssignCPRoadwayNo();
+ }
/// <summary>
/// 璇锋眰鍏ュ簱浠诲姟
/// </summary>
@@ -119,23 +115,42 @@
{
return Service.RequestWMSTaskSimple(palletCode,sourceAddress, roadWay, taskType);
}
- //[HttpPost, HttpGet, Route("WebSocketPushMessage"), AllowAnonymous]
- //public WebResponseContent WebSocketPushMessage(string message)
- //{
- // try
- // {
- // _webSocketServer.PublishAllClientPayload(message);
- // return WebResponseContent.Instance.OK();
- // }
- // catch(Exception ex)
- // {
- // return WebResponseContent.Instance.Error(ex.Message);
- // }
- //}
+ /// <summary>
+ /// WMS浠诲姟瀹屾垚鍚屾
+ /// </summary>
+ /// <param name="taskNum"></param>
+ /// <returns></returns>
[HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous]
public WebResponseContent RecWMSTaskCompleted(int taskNum)
{
return Service.RecWMSTaskCompleted(taskNum);
}
+ [HttpPost, HttpGet, Route("YLPurchasePush"), AllowAnonymous]
+ public WebResponseContent YLPurchasePush(string code)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == code);
+
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
+ if (device == null)
+ {
+ return content.Error($"鏈壘鍒板搴旇澶�");
+ }
+ OtherDevice otherDevice = (OtherDevice)device;
+ short request = otherDevice.GetValue<WR_CLineYLDB, short>(WR_CLineYLDB.WR_Request, stationManger.StationCode);
+ if (request!=86)
+ {
+ return content.Error($"璁惧鐘舵�佷笉鍏佽鍚姩");
+ }
+ otherDevice.SetValue(WR_CLineYLDB.WR_Reresult, 86, stationManger.StationCode);
+ return content.OK();
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ }
}
}
--
Gitblit v1.9.3