From fcfafddcbe3748beda400e1ecd21d329b2a25c81 Mon Sep 17 00:00:00 2001 From: 肖洋 <cathay_xy@163.com> Date: 星期五, 13 十二月 2024 09:52:26 +0800 Subject: [PATCH] 添加定时任务处理高温库存出库逻辑 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs index 1b70dcf..4b333bf 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs @@ -167,7 +167,24 @@ } var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); - return ReceiveWMSTask(new List<WMSTaskDTO> { task }); + if (task.TaskType == (int)TaskInboundTypeEnum.InNG) + { + var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == task.SourceAddress); + Dt_Task _Task = _mapper.Map<Dt_Task>(task); + _Task.TaskState = (int)TaskInStatusEnum.InNew; + _Task.CurrentAddress = task.SourceAddress; + _Task.NextAddress = station.stationNGChildCode; + _Task.TargetAddress = station.stationNGLocation; + _Task.Roadway = station.Roadway; + + BaseDal.AddData(_Task); + _taskExecuteDetailService.AddTaskExecuteDetail(_Task.TaskNum, "鎺ユ敹WMS浠诲姟"); + return content.OK(); + } + else + { + return ReceiveWMSTask(new List<WMSTaskDTO> { task }); + } } catch (Exception ex) { @@ -647,15 +664,15 @@ #region 鏇存柊浠诲姟鐘舵�� - var updateTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.UpdateTask)?.ConfigValue; - if (wmsBase == null || updateTask == null) - { - throw new InvalidOperationException("WMS IP 鏈厤缃�"); - } - wmsIpAddress = wmsBase + updateTask; + //var updateTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.UpdateTask)?.ConfigValue; + //if (wmsBase == null || updateTask == null) + //{ + // throw new InvalidOperationException("WMS IP 鏈厤缃�"); + //} + //wmsIpAddress = wmsBase + updateTask; - result = HttpHelper.PostAsync(wmsIpAddress, new { TaskNum = task.TaskNum, TaskState = task.TaskState }.ToJsonString()).Result; - content = JsonConvert.DeserializeObject<WebResponseContent>(result); + //result = HttpHelper.PostAsync(wmsIpAddress, new { TaskNum = task.TaskNum, TaskState = task.TaskState }.ToJsonString()).Result; + //content = JsonConvert.DeserializeObject<WebResponseContent>(result); #endregion //content = WebResponseContent.Instance.OK(); } -- Gitblit v1.9.3