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_YL1ndFloor.cs | 65 +++++++++++++++++++++++++-------
1 files changed, 51 insertions(+), 14 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs"
index d35385c..41be831 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/ConveyorLineJob_YL1ndFloor.cs"
@@ -12,6 +12,7 @@
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -73,6 +74,7 @@
foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode)))
{
DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(WR_CLineYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
+ DeviceProDTO? deviceErrRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ErrorYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
if (deviceProRead != null)
{
R_ConveyorLineYLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineYLInfo>(deviceProRead.DeviceProAddress);
@@ -119,23 +121,27 @@
{
if (string.IsNullOrEmpty(task.Roadway) && string.IsNullOrEmpty(task.NextAddress))
{
- WebResponseContent content = _taskService.AssignYLRoadwayNo(task.PalletCode);
- if (!content.Status)
+ WebResponseContent content = _taskService.AssignYLRoadwayNo(task.PalletCode,weight: conveyorLineInfoRead.WR_Weight, thickness: conveyorLineInfoRead.WR_Height, wide: conveyorLineInfoRead.WR_Width);
+ if (content.Status)
+ {
+ string roadWay = content.Data.ToString();
+ //鑾峰彇璺敱閰嶇疆
+ List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi && x.ChildPosiDeviceCode == roadWay);
+ Dt_Router router = routers.FirstOrDefault();
+ if (router == null)
+ {
+ WriteError(item.StationName, $"浠诲姟鍙�:{task.TaskNum}鏈壘鍒拌矾鐢遍厤缃俊鎭�");
+ return Task.CompletedTask;
+ }
+ task.Roadway = roadWay;
+ task.NextAddress = router.NextPosi;
+ _taskService.UpdateTask(task, TaskStatusEnum.AGV_Finish);
+ }
+ else
{
WriteError(item.StationCode, $"璇锋眰鍏ュ簱澶辫触锛歿content.Message}");
}
- string roadWay = content.Data.ToString();
- //鑾峰彇璺敱閰嶇疆
- List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi && x.ChildPosiDeviceCode== roadWay);
- Dt_Router router = routers.FirstOrDefault();
- if (router == null)
- {
- WriteError(item.StationName, $"浠诲姟鍙�:{task.TaskNum}鏈壘鍒拌矾鐢遍厤缃俊鎭�");
- return Task.CompletedTask;
- }
- task.Roadway = roadWay;
- task.NextAddress = router.NextPosi;
- _taskService.UpdateTask(task,TaskStatusEnum.AGV_Finish);
+
}
else
{
@@ -205,6 +211,37 @@
WriteInfo(item.StationCode, $"浠诲姟鍙�:{task.TaskNum}锛孯IFD{task.RfidCode}涓�妤煎嚭搴撹嚦鑰佸巶鎴垮畬鎴�");
}
}
+ else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && conveyorLineInfoRead.WR_Task <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.WR_TMID) && conveyorLineInfoRead.WR_Request == 98) //涓�妤艰�佸巶鍑哄簱鍙e畬鎴�
+ {
+ Dt_Task task = _taskRepository.QueryFirst(x => (x.RfidCode == conveyorLineInfoRead.WR_TMID || x.PalletCode== conveyorLineInfoRead.WR_TMID) && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
+ if (task != null)
+ {
+ //浠诲姟鍥炲
+ device.SetValue(WR_CLineYLDB.WR_Reresult, 98, item.StationCode);
+ _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, deviceCode: "CL3_YL");
+ WriteInfo(item.StationCode, $"浠诲姟鍙�:{task.TaskNum}锛孯IFD{task.RfidCode}涓�妤煎嚭搴撹嚦鑰佸巶鎴垮畬鎴�");
+ }
+ }
+ }
+ else if (deviceErrRead!=null)
+ {
+ R_ErrorYLDB errorYLDB = device.Communicator.ReadCustomer<R_ErrorYLDB>(deviceErrRead.DeviceProAddress);
+ if (errorYLDB != null && errorYLDB.R_Error==2)
+ {
+ ErrorDeviceInfo? errorDeviceInfo = RoadwayError.Roadways.FirstOrDefault(x=>x.Code==item.StationCode);
+ if (errorDeviceInfo==null)
+ {
+ RoadwayError.Roadways.Add(new ErrorDeviceInfo() { Code = item.StationCode, Roadway = item.StackerCraneCode });
+ }
+ }
+ else if(errorYLDB != null && errorYLDB.R_Error == 1)
+ {
+ ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == item.StationCode);
+ if (deviceInfo != null)
+ {
+ RoadwayError.Roadways.Remove(deviceInfo);
+ }
+ }
}
else
{
--
Gitblit v1.9.3