xxyy
2025-02-27 a833526d6f9d396df0249066f8057c6d5c51b86d
修复 Dt_TaskService.cs 中 locations 检查逻辑

在 `Dt_TaskService.cs` 文件中,新增对 `locations` 的 `null` 检查;若为 `null`,将重新查询满足条件的 `locations`。同时,移除了日志记录相关代码,仅保留异常抛出逻辑。
已修改1个文件
7 ■■■■ 文件已修改
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -459,6 +459,10 @@
            else
            {
                locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Distribute && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1);
                if (locations == null)
                {
                    locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1);
                }
            }
            if (locations == null)
@@ -974,11 +978,10 @@
        WebResponseContent content = new WebResponseContent();
        try
        {
            //LogFactory.GetLog("常温3出库至包装").Info(true, $"常温3出库至包装传入参数:" + JsonConvert.SerializeObject(json, Formatting.Indented));
            Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == json.Position && x.stationType == 12 && x.stationArea == "Call");
            if(station == null) { throw new Exception($"未找到包装站台信息,请检查传入参数{json.Position}"); }
            if (station == null) { throw new Exception($"未找到包装站台信息,请检查传入参数{json.Position}"); }
            //LogFactory.GetLog("常温3出库至包装").Info(true, $"常温3出库至包装传入参数:" + JsonConvert.SerializeObject(json, Formatting.Indented));
            var stockInfo = _stockInfoRepository.Db.Queryable<DtStockInfo>()