| | |
| | | using System.Collections.Generic; |
| | | using System.IdentityModel.Protocols.WSTrust; |
| | | using System.Threading.Tasks; |
| | | |
| | | using HH.WCS.Mobox3.AnGang.config; |
| | | using HH.WCS.Mobox3.AnGang.Helper; |
| | | using HH.WCS.Mobox3.AnGang.Helpers; |
| | | using HH.WCS.Mobox3.AnGang.Models; |
| | | using HH.WCS.Mobox3.AnGang.Services; |
| | | |
| | | using HH.WCS.Mobox3.AnGang.core; |
| | | using HH.WCS.Mobox3.AnGang.models; |
| | | using Newtonsoft.Json; |
| | | using static HH.WCS.Mobox3.AnGang.api.ApiModel; |
| | | |
| | | using static HH.WCS.Mobox3.AnGang.Controllers.ApiModel; |
| | | using static HH.WCS.Mobox3.AnGang.Dtos.Request.AgvRequest; |
| | | |
| | | namespace HH.WCS.Mobox3.AnGang.Dispatch { |
| | | namespace HH.WCS.Mobox3.AnGang.dispatch { |
| | | /// <summary> |
| | | /// 国自调度辅助类 |
| | | /// </summary> |
| | | public class GZRobot { |
| | | private static readonly HttpHelper apiHelper = new HttpHelper(); |
| | | private static readonly string baseUrl = AppStart.Settings.Config.RCSApiUrl;//配置文件获取国自调度地址 |
| | | private static readonly string baseUrl = Settings.RCSApiUrl;//配置文件获取国自调度地址 |
| | | //private static readonly string logName = "guozi"; |
| | | public static List<IOState> GetIO() { |
| | | var result = apiHelper.Get(baseUrl + "api/engine/view/iostates/"); |
| | |
| | | var result = apiHelper.Post(baseUrl + "api/engine/tasks/iostates/", JsonConvert.SerializeObject(data)); |
| | | var dataResult = JsonConvert.DeserializeObject<gzResult<IOStatesInfoResult>>(result); |
| | | } |
| | | |
| | | |
| | | public static int CreateOrder(string taskNo, int priority, string param, string ts = "churuku", string created_user = "hanhe") { |
| | | LogHelper.Info($"CreateOrder参数信息:taskNo:{taskNo},priority:{priority},param:{param},ts:{ts},created_user:{created_user}", "API"); |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static GzResult orderStatusReport(orderStatusReportParme model) { |
| | | LogHelper.Info("RCS国自AGV任务状态回报:" + JsonConvert.SerializeObject(model), "HosttoagvTask"); |
| | | GzResult result = new GzResult(); |
| | | AgvTaskState agv = new AgvTaskState(); |
| | | |
| | |
| | | if (agv.state != 0) { |
| | | agv.task_no = model.orderName; |
| | | agv.forklift_no = model.agvIDList; |
| | | AgvService.OperateAgvTaskStatus(agv); |
| | | WCSCore.OperateAgvTaskStatus(agv); |
| | | } |
| | | else { |
| | | result.resultCode = 2; |
| | | result.orderID = model.orderID; |
| | | result.msg = "反馈订单状态失败,orderStatus参数不正确"; |
| | | LogHelper.Info(result.msg, "API"); |
| | | return result; |
| | | } |
| | | |
| | | result.resultCode = 0; |
| | |
| | | if (data.data != null) { |
| | | res = data.data; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) { |
| | | Console.WriteLine(ex.Message); |