| | |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | //public WebResponseContent Add() |
| | | //{ |
| | | // try |
| | | // { |
| | | // var x = BaseDal.GetTaskNo().Result; |
| | | public WebResponseContent RequestOutTask(string PalletCode, string SourceAddress, string TargetAddress) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //var tasks = BaseDal.QueryFirst(x => x.PalletCode == PalletCode); |
| | | //if (tasks != null) |
| | | //{ |
| | | // return content.Error("璇ユ墭鐩樺凡瀛樺湪浠诲姟"); |
| | | //} |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | SourceAddress = SourceAddress, |
| | | CurrentAddress = SourceAddress, |
| | | TargetAddress = TargetAddress, |
| | | NextAddress = TargetAddress, |
| | | Grade = 1, |
| | | PalletCode = PalletCode, |
| | | TaskType = (int)TaskOutboundTypeEnum.Outbound, |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | Dispatchertime = DateTime.Now, |
| | | SeqNo = Convert.ToInt32(1), |
| | | CommandID = Convert.ToInt32(101) |
| | | }; |
| | | task_call task_Call = new task_call() |
| | | { |
| | | d_task_type = newTask.TaskType == (int)TaskTypeEnum.Inbound ? 1 : 2, |
| | | d_floor = 1, |
| | | d_involed1 = newTask.SourceAddress, |
| | | d_involed2 = newTask.TargetAddress, |
| | | d_involed5 = newTask.TaskNum, |
| | | }; |
| | | SqlSugarHelper.DbAGV.Insertable(task_Call).ExecuteCommand(); |
| | | return content.OK(); |
| | | |
| | | // task_call task_Call = new task_call() |
| | | // { |
| | | // d_task_type = 1, |
| | | // d_floor = 1, |
| | | // d_involed1 = "480101", |
| | | // d_involed2 = "B001::1", |
| | | // d_involed5 = x, |
| | | // }; |
| | | // var y=SqlSugarHelper.DbAGV.Insertable(task_Call).ExecuteCommand(); |
| | | // return WebResponseContent.Instance.OK(data: y); |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent InTask(string PalletCode, string SourceAddress, string TargetAddress) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | SourceAddress = SourceAddress, |
| | | TargetAddress = TargetAddress, |
| | | PalletCode = PalletCode, |
| | | TaskType = (int)TaskInboundTypeEnum.Inbound, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | Dispatchertime = DateTime.Now, |
| | | SeqNo = Convert.ToInt32(1), |
| | | CommandID = Convert.ToInt32(101) |
| | | }; |
| | | task_call task_Call = new task_call() |
| | | { |
| | | d_task_type = newTask.TaskType == (int)TaskTypeEnum.Inbound ? 1 : 2, |
| | | d_floor = 1, |
| | | d_involed1 = newTask.SourceAddress, |
| | | d_involed2 = newTask.TargetAddress, |
| | | d_involed5 = newTask.TaskNum, |
| | | }; |
| | | SqlSugarHelper.DbAGV.Insertable(task_Call).ExecuteCommand(); |
| | | return content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent GetAGVStatus() |
| | | { |
| | | try |
| | | { |
| | | var x = _Socket.GetAGVStatus(); |
| | | return WebResponseContent.Instance.OK(data: x); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent GetStationStatus(string StationName) |
| | | { |
| | | try |
| | | { |
| | | var x = _Socket.GetStationStatus(StationName); |
| | | return WebResponseContent.Instance.OK(data: x); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | #endregion 澶栭儴鎺ュ彛鏂规硶 |
| | | |
| | | |
| | | |
| | | } |
| | | } |