huangxiaoqiang
22 小时以前 7f3a2e67f82c2d286e902b028b422bf07e9aacb6
调整超时设置,简化日志,优化节流限制

在 `HttpHelper.cs` 中,将 `HttpClient` 的超时时间从 60 秒更改为 120 秒,以便在处理请求时有更长的等待时间。

在 `TaskService.cs` 中,删除了记录日志的代码行,以简化日志输出。

在 `Dt_TaskService.cs` 中,移除了对 `stockInfo` 为 `null` 的检查和对 `lastStatus` 的赋值,表明这些变量不再需要。

在 `TaskController.cs` 中,将节流过滤器的参数从 11 更改为 5,调整请求的节流限制为每 5 秒最多允许一次请求。
已修改4个文件
8 ■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
@@ -82,7 +82,7 @@
                {
                    httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 60);
                    httpClient.Timeout = new TimeSpan(0, 0, 120);
                    if (headers != null)
                    {
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -415,8 +415,6 @@
                var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
                ConsoleHelper.WriteSuccessLine(content.Data.ToString());
                QuartzLogger.WriteLogToFile($"包装出库", $"返回参数【{JsonConvert.SerializeObject(task)}】{Environment.NewLine}{Environment.NewLine}");
                //_taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO })‘
                content = ReceiveWMSTask(new List<WMSTaskDTO> { task });
                QuartzLogger.WriteLogToFile($"包装出库", $"返回参数【{JsonConvert.SerializeObject(content)}】{Environment.NewLine}{Environment.NewLine}");
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -1128,7 +1128,6 @@
                                .OrderBy(x => x.OutboundTime)
                                .FirstAsync();
            if (stockInfo == null) throw new Exception($"库内{station.productLine}无满足条件的库存可出库");
            DtLocationInfo locationInfo = _locationRepository.QueryFirst(x => x.AreaId == 5 && x.LocationCode == stockInfo.LocationCode);
@@ -1156,7 +1155,6 @@
                ProcessCode = stockInfo.ProcessCode,
            };
            WMSTaskDTO taskDTO = CreateTaskDTO(task);
            int lastStatus = locationInfo.LocationStatus;
            BaseDal.AddData(task);
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
@@ -185,7 +185,7 @@
    /// <param name="input">请求数据</param>
    /// <returns></returns>
    [HttpPost, AllowAnonymous, Route("RequestOutTaskToBZAsync")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 11 })] // 5秒节流
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })] // 5秒节流
    public async Task<WebResponseContent> RequestOutTaskToBZAsync([FromBody] RequestTaskDto input)
    {
        return await Service.RequestOutTaskToBZAsync(input);