From a6e0ea9ce13e791f3edae4edffeb3be3ccb760be Mon Sep 17 00:00:00 2001 From: wangxinhui <wangxinhui@hnkhzn.com> Date: 星期一, 31 三月 2025 02:14:59 +0800 Subject: [PATCH] 版本更新 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" index 6a74dc6..9d34bd9 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" @@ -171,10 +171,18 @@ if (taskTypeGroup == TaskTypeGroup.InboundGroup) { stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StationDeviceCode == item.SourceAddress); + if (stationManger==null && task.TaskType==TaskTypeEnum.InProduct.ObjToInt()) + { + stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode==task.SourceAddress); + //杞崲鎴愬搧浠撹捣鐐圭珯鍙� + item.SourceAddress = stationManger.StationCode; + task.CurrentAddress = stationManger.StationCode; + task.SourceAddress = stationManger.StationCode; + } } else { - stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay); + stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneCode == item.RoadWay || x.Remark==item.RoadWay); } if (stationManger == null) { @@ -200,7 +208,7 @@ task.NextAddress = router.NextPosi; task.DeviceCode = router.ChildPosi; } - else if (item.TaskType == TaskTypeEnum.MesPalletReturn.ObjToInt() && router.IsEnd) + else if ((item.TaskType == TaskTypeEnum.MesPalletLargeReturn.ObjToInt() || item.TaskType == TaskTypeEnum.MesPalletSmallReturn.ObjToInt()) && router.IsEnd) { task.NextAddress = router.NextPosi; task.DeviceCode = router.ChildPosi; @@ -211,13 +219,24 @@ task.DeviceCode = stationManger.StackerCraneCode; task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); } + else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() && item.RoadWay.Contains("ZH")) + { + task.NextAddress = stationManger.StackerCraneStationCode; + task.DeviceCode = stationManger.StackerCraneCode; + task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); + } else { task.NextAddress = taskTypeGroup == TaskTypeGroup.InboundGroup ? task.TargetAddress : router.NextPosi; - if (item.RoadWay.Contains("AGV")) + if (item.RoadWay.Contains("AGV_FL")|| (item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.OutbondGroup)) { task.DeviceCode = item.RoadWay; - task.AgvTaskNum = task.DeviceCode + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum; + task.AgvTaskNum = item.RoadWay + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum; + } + else if(item.RoadWay.Contains("AGV_CP") && taskTypeGroup == TaskTypeGroup.InboundGroup) + { + task.DeviceCode = stationManger.StationDeviceCode; + task.AgvTaskNum = task.Roadway + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum; } else { @@ -251,7 +270,6 @@ return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�"); } router = routers.FirstOrDefault(); - task.NextAddress = router?.StartPosi ?? ""; task.DeviceCode = item.RoadWay; task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); @@ -265,8 +283,7 @@ return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�"); } router = routers.FirstOrDefault(); - string stationCode = router?.NextPosi ?? ""; - Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == stationCode); + Dt_StationManger? stationManger = _stationMangerRepository.QueryData(x => true).FirstOrDefault(x=>x.StationCode== router?.NextPosi); if (stationManger == null) { return WebResponseContent.Instance.Error($"鏈壘鍒扮珯鍙伴厤缃俊鎭�"); @@ -825,7 +842,7 @@ /// </summary> public Dt_Task QueryStackerExistTask(string PalletCode, string locationCode) { - return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && x.TaskState == (int)TaskStatusEnum.SC_Execute); + return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && (x.TaskState == (int)TaskStatusEnum.SC_Execute || x.TaskState == (int)TaskStatusEnum.SC_Executing)); } } } -- Gitblit v1.9.3