From b04c7a175efa4cc5097729dcfd9bbea9b8cd0df2 Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期二, 24 十二月 2024 13:02:00 +0800
Subject: [PATCH] 合并
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 51 ++++++++++++++++++++-------------------------------
1 files changed, 20 insertions(+), 31 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 1e09dcf..c9b8c07 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -1,21 +1,15 @@
-锘縰sing Autofac.Core;
-using HslCommunication;
-using Mapster;
-using Newtonsoft.Json;
+锘縰sing Mapster;
using Quartz;
using System.Diagnostics.CodeAnalysis;
-using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.HttpContextUser;
-using WIDESEAWCS_DTO.MOM;
using WIDESEAWCS_IProcessRepository;
using WIDESEAWCS_ITaskInfo_HtyRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
-using WIDESEAWCS_Model;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
@@ -87,6 +81,7 @@
bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
if (sendFlag)
{
+ commonStackerCrane.SetValue(StackerCraneDBName.StartCommand, 1);
commonStackerCrane.LastTaskType = task.TaskType;
_taskService.UpdateTaskStatusToNext(task.TaskNum);
}
@@ -98,28 +93,25 @@
#region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
- if (tokenInfos == null || !tokenInfos.Any())
+ if (tokenInfos != null && tokenInfos.Any())
{
- //throw new Exception(commonStackerCrane.DeviceName + "缂撳瓨涓湭鎵惧埌Token缂撳瓨");
- return Task.CompletedTask;
- }
- var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
- var userIds = tokenInfos?.Select(x => x.UserId).ToList();
+ var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
+ var userIds = tokenInfos?.Select(x => x.UserId).ToList();
- object obj = new
- {
- commonStackerCrane.StackerCraneStatusDes,
- commonStackerCrane.StackerCraneAutoStatusDes,
- commonStackerCrane.StackerCraneWorkStatusDes,
- commonStackerCrane.DeviceCode,
- commonStackerCrane.DeviceName,
- commonStackerCrane.CurrentTaskNum,
- commonStackerCrane.LastTaskNum,
- };
- _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { commonStackerCrane.DeviceName, data = obj });
+ object obj = new
+ {
+ commonStackerCrane.StackerCraneStatusDes,
+ commonStackerCrane.StackerCraneAutoStatusDes,
+ commonStackerCrane.StackerCraneWorkStatusDes,
+ commonStackerCrane.DeviceCode,
+ commonStackerCrane.DeviceName,
+ commonStackerCrane.CurrentTaskNum,
+ commonStackerCrane.LastTaskNum,
+ };
+ _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { commonStackerCrane.DeviceName, data = obj });
+ }
#endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
-
}
}
catch (Exception ex)
@@ -303,7 +295,7 @@
if (device != null)
{
CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
- //if (conveyorLine.IsOccupied(router.ChildPosi))//鍑哄簱绔欏彴鏈鍗犵敤
+ if (conveyorLine.IsOccupiedx(router.ChildPosi))//鍑哄簱绔欏彴鏈鍗犵敤
{
return task;
}
@@ -320,7 +312,6 @@
}
return null;
}
-
/// <summary>
/// 鏌ユ壘鍏朵粬鍑哄簱浠诲姟鐨勮緟鍔╂柟娉曪紙鎺掗櫎鎸囧畾浠诲姟ID鐨勪换鍔★級
@@ -347,7 +338,7 @@
{
return candidateTask;
}
- ConsoleHelper.WriteErrorLine($"浠诲姟鍙凤細銆恵occupiedStation.TaskNum}銆戝嚭搴撳湴鍧�锛氥�恵occupiedStation.NextAddress}銆戜笉鍏佽鏀捐揣");
+ ConsoleHelper.WriteErrorLine($"浠诲姟鍙凤細銆恵candidateTask.TaskNum}銆戝嚭搴撳湴鍧�锛氥�恵candidateTask.NextAddress}銆戜笉鍏佽鏀捐揣");
}
return null;
@@ -367,7 +358,7 @@
stackerCraneTaskCommand.TaskNum = task.TaskNum;
stackerCraneTaskCommand.WorkType = 1;
stackerCraneTaskCommand.TrayType = 0;
- stackerCraneTaskCommand.StartCommand = 1;
+ //stackerCraneTaskCommand.StartCommand = 1;
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
{
if (task.SourceAddress == "1359-4" && task.Roadway.Contains("JZ"))
@@ -444,7 +435,6 @@
}
else
{
-
if (task.TargetAddress == "002-021-001" && task.Roadway.Contains("JZ") && task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
{
string[] endCodes = task.NextAddress.Split("-");
@@ -518,6 +508,5 @@
}
return stackerCraneTaskCommand;
}
-
}
}
\ No newline at end of file
--
Gitblit v1.9.3