xxyy
2025-02-12 3339d1bd83892dffb4bff5228985f4ecdf3c0334
修改任务处理逻辑及Axios配置

- 在`TaskService.cs`中新增`stationManager.productLine`字段,优化任务请求参数。
- 更新`http.js`中的`axios.defaults.baseURL`,禁用`localhost`配置,使用新的生产环境地址。
- 在`RequestInTaskAsync.cs`中调整查询逻辑,使用`STATION.productLine`匹配库存信息。
- 确保任务创建时正确传递`STATION.productLine`,避免执行过程受影响。
- 调整在途数量逻辑,确保`dt_needBarcode`表中的`inLineNum`正确更新,并增加日志输出。
- 修复NG站点配置,统一`NGStation`处理逻辑,确保任务创建时能正确获取NG站点。
已修改3个文件
20 ■■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/RequestInTaskAsync.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -214,7 +214,7 @@
                    wmsIpAddrss = GetIpAddress(SysConfigKeyConst.WMSIP_BASE, SysConfigKeyConst.RequestTask);
                }
                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { Position = sourceAddress, PalletCode = palletCode }.ToJsonString());
                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { Position = sourceAddress, PalletCode = palletCode, stationManager.productLine }.ToJsonString());
                content = JsonConvert.DeserializeObject<WebResponseContent>(result);
                if (!content.Status)
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -11,8 +11,8 @@
let loadingInstance
let loadingStatus = false
if (process.env.NODE_ENV == 'development') {
   axios.defaults.baseURL = 'http://localhost:5000/';
  // axios.defaults.baseURL = 'http://192.168.5.251:5000/';
  //  axios.defaults.baseURL = 'http://localhost:5000/';
  axios.defaults.baseURL = 'http://192.168.20.251:5000/';
}
else if (process.env.NODE_ENV == 'debug') {
  axios.defaults.baseURL = 'http://127.0.0.1:9991/';
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/RequestInTaskAsync.cs
@@ -42,6 +42,8 @@
        // 判断需不需要去包装,不需要就去常温三
        var stationManagers = _stationManagerRepository.QueryData(x => x.stationPLC == "1018" && x.stationArea == "Cache" && x.productLine == input.ProductionLine);
        var STATION = _stationManagerRepository.QueryFirst(x => x.stationChildCode == input.Position);
        //var station = stationManagers.Select(x => x.stationChildCode).ToList();
        //// 获取WCSip地址相关配置
@@ -56,13 +58,13 @@
        //var num = content.Data.ObjToInt();
        //如果当前库内存在比当前时间的对应产线的料 则入库至常温3
        DtStockInfo stockInfo = _stockInfoRepository.QueryFirst(x => x.AreaCode == "CWSC3" && x.IsFull == true && x.ProductionLine == input.ProductionLine && x.OutboundTime < DateTime.Now);
        DtStockInfo stockInfo = _stockInfoRepository.QueryFirst(x => x.AreaCode == "CWSC3" && x.IsFull == true && x.ProductionLine == STATION.productLine && x.OutboundTime < DateTime.Now);
        if (stockInfo != null)
        {
            var config = _configService.GetByConfigKey("SYS_InStacker", "CW3InStacker");
            var strings = config.ConfigValue.Split(',').ToList();
            // 入库送至常温3
            var resultContent = await CreateNewTask(input, input.ProductionLine, boxing.ProcessCode,strings);
            var resultContent = await CreateNewTask(input, input.ProductionLine, boxing.ProcessCode, strings);
            if (resultContent.Status)
            {
                await _boxingInfoRepository.AddDataNavAsync(boxing);
@@ -72,13 +74,15 @@
        // TODO 判断在途数量
        var needBarcode  = await SqlSugarHelper.DbWCS.Queryable<dt_needBarcode>().FirstAsync(x => x.productLine == input.ProductionLine);
        var needBarcode = await SqlSugarHelper.DbWCS.Queryable<dt_needBarcode>().FirstAsync(x => x.productLine == STATION.productLine);
        var needCount = needBarcode.inLineNum;
        //var count = BaseDal.QueryData(x => x.TargetAddress == stationManagers[0].Roadway).Count;
        if (needCount < 2)
        {
            // 送至包装
            List<string> strings = stationManagers.Where(x => x.stationType == 0).Select(x => x.Roadway).ToList();
            var x = await SqlSugarHelper.DbWCS.Updateable<dt_needBarcode>().SetColumns(x => x.inLineNum == x.inLineNum + 1).ExecuteCommandHasChangeAsync();
            ConsoleHelper.WriteSuccessLine($"在途数量添加{(x ? "成功" : "失败")}数量+1");
            return await CreateNewTask(input, input.ProductionLine, boxing.ProcessCode, strings, 3);
        }
        else
@@ -142,7 +146,7 @@
        }
        List<string> strings = stationManagers.Roadway.Split(',').ToList();
        var resultContent = await CreateNewTask(input, result.ProductionLine,boxing.ProcessCode, strings);
        var resultContent = await CreateNewTask(input, result.ProductionLine, boxing.ProcessCode, strings);
        if (resultContent.Status)
        {
            var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing);
@@ -204,7 +208,7 @@
        //    NGStation = stationManagers.stationNGChildCode.Split(',').ToList();
        //}
        List<string> NGStation = stationManagers.stationNGChildCode.Split(',').ToList();
        content = await CreateNewTask(input, input.ProductionLine,"", NGStation, 2);
        content = await CreateNewTask(input, input.ProductionLine, "", NGStation, 2);
        return content.Error("存在异常电芯");
    }