| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç»å® |
| | | /// </summary> |
| | | /// <param name="qty"></param> |
| | | /// <param name="Point"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent Bind(string qty, string point) |
| | | { |
| | | try |
| | | { |
| | | if (Repository.QueryFirst(x => x.SourceAddress == point && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == point) != null) |
| | | throw new Exception($"ç«ç¹ã{point}ãåå¨ä»»å¡ï¼"); |
| | | Dt_CachePoint? cachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == point); |
| | | if (cachePoint == null) throw new Exception("æªæ¾å°ç¼åç¹!"); |
| | | if (cachePoint.AreaId != 4) throw new Exception("å½åç¼åç¹åºåæ ç»å®æé!"); |
| | | cachePoint.PointStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | cachePoint.Remark = qty; |
| | | cachePoint.Modifier = App.User.UserName; |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// éæ¾ç¼åç¹ |
| | | /// </summary> |
| | | /// <param name="point"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AcrossFloorCallMat(string point) |
| | | { |
| | | try |
| | | { |
| | | if (Repository.QueryFirst(x => x.SourceAddress == point && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == point) != null) |
| | | throw new Exception($"ç«ç¹ã{point}ãåå¨ä»»å¡ï¼"); |
| | | 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("å½åç¼åç¹åºåæ éæ¾æé!"); |
| | | cachePoint.PointStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 嫿 |
| | | /// </summary> |
| | | /// <param name="endPoint"></param> |
| | |
| | | { |
| | | try |
| | | { |
| | | if (Repository.QueryFirst(x => x.SourceAddress == endPoint && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == endPoint) != null) |
| | | throw new Exception($"ç«ç¹ã{endPoint}ãåå¨ä»»å¡ï¼"); |
| | | |
| | | Dt_CachePoint cachePoint = GetCachePointByEndPoint(endPoint); |
| | | |
| | | Dt_Task task = new Dt_Task() |
| | |
| | | |
| | | Db.Ado.BeginTran(); |
| | | var response = SendAGVTask(task, cachePoint); |
| | | if (response.Status) |
| | | if (!response.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error($"{response.Message}"); |
| | |
| | | { |
| | | try |
| | | { |
| | | if (Repository.QueryFirst(x => x.SourceAddress == startPoint && |
| | | x.TaskStatus < AGVTaskStatusEnum.DoneFetch.ObjToInt() || |
| | | x.TargetAddress == startPoint) != null) |
| | | throw new Exception($"ç«ç¹ã{startPoint}ãåå¨ä»»å¡ï¼"); |
| | | |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint); |
| | | |
| | | Dt_Task task = new() |
| | |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | Db.Ado.BeginTran(); |
| | | var response = SendAGVTask(task, cachePoint); |
| | | if (!response.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error($"{response.Message}"); |
| | | } |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | Db.Ado.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Db.Ado.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |