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 | 53 ++++++++++++++++++++++++++--------------------------- 1 files changed, 26 insertions(+), 27 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 86d8a12..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 @@ -636,7 +636,6 @@ case (int)TaskOutboundTypeEnum.OutTray: case (int)TaskOutboundTypeEnum.Outbound: case (int)TaskOutboundTypeEnum.OutNG: - case (int)TaskOutboundTypeEnum.OutQuality: LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", ""); return await CompleteStackTaskAsync(task, stock); @@ -905,8 +904,8 @@ // 鑾峰彇缁勭洏淇℃伅 private DtBoxingInfo CreateBoxingInfo(ResultTrayCellsStatus result, string palletCode) - { - var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode== palletCode); + { + var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode == palletCode); if (boxing == null) { return new DtBoxingInfo @@ -925,8 +924,7 @@ }).ToList() }; } - else - { + else { _boxingInfoRepository.DeleteData(boxing); return new DtBoxingInfo { @@ -934,16 +932,17 @@ IsFull = true, ProcessCode = result.ProcessCode, ProductionLine = result.ProductionLine, - BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail + BoxingInfoDetails = result.SerialNos.Select(seriaINoObj => new DtBoxingInfoDetail { - SerialNumber = serialNoObj.SerialNo, - OrderNo = serialNoObj.PositionNo.ToString(), - Status = serialNoObj.SerialNoStatus, + SerialNumber = seriaINoObj.SerialNo, + OrderNo = seriaINoObj.PositionNo.ToString(), + Status = seriaINoObj.SerialNoStatus, MaterielCode = result.BindCode, Remark = result.TrayBarcodePropertys.ToJsonString(), }).ToList() }; } + } // 鑾峰彇宸ヨ壓鐢宠 @@ -981,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("搴撳瓨淇℃伅涓嶅瓨鍦�"); @@ -1314,7 +1312,7 @@ } else { - task = CreateTask(stockInfo, "1049-1", taskType); + task = CreateTask(stockInfo, "1049-8", taskType); } } @@ -1740,23 +1738,21 @@ // 鍒涘缓鍘嗗彶浠诲姟瀹炰緥妯″瀷 try { - foreach (object item in key) + Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key[0])); + if (task == null) { - Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key)); - if (task == null) - { - return content.Error("鏈壘鍒颁换鍔′俊鎭�!"); - } - var taskHtyNG = CreateHistoricalTask(task, true); - - // 鎵ц鏁版嵁搴撲簨鍔� - - // 娣诲姞鍘嗗彶浠诲姟 - var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0; - - // 鍒犻櫎浠诲姟鏁版嵁 - var isTaskDelete = BaseDal.Delete(task.TaskId); + return content.Error("鏈壘鍒颁换鍔′俊鎭�!"); } + var taskHtyNG = CreateHistoricalTask(task, true); + + // 鎵ц鏁版嵁搴撲簨鍔� + + // 娣诲姞鍘嗗彶浠诲姟 + var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0; + + // 鍒犻櫎浠诲姟鏁版嵁 + var isTaskDelete = BaseDal.Delete(task.TaskId); + return content.OK("鍒犻櫎鎴愬姛!"); } catch (Exception ex) @@ -2147,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