From ec3daa05f122738f18d4474b9257e4cf794dc5cf Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期五, 06 三月 2026 10:36:01 +0800
Subject: [PATCH] 接口新增
---
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 46 ++++++++++++++++++++++++++++++++++++++--------
1 files changed, 38 insertions(+), 8 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index d91155a..0497e3b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -815,6 +815,11 @@
return BaseDal.QueryFirst(x => x.PalletCode == barcode && x.NextAddress == nextAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting), TaskOrderBy);
}
+ public Dt_Task QueryOutTaskByBarcode(string barcode)
+ {
+ return BaseDal.QueryFirst(x => x.PalletCode == barcode && x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting, TaskOrderBy);
+ }
+
private string GetIpAddress(string baseIp, string name)
{
var configz = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
@@ -939,7 +944,7 @@
//璇诲彇鐢宠锛岀粰agv涓嬪彂浠诲姟
- public WebResponseContent GetAGVTaskdistribution(string TargetAddress)
+ public WebResponseContent GetAGVTaskdistribution(string TargetAddress,string Number)
{
WebResponseContent content = new WebResponseContent();
@@ -952,16 +957,41 @@
{
throw new InvalidOperationException("WMS IP 鏈厤缃�");
}
- var wmsIpAddress = wmsBase + completeTask;
- var taskDto = new RequestTaskDto()
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "1000");
+ CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
+ DeviceProDTO? deviceProDTOt = conveyorLine.DeviceProDTOs.Find(x => x.DeviceChildCode == TargetAddress && x.DeviceProParamName == "ConveyorLineSingal");
+ if (conveyorLine.Communicator.Read<short>(deviceProDTOt.DeviceProAddress) == 1)
{
- RequestType = "999",
- Position = TargetAddress,
- };
- var result = HttpHelper.PostAsync(wmsIpAddress, taskDto.ToJsonString()).Result;
- content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+ var wmsIpAddress = wmsBase + completeTask;
+ var taskDto = new RequestTaskDto()
+ {
+ RequestType = "999",
+ Position = TargetAddress,
+ };
+
+
+ var result = HttpHelper.PostAsync(wmsIpAddress, taskDto.ToJsonString()).Result;
+ content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+ if (content.Status)
+ {
+ List<Dt_Task> tasks = BaseDal.QueryData(x => x.axle_czh == Number);
+ if (tasks.Count > 0)
+ {
+ foreach (var task in tasks)
+ {
+ task.Towhereabouts = TargetAddress;
+ }
+ BaseDal.UpdateData(tasks);
+ }
+ }
+ }
+ else
+ {
+ content.Error();
+ }
+
return content;
}
catch (Exception ex)
--
Gitblit v1.9.3