| | |
| | | /// </summary> |
| | | /// <param name="endPoint"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CallMateriel(string endPoint) |
| | | public WebResponseContent CallMateriel(SaveModel saveModel) |
| | | { |
| | | Dt_CachePoint cachePoint = GetCachePointByEndPoint(endPoint); |
| | | |
| | | Dt_Task task = new Dt_Task() |
| | | try |
| | | { |
| | | CurrentAddress = cachePoint.PointCode, |
| | | Grade = 0, |
| | | NextAddress = endPoint, |
| | | OrderNo = "", |
| | | PalletCode = cachePoint.Remark, |
| | | Roadway = "", |
| | | SourceAddress = cachePoint.PointCode, |
| | | TargetAddress = endPoint, |
| | | SourceKey = 0, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | string endPoint = saveModel.MainData["endPoint"].ToString(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | Dt_CachePoint cachePoint = GetCachePointByEndPoint(endPoint); |
| | | |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | | CurrentAddress = cachePoint.PointCode, |
| | | Grade = 0, |
| | | NextAddress = endPoint, |
| | | OrderNo = "", |
| | | PalletCode = cachePoint.Remark, |
| | | Roadway = "", |
| | | SourceAddress = cachePoint.PointCode, |
| | | TargetAddress = endPoint, |
| | | SourceKey = 0, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="startPoint"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent MaterielCarry(string startPoint) |
| | | public WebResponseContent MaterielCarry(SaveModel saveModel) |
| | | { |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint); |
| | | |
| | | Dt_Task task = new() |
| | | try |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = cachePoint.PointCode, |
| | | OrderNo = "", |
| | | PalletCode = startPoint + "-AGV", |
| | | Roadway = "", |
| | | SourceAddress = startPoint, |
| | | TargetAddress = cachePoint.PointCode, |
| | | SourceKey = 0, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | string startPoint = saveModel.MainData["startPoint"].ToString(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint); |
| | | |
| | | Dt_Task task = new() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = cachePoint.PointCode, |
| | | OrderNo = "", |
| | | PalletCode = startPoint + "-AGV", |
| | | Roadway = "", |
| | | SourceAddress = startPoint, |
| | | TargetAddress = cachePoint.PointCode, |
| | | SourceKey = 0, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | private Dt_CachePoint GetCachePointByStartPoint(string startPoint) |
| | | { |