From 531c6e89dc07bb6997e6249a6cd9f53a9bd474a5 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 23 三月 2026 10:31:54 +0800
Subject: [PATCH] 出库逻辑变更
---
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPB.cs | 48 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 34 insertions(+), 14 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs"
index 640efb0..a631447 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs"
@@ -1,7 +1,6 @@
锘縰sing Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using Quartz;
-using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,6 +10,7 @@
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
+using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
@@ -101,16 +101,24 @@
WriteError(item.StationName, $"璺敱淇℃伅閰嶇疆閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
continue;
}
- device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
- device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
- device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
- task.CurrentAddress = item.StationCode;
- task.NextAddress = router.NextPosi;
- task.PalletCode = conveyorLineInfoRead.PalletCode;
- task.Roadway = roadWay;
- task.DeviceCode = router.ChildPosiDeviceCode;
- _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
- WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
+ WebResponseContent responseContent = _taskService.RequestInBoundPalletCode(task.TaskNum, conveyorLineInfoRead.PalletCode.Trim());
+ if (responseContent.Status)
+ {
+ device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
+ device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
+ device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
+ task.CurrentAddress = item.StationCode;
+ task.NextAddress = router.NextPosi;
+ task.PalletCode = conveyorLineInfoRead.PalletCode.Trim();
+ task.Roadway = roadWay;
+ task.DeviceCode = router.ChildPosiDeviceCode;
+ _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
+ WriteInfo(item.StationName, $"浠诲姟鍙穥task.TaskNum}涓嬩竴姝ュ埌杈緖router.NextPosi}鍏ュ簱绔欏彴");
+ }
+ else
+ {
+ WriteError(item.StationName, $"浠诲姟鍙穥task.TaskNum}鎵爜璇锋眰閿欒{responseContent.Message}");
+ }
}
else
{
@@ -124,6 +132,10 @@
else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && deviceProRead != null)
{//鍏ュ簱RGV鎺ラ┏浣嶄氦浜�
R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
+ if (conveyorLineInfoRead != null)
+ {
+ WriteInfo(item.StationName, $"鐘舵�亄conveyorLineInfoRead.Serialize()}");
+ }
if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo > 0)
{
Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode);
@@ -212,8 +224,9 @@
}
}
}
- else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && deviceProRead != null && deviceProWrite != null)
- {//鍙犵洏鏈哄伐浣嶅彨鏂�
+ else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && item.IsOccupied==StationOccupiedEnum.None.ObjToInt() && deviceProRead != null && deviceProWrite != null)
+ {
+ //鍙犵洏鏈哄伐浣嶅彨鏂�
R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 7 && conveyorLineInfoRead.TaskNo <= 0)
@@ -223,7 +236,14 @@
{
//璇锋眰浠诲姟
WebResponseContent content = _taskService.RequestPlateOutTask(item.StationCode);
- WriteInfo(item.StationName, $"浜屾ゼ绌烘墭鍙犵洏鍑哄簱浠诲姟鐢熸垚");
+ if (content.Status)
+ {
+ WriteInfo(item.StationName, $"浜屾ゼ绌烘墭鍙犵洏鍑哄簱浠诲姟鐢熸垚");
+ }
+ else
+ {
+ WriteInfo(item.StationName, $"{content.Message}");
+ }
}
}
//鍙犵洏浠诲姟瀹屾垚浜や簰
--
Gitblit v1.9.3