From 5c272c606bdf2da3577dbaa5f48d0ee163f1e7d2 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 26 三月 2026 10:35:24 +0800
Subject: [PATCH] 纸张淋膜半成品入库逻辑优化
---
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/ConveyorLineJob_YL1ndFloor.cs | 52 +++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 39 insertions(+), 13 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 3d32d3f..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);
@@ -120,22 +122,26 @@
if (string.IsNullOrEmpty(task.Roadway) && string.IsNullOrEmpty(task.NextAddress))
{
WebResponseContent content = _taskService.AssignYLRoadwayNo(task.PalletCode,weight: conveyorLineInfoRead.WR_Weight, thickness: conveyorLineInfoRead.WR_Height, wide: conveyorLineInfoRead.WR_Width);
- if (!content.Status)
+ 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
{
@@ -217,6 +223,26 @@
}
}
}
+ 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
{
WriteError(item.StationName, $"鏈壘鍒拌澶囧瓙缂栧彿{item.StationCode}鐨勫崗璁俊鎭�");
--
Gitblit v1.9.3