肖洋
2024-11-29 663d9d2e658ab99a0c3598becd23b00b34b3e3d9
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -4,6 +4,8 @@
using Quartz;
using SqlSugar;
using System.Reflection;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_BasicInfoService;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
@@ -32,8 +34,10 @@
        private readonly IPlatFormRepository _platFormRepository;
        private readonly ISys_ConfigService _sys_ConfigService;
        private readonly IMapper _mapper;
        private readonly IDt_StationManagerService _stationManagerService;
        private readonly IDt_StationManagerRepository _stationManagerRepository;
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService)
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -42,6 +46,8 @@
            _taskRepository = taskRepository;
            _platFormRepository = platFormRepository;
            _sys_ConfigService = sys_ConfigService;
            _stationManagerService = stationManagerService;
            _stationManagerRepository = stationManagerRepository;
        }
        public async Task Execute(IJobExecutionContext context)
@@ -156,7 +162,7 @@
                var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode);
                HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task);
                if (task == null && command.Barcode != "NoRead")
                if (task == null && command.Barcode != "NoRead" && command.Barcode.IsNotEmptyOrNull())
                {
                    HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue);
                }
@@ -221,14 +227,14 @@
                WebResponseContent content = new WebResponseContent();
                ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(task);
                taskCommand.InteractiveSignal = command.InteractiveSignal;
                if (task.PalletCode != command.Barcode)
                if (task.PalletCode != command.Barcode || task.Remark != null)
                {
                    var NGAddress = _platFormRepository.QueryFirst(x => x.PlatCode == task.TargetAddress).Capacity;
                    taskCommand.TargetAddress = NGAddress;
                }
                else
                {
                    taskCommand.TargetAddress = 0;
                    taskCommand.TargetAddress = 1000;
                }
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
@@ -269,7 +275,7 @@
                    taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray;
                else
                    taskOutboundTypeEnum = TaskOutboundTypeEnum.Outbound;
                await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker.Split(',')[0], platform.Stacker.Split(',').ToList());
                await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker);
            }
            catch (Exception)
            {