From 257d09aff7ec7b858b037607869d23ec61ac75bc Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期二, 19 八月 2025 09:03:49 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs | 80 +++++++++++----------------------------
1 files changed, 23 insertions(+), 57 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
index ede1df3..a65687c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
@@ -1,4 +1,5 @@
锘縰sing Newtonsoft.Json;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using Quartz;
using SqlSugar;
using System;
@@ -98,7 +99,22 @@
ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>();
ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>();
-
+ //婊℃墭鎷夎浇鍑�
+ if (item.StationType == StationTypeEnum.StationType_PakcPallet.ObjToInt())
+ {
+ if (conveyorLineSignalRead.STB && !conveyorLineSignalWrite.ACK)
+ {
+ device.SetValue(W_ConveyorLineDB.TaskNum, 1, item.StationCode);
+ device.SetValue(W_ConveyorLineDB.StartPos, item.StationCode, item.StationCode);
+ device.SetValue(W_ConveyorLineDB.EndPos, 1102, item.StationCode);
+ device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
+ device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+ }
+ else if(!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK)
+ {
+ device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
+ }
+ }
if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
{
{
@@ -106,14 +122,6 @@
Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) /*&& x.DeviceCode == item.StationDeviceCode*/ && (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.WarehouseId == warehouseDevice.WarehouseId);
if (task != null && conveyorLineInfoWrite.Spare2 == 0 && conveyorLineStatus.Goods)
{
- //List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
- ////鍒嗛厤宸烽亾
- //WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
- //if (responseContent.Status)
- //{
- // device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode);
- // _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? "");
- //}
device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode);
_taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode);
}
@@ -131,7 +139,7 @@
{
if (conveyorLineInfoRead.TaskNum == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
{
- #region 浠诲姟鍙蜂负0锛屼笖鏈夋墭鐩樺彿锛屽垯鏄噰璐叆搴�
+ #region 浠诲姟鍙蜂负0锛屼笖鏈夋墭鐩樺彿锛屽垯鏄汉宸ユ斁璐у叆搴�
Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && (x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()) && x.PalletCode == conveyorLineInfoRead.Barcode && x.WarehouseId == warehouseDevice.WarehouseId);
if (task != null)
{
@@ -213,19 +221,15 @@
else//鐢熶骇閫�搴� //鎹㈠贩閬撳叆搴�
{
#region 鐢熶骇閫�搴�,甯︿换鍔″彿鏌ヨ浠诲姟
- Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId); // 甯︿换鍔″彿鏌ヨ浠诲姟
- Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 甯︿换鍔″彿鏌ヨ浠诲姟
- if (task != null)
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); // 甯︿换鍔″彿鏌ヨ浠诲姟 閫�鏂欎换鍔�
+ Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 甯︿换鍔″彿鏌ヨ浠诲姟 鍏ュ簱
+ if (task != null) //閫�鏂欎换鍔� 璧风偣鍏ュ簱绔欏彴
{
List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
if (responseContent.Status)
{
- //string currentAddress = task.CurrentAddress;
- //string nextAddress = task.NextAddress;
- //string targetAddress = task.TargetAddress;
string roadwayNo = task.Roadway;
-
string currentAddress = task.CurrentAddress;
string nextAddress = task.NextAddress;
string targetAddress = task.TargetAddress;
@@ -244,7 +248,7 @@
continue;
}
- if (router.IsEnd)
+ if (router.IsEnd) //褰撳墠璧风偣鍏ュ簱绔欏彴鐩存帴鍏ュ簱
{
string? targetLoca = _taskService.RequestAssignLocationByHeight(task.TaskNum, responseContent.Data.ToString(), conveyorLineInfoRead.Spare2);
if (!string.IsNullOrEmpty(targetLoca))
@@ -264,7 +268,7 @@
continue;
}
}
- else
+ else //鎹㈠贩閬撳垎閰嶅叾浠栧贩閬撶殑鍏ュ簱绔欏彴
{
//task.NextAddress鍙兘鏄痳outer.NextPosi
roadwayNo = responseContent.Data.ToString();
@@ -345,50 +349,12 @@
device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
}
- //else //璋冩嫧浣跨敤
- //{
- // device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
- //}
- //{
- // task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.WarehouseId == warehouseDevice.WarehouseId);
- // if (task != null)
- // {
- // Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.CurrentAddress);
- // if (stationManger != null)
- // {
- // _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: stationManger.StackerCraneCode, currentAddress: stationManger.StackerCraneStationCode, nextAddress: task.TargetAddress);
- // }
- // }
- //}
- //else
}
else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK)
{
device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode);
}
}
- //else if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt())
- //{
- // if (!conveyorLineSignalWrite.ACK && conveyorLineSignalRead.STB && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm)
- // {
- // if (conveyorLineInfoRead.TaskNum == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閫�鏂欏叆搴�
- // {
-
- // }
- // else//鍑哄簱瀹屾垚
- // {
-
- // }
- // }
- // else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && !conveyorLineStatus.Alarm)
- // {
- // device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode);
- // }
- // else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm)
- // {
- // device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
- // }
- //}
}
else
{
--
Gitblit v1.9.3