| | |
| | | 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); |
| | | 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æ¬è¿ |
| | | //{ |
| | |
| | | if (Repository.QueryFirst(x => x.SourceAddress == point && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == point) != null) |
| | | throw new Exception($"ç«ç¹ã{point}ãåå¨ä»»å¡ï¼"); |
| | | throw new Exception($"ç¼åç¹ã{point}ãåå¨AGVä»»å¡ï¼"); |
| | | Dt_CachePoint? cachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == point); |
| | | if (cachePoint == null) throw new Exception("æªæ¾å°ç¼åç¹!"); |
| | | if (cachePoint.AreaId != 4) throw new Exception("å½åç¼åç¹åºåæ ç»å®æé!"); |
| | | if (cachePoint.Depth == 1) |
| | | { |
| | | Dt_CachePoint? cachePoint1 = _basicService.CachePointService.Repository.QueryFirst(x => x.AreaId == cachePoint.AreaId && x.Column == cachePoint.Column && cachePoint.Row - x.Row == 1); |
| | | if (cachePoint1 != null) |
| | | { |
| | | if (Repository.QueryFirst(x => x.SourceAddress == cachePoint1.PointCode && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == cachePoint1.PointCode) != null) |
| | | throw new Exception($"å
ç½®ç¼åç¹ã{cachePoint1.PointCode}ãåå¨AGVä»»å¡ï¼"); |
| | | } |
| | | } |
| | | //if (cachePoint.AreaId != 4) throw new Exception("å½åç¼åç¹åºåæ ç»å®æé!"); |
| | | cachePoint.PointStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | cachePoint.Remark = qty; |
| | | if (cachePoint.AreaId == 4) cachePoint.Remark = qty; |
| | | cachePoint.Modifier = App.User.UserName; |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | return WebResponseContent.Instance.OK(); |
| | |
| | | if (Repository.QueryFirst(x => x.SourceAddress == point && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == point) != null) |
| | | throw new Exception($"ç«ç¹ã{point}ãåå¨ä»»å¡ï¼"); |
| | | throw new Exception($"ç¼åç¹ã{point}ãåå¨AGVä»»å¡ï¼"); |
| | | Dt_CachePoint? cachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == point); |
| | | if (cachePoint == null) throw new Exception("æªæ¾å°ç¼åç¹!"); |
| | | if (cachePoint.AreaId != 2 && cachePoint.AreaId != 5 && cachePoint.AreaId != 8) |
| | | throw new Exception("å½åç¼åç¹åºåæ éæ¾æé!"); |
| | | //if (cachePoint.AreaId != 2 && cachePoint.AreaId != 5 && cachePoint.AreaId != 8) |
| | | // throw new Exception("å½åç¼åç¹åºåæ éæ¾æé!"); |
| | | cachePoint.PointStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | cachePoint.Modifier = App.User.UserName; |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="endPoint"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CallMateriel(string endPoint) |
| | | public WebResponseContent CallMateriel(string endPoint, string startPoint) |
| | | { |
| | | try |
| | | { |
| | |
| | | x.TargetAddress == endPoint) != null) |
| | | throw new Exception($"ç«ç¹ã{endPoint}ãåå¨ä»»å¡ï¼"); |
| | | |
| | | Dt_CachePoint cachePoint = GetCachePointByEndPoint(endPoint); |
| | | Dt_CachePoint cachePoint = GetCachePointByEndPoint(endPoint, startPoint); |
| | | |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="startPoint"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent MaterielCarry(string startPoint) |
| | | public WebResponseContent MaterielCarry(string startPoint, string endPoint) |
| | | { |
| | | try |
| | | { |
| | |
| | | x.TargetAddress == startPoint) != null) |
| | | throw new Exception($"ç«ç¹ã{startPoint}ãåå¨ä»»å¡ï¼"); |
| | | Dt_CachePoint startcachePoint = new Dt_CachePoint(); |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint, ref startcachePoint); |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint, endPoint, ref startcachePoint); |
| | | |
| | | Dt_Task task = new() |
| | | { |
| | |
| | | /// <param name="startPoint"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | private Dt_CachePoint GetCachePointByStartPoint(string startPoint, ref Dt_CachePoint startcachePoint) |
| | | private Dt_CachePoint GetCachePointByStartPoint(string startPoint, string endPoint, ref Dt_CachePoint startcachePoint) |
| | | { |
| | | #region MyRegion |
| | | Dt_CachePoint? StartcachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == startPoint); |
| | | if (StartcachePoint == null) throw new Exception("æªæ¾å°ç¼åç¹!"); |
| | | if (StartcachePoint == null) throw new Exception($"æªæ¾å°ç¼åç¹{startPoint}!"); |
| | | startcachePoint = StartcachePoint; |
| | | endPoint = ""; |
| | | if (!string.IsNullOrEmpty(endPoint)) |
| | | { |
| | | Dt_CachePoint? cachePoint1 = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == endPoint); |
| | | if (cachePoint1 == null) throw new Exception($"æªæ¾å°ç¼åç¹{endPoint}!"); |
| | | if (Repository.QueryFirst(x => x.SourceAddress == endPoint && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == endPoint) != null) |
| | | throw new Exception($"ç¼åç¹ã{endPoint}ãåå¨ä»»å¡ï¼"); |
| | | return cachePoint1; |
| | | } |
| | | Dt_AreaRouter areaRouter = _basicService.AreaRouterService.Repository.QueryFirst(x => x.StartArea == StartcachePoint.AreaId.ToString()); |
| | | if (areaRouter == null) throw new Exception("æªæ¾å°è·¯ç±ä¿¡æ¯!"); |
| | | |
| | |
| | | /// <param name="endPoint"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | private Dt_CachePoint GetCachePointByEndPoint(string endPoint) |
| | | private Dt_CachePoint GetCachePointByEndPoint(string endPoint, string startPoint) |
| | | { |
| | | #region MyRegion |
| | | Dt_CachePoint? StartcachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == endPoint); |
| | | if (StartcachePoint == null) throw new Exception("æªæ¾å°ç¼åç¹!"); |
| | | if (StartcachePoint == null) throw new Exception($"æªæ¾å°ç¼åç¹{endPoint}!"); |
| | | |
| | | if (!string.IsNullOrEmpty(endPoint)) |
| | | { |
| | | Dt_CachePoint? cachePoint1 = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == startPoint); |
| | | if (cachePoint1 == null) throw new Exception($"æªæ¾å°ç¼åç¹{startPoint}!"); |
| | | if (Repository.QueryFirst(x => x.SourceAddress == startPoint && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == startPoint) != null) |
| | | throw new Exception($"ç¼åç¹ã{startPoint}ãåå¨ä»»å¡ï¼"); |
| | | return cachePoint1; |
| | | } |
| | | |
| | | Dt_AreaRouter areaRouter = _basicService.AreaRouterService.Repository.QueryFirst(x => x.NextArea == StartcachePoint.AreaId.ToString()); |
| | | if (areaRouter == null) throw new Exception("æªæ¾å°è·¯ç±ä¿¡æ¯!"); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | return WebResponseContent.Instance.Error("AGVä»»å¡ä¸å失败:" + ex.Message); |
| | | } |
| | | } |
| | | |