From 1e12c140c041c0cb52306a0db9ff0ba18354d0d8 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 03 四月 2025 18:01:52 +0800
Subject: [PATCH] 优化WMS前端首页,货位查询column数据库关键字处理
---
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs | 62 ++++++++++++++++++++----------
1 files changed, 41 insertions(+), 21 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
index b05ad95..9c8b38c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ShuttleCarJob/ShuttleCarJob.cs"
@@ -14,6 +14,7 @@
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.WMSInfo;
using WIDESEAWCS_IShuttleCar;
+using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
@@ -31,15 +32,17 @@
partial class CommonShuttleCarJob : JobBase, IJob
{
private readonly ITaskService _taskService;
+ private readonly ITaskRepository _taskRepository;
private readonly ITaskHtyService _taskHtyService;
private readonly IShuttleCarService _shuttleCarService;
private readonly ITaskExecuteDetailService _taskExecuteDetailService;
private readonly IRouterService _routerService;
private readonly IMapper _mapper;
- public CommonShuttleCarJob(ITaskService taskService, ITaskHtyService taskHtyService, IShuttleCarService shuttleCarService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper)
+ public CommonShuttleCarJob(ITaskService taskService, ITaskRepository taskRepository, ITaskHtyService taskHtyService, IShuttleCarService shuttleCarService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper)
{
_taskService = taskService;
+ _taskRepository = taskRepository;
_taskHtyService = taskHtyService;
_shuttleCarService = shuttleCarService;
_taskExecuteDetailService = taskExecuteDetailService;
@@ -54,44 +57,61 @@
ShuttleCar shuttleCar = (ShuttleCar)context.JobDetail.JobDataMap.Get("JobParams");
if (shuttleCar != null)
{
+ shuttleCar.Communicator.IsReadAfterWrite = false;
ShuttleCarTaskCommandR command = ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar, shuttleCar.DeviceCode);//璇诲彇绌挎杞︿俊鎭�
if (command != null && command.JoinStatus == 1)
{
#region 绌挎杞︿换鍔″畬鎴�
- if (command.TaskTypeComplete > (short)ShuttleCarTaskComplete.Standby)
+ var complete = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.TaskComplete);
+ if (complete && command.TaskTypeComplete > (short)ShuttleCarTaskComplete.Standby && command.Status == command.TaskTypeComplete)
{
- var Status = _taskService.ShuttleCarTaskCompleted(command.number, command.TaskTypeComplete).Status;
- shuttleCar.SetValue(ShuttleCarDBName.ConfirmComplete, Status, shuttleCar.DeviceCode);
+ _taskService.ShuttleCarTaskCompleted(command.number, command.TaskTypeComplete);
+ shuttleCar.SetValue(ShuttleCarDBName.ConfirmComplete, true, shuttleCar.DeviceCode);
}
#endregion
- #region 鍒涘缓绉昏溅鍏呯數浠诲姟
- if (command.Err_Status == (short)ShuttleCarErr.LowBattery || command.ElectricQuantity == (short)ShuttleCarErr.LowBattery)
- {
- //鐢熸垚鍫嗗灈鏈虹Щ杞︿换鍔�&绌挎杞﹀厖鐢典换鍔�
- var ShuttleCar = QueryCode(shuttleCar.DeviceCode);//鍏呯數缁堢偣寰呯‘璁わ紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒
- _taskService.AddRelocationCarTask(ShuttleCar.ShuttleCarPosition, "", ShuttleCar.ShuttleCarCode, ShuttleCarTaskType.Charging.ToString());
- }
- #endregion
-
- #region 鑾峰彇鍫嗗灈鏈虹Щ杞﹀畬鎴愪换鍔�
+ #region 鑾峰彇鍫嗗灈鏈虹Щ杞�/绉诲簱瀹屾垚浠诲姟
GetSC_CarFinish();
#endregion
- #region 鑾峰彇绉昏溅浠诲姟
- Get_CarTask(shuttleCar,command);
+ #region 鍒涘缓绉昏溅鍏呯數浠诲姟
+ if (command.Err_Status == (short)ShuttleCarErr.LowBattery || command.ElectricQuantity <= (short)ShuttleCarErr.LowBattery)
+ {
+ var ShuttleCar = QueryCode(shuttleCar.DeviceCode);
+ //鐢熸垚鍫嗗灈鏈虹Щ杞︿换鍔�&绌挎杞﹀厖鐢典换鍔�,鍒ゆ柇鏄惁鏈夌┛姊溅鍦ㄥ厖鐢�
+ Dt_Task _Task = _taskRepository.QueryFirst(x => x.TaskType == TaskOtherTypeEnum.RelocationCarCharging.ObjToInt());
+ if (_Task != null)
+ {
+ if (_Task.ShuttleCarCode != shuttleCar.DeviceCode)
+ {
+ ShuttleCar shuttleCar1 = Storage.Devices.Where(x => x.DeviceCode.Equals(_Task.ShuttleCarCode)).FirstOrDefault() as ShuttleCar;
+ ShuttleCarTaskCommandR command1 = ReadCustomer<ShuttleCarTaskCommandR>(shuttleCar1, shuttleCar1.DeviceCode);//璇诲彇绌挎杞︿俊鎭�
+ if (command1 != null && command1.JoinStatus == 1)
+ {
+ if (command1.Status == (short)ShuttleCarStatus.Charging && command1.ElectricQuantity >= 50)
+ {
+ _taskService.AddRelocationCarTask(ShuttleCar.ShuttleCarPosition, "", ShuttleCar.ShuttleCarCode);
+ shuttleCar1.SetValue(ShuttleCarDBName.TaskType, (short)ShuttleCarStatus.QuitCharging);
+ }
+ }
+ }
+ }
+ else
+ {
+ _taskService.AddRelocationCarTask(ShuttleCar.ShuttleCarPosition, "003-002-001", ShuttleCar.ShuttleCarCode, ShuttleCarTaskType.Charging.ToString());
+ }
+ }
#endregion
+ #region 鑾峰彇绉昏溅/鍑哄叆搴撲换鍔�
+ Get_CarTask(shuttleCar, command);
+ #endregion
}
}
}
catch (Exception ex)
{
- Console.Out.WriteLine(nameof(CommonShuttleCarJob) + ":" + ex.ToString());
- }
- finally
- {
-
+ //Console.Out.WriteLine(nameof(CommonShuttleCarJob) + ":" + ex.ToString());
}
return Task.CompletedTask;
}
--
Gitblit v1.9.3