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_CPA.cs | 42 +++++++++++++++---------------------------
1 files changed, 15 insertions(+), 27 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_CPA.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_CPA.cs"
index f198bbf..b4b5965 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_CPA.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_CPA.cs"
@@ -70,7 +70,7 @@
OtherDevice device = (OtherDevice)value;
List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList();
//鑾峰彇鏈夊崗璁殑杈撻�佺嚎
- List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData();
+ List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x=>x.StationDeviceCode==device.DeviceCode);
foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode)))
{
DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineCPDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
@@ -80,38 +80,26 @@
R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0 && item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) //浜屾ゼ绾夸綋鍏ュ簱绔欏彴->鍫嗗灈鏈�
{
- //鑾峰彇鍏ュ簱绔欏彴鏄惁瀛樺湪鍏ュ簱浠诲姟
Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
if (task != null)
{
- Dt_StationManger stationManger = stationMangers.FirstOrDefault(x => x.StationCode == task.SourceAddress);
- if (stationManger != null)
+ //鍒嗛厤璐т綅
+ string? local = _taskService.RequestAssignLocation(task.TaskNum, task.Roadway);
+ //鍒嗛厤璐т綅
+ if (!string.IsNullOrEmpty(local))
{
- string? local = "";
- switch (stationManger.AGVStationCode.ObjToInt() % 2)
- {
- case 1:
- local = task.Roadway + "-001-062-001-01";
- break;
- case 0:
- local = task.Roadway + "-002-062-001-01";
- break;
- default:
- WriteError(item.StationName, $"鏈壘鍒板彲鍒嗛厤宸烽亾{task.TaskNum}");
- break;
- }
- //鍒嗛厤璐т綅
- if (!string.IsNullOrEmpty(local))
- {
- task.CurrentAddress = item.StackerCraneStationCode;
- task.TargetAddress = local;
- task.NextAddress = local;
- task.DeviceCode = item.StackerCraneCode;
- _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
- WriteInfo(item.StationName, $"浠诲姟鍙�:{task.TaskNum}杩涜鍫嗗灈鏈哄叆搴�");
- }
+ task.CurrentAddress = item.StackerCraneStationCode;
+ task.TargetAddress = local;
+ task.NextAddress = local;
+ task.DeviceCode = item.StackerCraneCode;
+ _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
+ WriteInfo(item.StationName, $"浠诲姟鍙�:{task.TaskNum}杩涜鍫嗗灈鏈哄叆搴�");
}
}
+ else
+ {
+ WriteError(item.StationName, $"鏈壘鍒皗item.StationCode}鐨勪换鍔conveyorLineInfoRead.TaskNo}");
+ }
}
else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0 && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()) //浜屾ゼ绾夸綋鍑哄簱绔欏彴
{
--
Gitblit v1.9.3