huangxiaoqiang
2025-07-28 b31d961a3f0bcd2e555ea12b76c30c453826deba
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -28,7 +28,9 @@
                case 1:
                    await RequestTask(conveyorLine, command, childDeviceCode, stationManager);
                    break;
                case 9:
                    RequestWMSTask(conveyorLine, stationManager);
                    break;
                case 2:
                case 3:
                    RequestNextAddress(command, conveyorLine, stationManager, task);
@@ -48,7 +50,7 @@
        private async Task RequestTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, Dt_StationManager stationManager)
        {
            var hasTask = await _taskRepository.QueryFirstAsync(x => x.SourceAddress == childDeviceCode);
            var hasTask = await _taskRepository.QueryFirstAsync(x => x.SourceAddress == childDeviceCode && x.TaskState < (int)TaskInStatusEnum.RGV_InExecutingFinish && x.TaskState >= (int)TaskInStatusEnum.InNew);
            if (hasTask != null)
            {
                var log = $"【{conveyorLine._deviceName}】任务号:【{hasTask.TaskNum}】,托盘条码:【{hasTask.PalletCode}】已到达【{childDeviceCode}】输送线存在任务";
@@ -91,8 +93,6 @@
            {
                RGVName = "RGV03";
            }
                Dt_Task task = new Dt_Task()
                {
                    TaskNum = _taskRepository.GetTaskNo().Result,
@@ -107,5 +107,37 @@
                };
            _taskRepository.AddData(task);
        }
        private void RequestWMSTask(CommonConveyorLine conveyorLine,  Dt_StationManager stationManager)
        {
            var Barcode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.ConveyorLineBarcode, stationManager.stationNextChildCode);
            if (Barcode == "")
            {
                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal,Convert.ToSByte(3), stationManager.stationChildCode);
            }
            var task = _taskRepository.QueryFirst(x => x.PalletCode == Barcode);
            if (task != null)
            {
            }
            else
            {
                //var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                //var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue;
                //var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestTask)?.ConfigValue;
                //var keys = new Dictionary<string, object>()
                //{
                //    {"TPbarcode", Barcode},
                //    {"WhCode", "1001"},
                //    {"BeginPoint", stationManager.stationChildCode}
                //};
                //if (wmsBase == null || requestTask == null)
                //{
                //    throw new InvalidOperationException("WMS IP æœªé…ç½®");
                //}
                //var wmsIpAddress = wmsBase + requestTask;
                //var result = WIDESEA_Comm.Http.HttpHelper.PostAsync(wmsIpAddress, keys.ToString()).Result;
            }
        }
    }
}