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 | 73 ++++++++++++++++++++++++++++++++----
1 files changed, 64 insertions(+), 9 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 89cb35a..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);
@@ -843,7 +848,32 @@
#endregion 閲嶅啓鏂规硶
-
+ #region
+ public WebResponseContent UpWheelsFlow(SaveModel saveModel)
+ {
+ WebResponseContent webResponse = new WebResponseContent();
+ try
+ {
+ string CZTM = saveModel.MainData["CZTM"].ToString();
+ string TargetAddress = saveModel.MainData["TargetAddress"].ToString();
+ List<Dt_Task> taskt = BaseDal.QueryData(x => x.task_CZInfo == CZTM).ToList();
+ if (taskt.Count() == 0)
+ return webResponse.Error($"鏈壘鍒板搴旇溅杞达細{CZTM}鐨勮溅杞嚭搴撲俊鎭�");
+ foreach (var item in taskt)
+ {
+ item.Towhereabouts = TargetAddress;
+ }
+ BaseDal.UpdateData(taskt);
+ return webResponse.OK("淇敼鎴愬姛锛�");
+ }
+ catch (Exception ex)
+ {
+ // 濡傛灉鍙戠敓寮傚父锛屽垯璋冪敤content.Error鏂规硶锛岃褰曢敊璇俊鎭紝骞惰緭鍑洪敊璇俊鎭�
+ webResponse.Error(ex.Message);
+ return webResponse;
+ }
+ }
+ #endregion
@@ -914,7 +944,7 @@
//璇诲彇鐢宠锛岀粰agv涓嬪彂浠诲姟
- public WebResponseContent GetAGVTaskdistribution(string TargetAddress)
+ public WebResponseContent GetAGVTaskdistribution(string TargetAddress,string Number)
{
WebResponseContent content = new WebResponseContent();
@@ -927,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