From c6e8b600398de38b6684f5fa1eaaaade8562859b Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期六, 20 九月 2025 15:16:56 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhiHuiQiCe/LongDeLiLiKu --- 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/ApartPlate.cs | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 86 insertions(+), 0 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/ApartPlate.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/ApartPlate.cs" new file mode 100644 index 0000000..b9eb3db --- /dev/null +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/ApartPlate.cs" @@ -0,0 +1,86 @@ +锘縰sing Autofac.Core; +using Microsoft.AspNetCore.Components.Routing; +using Newtonsoft.Json; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; +using Quartz; +using System.Reflection; +using WIDESEAWCS_Common.TaskEnum; +using WIDESEAWCS_Core; +using WIDESEAWCS_IBasicInfoRepository; +using WIDESEAWCS_IPackInfoRepository; +using WIDESEAWCS_ITaskInfoRepository; +using WIDESEAWCS_ITaskInfoService; +using WIDESEAWCS_QuartzJob; +using WIDESEAWCS_QuartzJob.DTO; +using WIDESEAWCS_Tasks.ConveyorLineJob; +using WIDESEAWCS_Tasks.StackPlateJob; +using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; + +namespace WIDESEAWCS_Tasks +{ + [DisallowConcurrentExecution] + public class ApartPlate : JobBase, IJob + { + private readonly ICacheService _cacheService; + private readonly ITaskService _taskService; + private readonly ITaskRepository _taskRepository; + private readonly IStationMangerRepository _stationMangerRepository; + private readonly IDt_PackaxisRepository _packaxisRepository; + + public ApartPlate(ICacheService cacheService, ITaskService taskService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IDt_PackaxisRepository packaxisRepository) + { + _cacheService = cacheService; + _taskService = taskService; + _taskRepository = taskRepository; + _stationMangerRepository = stationMangerRepository; + _packaxisRepository = packaxisRepository; + } + + public Task Execute(IJobExecutionContext context) + { + CommonConveyorLine device = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); + //鑾峰彇褰撳墠璁惧瀵瑰簲鐨勭珯鍙� + StackPlateTaskCommandCommand command = device.ReadCustomer<StackPlateTaskCommandCommand>(device.DeviceCode); + + if (command != null && command.State == 2) + { + DeviceProtocolDetailDTO? deviceProtocolDetails = device.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(StackPlateTaskCommandCommand.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString()); + if (deviceProtocolDetails != null) + { + MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType); + if (method != null) + { + method.Invoke(this, new object[] { device, command }); + } + } + } + + return Task.CompletedTask; + } + + /// <summary> + /// 鏈夋枡鍏佽 + /// </summary> + /// <param name="device"></param> + /// <param name="command"></param> + public void InStockAllow(CommonConveyorLine device, StackPlateTaskCommandCommand command) + { + device.SetValue(StackPlateDBName.WriteInteractiveSignal, Convert.ToInt16(2), device.DeviceCode); + //鍒嗛厤宸叉媶鍒嗙┖鎵樼洏鍘诲悜浠诲姟 + } + + /// <summary> + /// 绌轰綅鍏佽锛屽厑璁告媶鐩� + /// </summary> + /// <param name="device"></param> + /// <param name="command"></param> + public void EmptySeatAllow(CommonConveyorLine device, StackPlateTaskCommandCommand command) + { + var task = _taskRepository.QueryFirst(x => x.Roadway == device.DeviceCode && x.TargetAddress == device.DeviceCode); + if (task == null) + { + //todo璇锋眰WMS涓嬪彂绌烘墭鍑哄簱浠诲姟 + } + } + } +} -- Gitblit v1.9.3