From fb79dc54d6484146b74d29bf5644df880fc1fa01 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 19 六月 2025 12:16:54 +0800 Subject: [PATCH] WMS添加AGV任务完成取消 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" index e780012..2debb9b 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs" @@ -22,17 +22,26 @@ public WebResponseContent ShelfOutboundCarry(Dt_Task outTask) { //鍒ゆ柇鏄惁涓虹數鑺簱锛岃緟鏂欏簱浜哄伐澶勭悊(绔嬪簱鐩爣鍦板潃杞崲鎴怉GV绔欑偣鍦板潃) - Dt_CachePoint cachePoint = GetCachePointByStartPoint(outTask.TargetAddress); - + Dt_RoadwayInfo dt_RoadwayInfo = _basicService.RoadwayInfoService.Repository.QueryFirst(x => x.OutSCStationCode == outTask.TargetAddress); + if (dt_RoadwayInfo == null || dt_RoadwayInfo.AreaId == 11) return WebResponseContent.Instance.OK(); + Dt_CachePoint startcachePoint = new Dt_CachePoint(); + Dt_CachePoint cachePoint = GetCachePointByStartPoint(dt_RoadwayInfo.OutStationCode, ref startcachePoint); + if (startcachePoint.EnableStatus == EnableStatusEnum.Disable.ObjToInt()) return WebResponseContent.Instance.OK(); + //if (dt_RoadwayInfo.AreaId == 11)//杈呮枡涓嶇敤AGV鎼繍 + //{ + // startcachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); + // _basicService.CachePointService.Repository.UpdateData(startcachePoint); + // return WebResponseContent.Instance.OK(); + //} Dt_Task task = new() { - CurrentAddress = outTask.TargetAddress, + CurrentAddress = startcachePoint.PointCode, Grade = 0, NextAddress = cachePoint.PointCode, OrderNo = outTask.OrderNo, PalletCode = outTask.PalletCode + "-AGV", Roadway = "", - SourceAddress = outTask.TargetAddress, + SourceAddress = startcachePoint.PointCode, TargetAddress = cachePoint.PointCode, SourceKey = outTask.TaskId, TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), @@ -42,9 +51,12 @@ Creater = App.User.UserId > 0 ? App.User.UserName : "System", }; cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); + //startcachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); _basicService.CachePointService.Repository.UpdateData(cachePoint); + //_basicService.CachePointService.Repository.UpdateData(startcachePoint); Repository.AddData(task); + SendAGVTask(task, cachePoint); return WebResponseContent.Instance.OK(); } @@ -169,8 +181,8 @@ x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || x.TargetAddress == startPoint) != null) throw new Exception($"绔欑偣銆恵startPoint}銆戝瓨鍦ㄤ换鍔★紒"); - - Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint); + Dt_CachePoint startcachePoint = new Dt_CachePoint(); + Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint, ref startcachePoint); Dt_Task task = new() { @@ -213,12 +225,12 @@ /// <param name="startPoint"></param> /// <returns></returns> /// <exception cref="Exception"></exception> - private Dt_CachePoint GetCachePointByStartPoint(string startPoint) + private Dt_CachePoint GetCachePointByStartPoint(string startPoint, ref Dt_CachePoint startcachePoint) { #region MyRegion Dt_CachePoint? StartcachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == startPoint); if (StartcachePoint == null) throw new Exception("鏈壘鍒扮紦瀛樼偣!"); - + startcachePoint = StartcachePoint; Dt_AreaRouter areaRouter = _basicService.AreaRouterService.Repository.QueryFirst(x => x.StartArea == StartcachePoint.AreaId.ToString()); if (areaRouter == null) throw new Exception("鏈壘鍒拌矾鐢变俊鎭�!"); @@ -318,6 +330,10 @@ if (qty > 0) startCachePoint.PointStatus = LocationStatusEnum.InStock.ObjToInt(); startCachePoint.Remark = qty.ToString(); } + //else if (startCachePoint.AreaId == 1) + //{ + // startCachePoint.PointStatus = LocationStatusEnum.PalletLock.ObjToInt(); + //} _basicService.CachePointService.Repository.UpdateData(startCachePoint); } } -- Gitblit v1.9.3