From 5a15fa73d5f6a39917013871a65eb11a8c013391 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 05 十一月 2025 17:30:56 +0800
Subject: [PATCH] 1
---
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ElevatorJob/CommonElevatorJob.cs | 77 ++++++++++++++++++++++++++++++++++++--
1 files changed, 72 insertions(+), 5 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ElevatorJob/CommonElevatorJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ElevatorJob/CommonElevatorJob.cs"
index c9d73ed..9f1c2cf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ElevatorJob/CommonElevatorJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ElevatorJob/CommonElevatorJob.cs"
@@ -1,11 +1,15 @@
-锘縰sing Quartz;
+锘縰sing Masuit.Tools;
+using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_BasicInfoService;
+using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -13,6 +17,7 @@
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
+using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_Tasks.ElevatorJob;
namespace WIDESEAWCS_Tasks
@@ -20,9 +25,16 @@
[DisallowConcurrentExecution]
public partial class CommonElevatorJob : JobBase, IJob
{
- public CommonElevatorJob()
+ private readonly ITaskRepository _taskRepository;
+ private readonly ITask_HtyRepository _taskhtyRepository;
+ private readonly ITaskService _taskService;
+ private readonly IDt_StationManagerRepository _stationManagerRepository;
+ public CommonElevatorJob(ITaskRepository taskRepository, ITaskService taskService, IDt_StationManagerRepository stationManagerRepository, ITask_HtyRepository taskhtyRepository)
{
-
+ _taskRepository = taskRepository;
+ _taskService = taskService;
+ _stationManagerRepository = stationManagerRepository;
+ _taskhtyRepository = taskhtyRepository;
}
public Task Execute(IJobExecutionContext context)
@@ -33,9 +45,64 @@
if(elevator != null)
{
//鑾峰彇鎻愬崌鏈哄綋鍓嶆ā寮�0-鎵嬪姩\鏁呴殰銆佺淮鎶ゆā寮忥紝1-鑷姩妯″紡
- var x = elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.Model);
+ if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.Model) == 1)
+ {
+ var task = _taskService.QueryRequestTSJSignalTask();
-
+ if (task != null && task.AGVSign == "RequestPickUp")
+ {
+
+ if (task.TaskState == (int)TaskAcrossFloorStatusEnum.SecondCarry)
+ {
+ if (task.Floor == "1F")
+ {
+ if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.OneLayerAllowPickUp) == 1)
+ {
+ _taskService.ContinueAgvTask(task.AGVTaskNum);
+ task.AGVSign = "";
+ _taskRepository.UpdateData(task);
+ }
+ }
+ else
+ {
+ if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.TwoLayerAllowPickUp) == 1)
+ {
+ _taskService.ContinueAgvTask(task.AGVTaskNum);
+ task.AGVSign = "";
+ _taskRepository.UpdateData(task);
+ }
+ }
+ }
+
+ }
+
+ if (task != null && task.AGVSign == "RequestPut")
+ {
+ if (task.TaskState == (int)TaskAcrossFloorStatusEnum.FirstCarry)
+ {
+ if (task.Floor == "1F")
+ {
+ if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.OneLayerAllowPut) == 1)
+ {
+ _taskService.ContinueAgvTask(task.AGVTaskNum);
+ task.AGVSign = "";
+ _taskRepository.UpdateData(task);
+ }
+ }
+ else
+ {
+ if (elevator.GetValue<ElevatorDBName, short>(ElevatorDBName.TwoLayerAllowPut) == 1)
+ {
+ _taskService.ContinueAgvTask(task.AGVTaskNum);
+ task.AGVSign = "";
+ _taskRepository.UpdateData(task);
+ }
+
+ }
+ }
+ }
+
+ }
}
return Task.CompletedTask;
}
--
Gitblit v1.9.3