From 695571c6009ecbc12e7d4a4fb147df7967a1260e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 07 七月 2025 20:21:19 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/辅料仓/AGV_FLExtend.cs | 65 +++++++++++++++++++++++++++++++-
1 files changed, 62 insertions(+), 3 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/AGV_FLExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/AGV_FLExtend.cs"
index 5770b32..1101c7f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/AGV_FLExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/AGV_FLExtend.cs"
@@ -8,7 +8,9 @@
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.Agv;
using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
namespace WIDESEAWCS_Tasks
@@ -22,19 +24,22 @@
{
try
{
- var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && nameof(AGV_FLJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
+ var newTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => ((x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt() && x.TaskType>=TaskTypeEnum.Inbound.ObjToInt())
+ || (x.TaskState == TaskStatusEnum.New.ObjToInt() && x.TaskType < TaskTypeEnum.Inbound.ObjToInt()))
+ && nameof(AGV_FLJob).Contains(x.DeviceCode)
+ && !string.IsNullOrEmpty(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
foreach (var task in newTasks)
{
try
{
- if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt())
+ if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt())
task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
else
task.NextAddress = GetAGVAddress(task.NextAddress);
AgvTaskDTO taskDTO = new AgvTaskDTO()
{
TaskCode = task.AgvTaskNum,
- ReqCode = DateTime.Now.ToString("yyyyMMddHHmmss") + task.AgvTaskNum,
+ ReqCode = DateTime.Now.ToString("yyyyMMdd") + task.AgvTaskNum,
TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "FLC" : "FLR",
ctnrCode = task.PalletCode,
PositionCodePath = new List<CodePath>()
@@ -71,6 +76,60 @@
}
}
/// <summary>
+ /// AGV鍙栨斁璐у洖璋�
+ /// </summary>
+ public void ContinueAGVTask()
+ {
+ try
+ {
+ //鑾峰彇鏄惁鏈夊畨鍏ㄧ敵璇蜂腑鐨勪换鍔�
+ var continueTasks = _taskService.Db.Queryable<Dt_Task>().Where(x => (x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt()) && nameof(AGV_FLJob).Contains(x.DeviceCode)).ToList().OrderBy(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
+ foreach (var continueTask in continueTasks)
+ {
+ Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == continueTask.NextAddress);
+ if (stationManger == null)
+ {
+ continue;
+ }
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
+ if (device == null)
+ {
+ continue;
+ }
+ OtherDevice otherDevice = (OtherDevice)device;
+ bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
+ if (!canPut)
+ {
+ continue;
+ }
+ //鑾峰彇璋冨叆鍙傛暟
+ AGVBoxApplyPassDTO boxApplyPassDTO = new AGVBoxApplyPassDTO()
+ {
+ ReqCode = Guid.NewGuid().ToString().Replace("-", ""),
+ ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+ TaskCode = continueTask.AgvTaskNum
+ };
+ boxApplyPassDTO.Type = "2";
+ //璇锋眰鏂欑鍥炶皟鎺ュ彛
+ WebResponseContent content = _taskService.AgvBoxApplyPass(boxApplyPassDTO);
+ if (content.Status && boxApplyPassDTO.TaskCode == continueTask.AgvTaskNum)
+ {
+ _taskService.UpdateTask(continueTask, TaskStatusEnum.AGV_Puting);
+ }
+ else
+ {
+ continueTask.ExceptionMessage = content.Message;
+ _taskService.UpdateTask(continueTask, TaskStatusEnum.Exception);
+ }
+ }
+
+ }
+ catch (Exception ex)
+ {
+ WriteError(nameof(AGV_CPJob), ex.Message, ex);
+ }
+ }
+ /// <summary>
/// 鑾峰彇AGV鍦板潃
/// </summary>
/// <param name="Address"></param>
--
Gitblit v1.9.3