From 56148da6e3548a72d3d69faf5dac07251461962d Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期三, 25 六月 2025 08:56:11 +0800 Subject: [PATCH] 修复响应状态类型一致性问题在 CommonConveyorLineJob.cs、CommonConveyorLine_GWJob.cs 和 RequestInbound.cs文件中,将响应状态的值从 1 修改为Convert.ToInt16(1),以确保类型一致性。增加了日志记录和状态更新的代码,以增强任务处理的可追踪性和准确性,提升了代码的可读性 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs | 107 +++++++++++++++++++++++++++++++++-------------------- 1 files changed, 66 insertions(+), 41 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs index 857e86e..20b5236 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs @@ -904,22 +904,45 @@ // 鑾峰彇缁勭洏淇℃伅 private DtBoxingInfo CreateBoxingInfo(ResultTrayCellsStatus result, string palletCode) - { - return new DtBoxingInfo + { + var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode == palletCode); + if (boxing == null) { - PalletCode = palletCode, - IsFull = true, - ProcessCode = result.ProcessCode, - ProductionLine = result.ProductionLine, - BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail + return new DtBoxingInfo { - SerialNumber = serialNoObj.SerialNo, - OrderNo = serialNoObj.PositionNo.ToString(), - Status = serialNoObj.SerialNoStatus, - MaterielCode = result.BindCode, - Remark = result.TrayBarcodePropertys.ToJsonString(), - }).ToList() - }; + PalletCode = palletCode, + IsFull = true, + ProcessCode = result.ProcessCode, + ProductionLine = result.ProductionLine, + BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail + { + SerialNumber = serialNoObj.SerialNo, + OrderNo = serialNoObj.PositionNo.ToString(), + Status = serialNoObj.SerialNoStatus, + MaterielCode = result.BindCode, + Remark = result.TrayBarcodePropertys.ToJsonString(), + }).ToList() + }; + } + else { + _boxingInfoRepository.DeleteData(boxing); + return new DtBoxingInfo + { + PalletCode = palletCode, + IsFull = true, + ProcessCode = result.ProcessCode, + ProductionLine = result.ProductionLine, + BoxingInfoDetails = result.SerialNos.Select(seriaINoObj => new DtBoxingInfoDetail + { + SerialNumber = seriaINoObj.SerialNo, + OrderNo = seriaINoObj.PositionNo.ToString(), + Status = seriaINoObj.SerialNoStatus, + MaterielCode = result.BindCode, + Remark = result.TrayBarcodePropertys.ToJsonString(), + }).ToList() + }; + } + } // 鑾峰彇宸ヨ壓鐢宠 @@ -957,7 +980,6 @@ DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine) : await QueryStockInfoForEmptyTrayAsync(areaCode, position); - if (stockInfo == null) { return content.Error("搴撳瓨淇℃伅涓嶅瓨鍦�"); @@ -1290,7 +1312,7 @@ } else { - task = CreateTask(stockInfo, "1049-1", taskType); + task = CreateTask(stockInfo, "1049-8", taskType); } } @@ -1921,32 +1943,32 @@ } #region 鏇存柊搴撳瓨淇℃伅锛堟殏鏃朵笉闇�瑕侊級 - if (stock.IsFull) - { - // 鏌ヨ绗﹀悎鏉′欢鐨勫簱瀛樹俊鎭� - var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); + //if (stock.IsFull) + //{ + // // 鏌ヨ绗﹀悎鏉′欢鐨勫簱瀛樹俊鎭� + // var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); - // 鏌ヨ浠诲姟淇℃伅 - var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList(); + // // 鏌ヨ浠诲姟淇℃伅 + // var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList(); - if (stocks != null && stocks.Count > 0) - { - // 杩囨护鍑洪渶瑕佹洿鏂扮殑搴撳瓨淇℃伅 - var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList(); - foreach (var item in stocksToUpdate) - { - // 鏇存柊搴撳瓨淇℃伅鐨勭壒瀹氬弬鏁� - item.SpecialParameterDuration = stock.SpecialParameterDuration; - item.ParameterInfos = stock.ParameterInfos; - item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); - } - if (stocksToUpdate.Count > 0) - { - // 寮傛鏇存柊搴撳瓨淇℃伅 - var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate); - } - } - } + // if (stocks != null && stocks.Count > 0) + // { + // // 杩囨护鍑洪渶瑕佹洿鏂扮殑搴撳瓨淇℃伅 + // var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList(); + // foreach (var item in stocksToUpdate) + // { + // // 鏇存柊搴撳瓨淇℃伅鐨勭壒瀹氬弬鏁� + // item.SpecialParameterDuration = stock.SpecialParameterDuration; + // item.ParameterInfos = stock.ParameterInfos; + // item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); + // } + // if (stocksToUpdate.Count > 0) + // { + // // 寮傛鏇存柊搴撳瓨淇℃伅 + // var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate); + // } + // } + //} #endregion // 娣诲姞鍘嗗彶浠诲姟 @@ -2121,7 +2143,10 @@ ToAddress = await GetRoadWayAsync(process); else ToAddress = process[0]; - + if(string.IsNullOrEmpty(ToAddress)) + { + return content.Error("鏃犳硶鑾峰彇鐩爣鍦板潃"); + } // 鍒涘缓鏂颁换鍔″疄渚� var task = new Dt_Task { -- Gitblit v1.9.3