From daea1a90c2fa1b5cc2f52e62be15bd95cc4155f6 Mon Sep 17 00:00:00 2001
From: Tiandele <tiandele@hnkhzn.com>
Date: 星期五, 20 三月 2026 17:16:04 +0800
Subject: [PATCH] 优化手动锁车逻辑
---
项目代码/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs | 53 +++++++++++++++++++++++++++++++++++------------------
1 files changed, 35 insertions(+), 18 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs"
index 9fc8e9d..96a18d1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs"
@@ -82,11 +82,11 @@
_stationManagerRepository = stationManagerRepository;
}
- static Dictionary<string, string> TCRoadWay = new Dictionary<string, string>()
- {
- { "TC05", "SC02-SC04" },
- { "TC06", "SC06-SC08" },
- };
+ //static Dictionary<string, string> TCRoadWay = new Dictionary<string, string>()
+ //{
+ // { "TC05", "SC02-SC04" },
+ // { "TC06", "SC06-SC08" },
+ //};
public async Task Execute(IJobExecutionContext context)
{
@@ -105,11 +105,24 @@
Dt_Task task = null;
if (station.stationChildCode == "TC05")
{
+ //var executeTaks = _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState <= (int)TaskOutStatusEnum.SC_OutFinish).OrderBy(x => x.CreateDate).FirstOrDefault();
+
var leftTask = _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState <= (int)TaskOutStatusEnum.SC_OutFinish).OrderBy(x => x.CreateDate).FirstOrDefault();
if (leftTask != null && leftTask.TaskState == (int)TaskOutStatusEnum.SC_OutFinish)
{
task = leftTask;
+ }
+
+ if (task != null)
+ {
+ _taskService.UpdateTaskStatusToNext(task.TaskNum, (int)TaskOutStatusEnum.SC_OutFinish);
+
+ var sattion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress);
+ WriteDebug("CommonConveyorLineTTJob浠诲姟", $"浠诲姟锛歿task.Serialize()}锛岀珯鍙颁俊鎭細{sattion.Serialize()}");
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.GetConvNo, Convert.ToInt16(sattion.stationTCLocation), station.stationChildCode);
+ conveyorLine.SetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI_W, task.PVI, station.stationChildCode);
+ //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
}
}
else if (station.stationChildCode == "TC06")
@@ -120,18 +133,18 @@
{
task = rightTask;
}
- }
- //var task = _taskRepository.QueryData(X => X.NextAddress == station.stationChildCode).OrderBy(x => x.CreateDate).FirstOrDefault();
- if (task != null)
- {
- _taskService.UpdateTaskStatusToNext(task.TaskNum);
- var sattion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress);
- conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.GetConvNo, Convert.ToInt16(sattion.stationTCLocation), station.stationChildCode);
- conveyorLine.SetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI_W, task.PVI, station.stationChildCode);
- //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+ if (task != null)
+ {
+ _taskService.UpdateTaskStatusToNext(task.TaskNum, (int)TaskOutStatusEnum.SC_OutFinish);
+
+ var sattion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress);
+ WriteDebug("CommonConveyorLineTTJob浠诲姟", $"浠诲姟锛歿task.Serialize()}锛岀珯鍙颁俊鎭細{sattion.Serialize()}");
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.GetConvNo, Convert.ToInt16(sattion.stationTCLocation), station.stationChildCode);
+ conveyorLine.SetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI_W, task.PVI, station.stationChildCode);
+ //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+ }
}
- //;
}
var Putrequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.Spare2, station.stationChildCode);//妯Щ鏈鸿浇璐ф斁杞︿俊鍙�
@@ -144,9 +157,13 @@
{
if (station.stationChildCode == "TC05")
{
- var task = _taskRepository.QueryData(X => X.TargetAddress == "RB043" && (X.NextAddress == station.stationChildCode /*|| X.CurrentAddress == station.stationChildCode*/)).OrderBy(x => x.CreateDate).FirstOrDefault();
- _taskService.UpdatePosition(task.TaskNum, station.stationChildCode);
- conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+ var task = _taskRepository.QueryData(X => X.TargetAddress == "RB043" && (X.NextAddress == station.stationChildCode && X.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting/*|| X.CurrentAddress == station.stationChildCode*/)).OrderBy(x => x.CreateDate).FirstOrDefault();
+
+ if (task != null)
+ {
+ _taskService.UpdatePosition(task.TaskNum, station.stationChildCode);
+ conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+ }
}
else
{
--
Gitblit v1.9.3