dengjunjie
5 天以前 4f39dcc195f28fa275fc2d065fbf1bf6a46c21b7
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_AGV.cs
@@ -22,17 +22,21 @@
        public WebResponseContent ShelfOutboundCarry(Dt_Task outTask)
        {
            //判断是否为电芯库,辅料库人工处理(立库目标地址转换成AGV站点地址)
            Dt_CachePoint cachePoint = GetCachePointByStartPoint(outTask.TargetAddress);
            if (!outTask.Roadway.Contains("CP")) return WebResponseContent.Instance.OK();
            Dt_RoadwayInfo dt_RoadwayInfo = _basicService.RoadwayInfoService.Repository.QueryFirst(x => x.OutSCStationCode == outTask.TargetAddress);
            if (dt_RoadwayInfo == null) return WebResponseContent.Instance.OK();
            Dt_CachePoint startcachePoint = new Dt_CachePoint();
            Dt_CachePoint cachePoint = GetCachePointByStartPoint(dt_RoadwayInfo.OutStationCode, ref startcachePoint);
            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 +46,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 +176,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 +220,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 +325,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);
                        }
                    }