wangxinhui
5 天以前 9ec715d2deb18a269dd49c48da91a36632d08c81
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs
@@ -83,6 +83,87 @@
            return content;
        }
        /// <summary>
        /// CTU取消任务
        /// </summary>
        public WebResponseContent AgvBoxApplyPass(AgvCTUCancelDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CTUCancelTask)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到AGV取消任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, applyPassDTO.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
                {
                    content.OK(agvContent.Message);
                }
                else
                {
                    content.Error(agvContent.Message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// AGV成品取放货通知
        /// </summary>
        public WebResponseContent AgvBoxApplyPass(AGVBoxApplyPassDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CPBoxApplyPass)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == SecureReply.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, applyPassDTO.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
                {
                    content.OK(agvContent.Message);
                }
                else
                {
                    content.Error(agvContent.Message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        public WebResponseContent AgvPreScheduleTask(AgvScheduleTaskDTO scheduleTaskDTO, APIEnum ScheduleTask = APIEnum.AGV_CTUScheduleTaskTask)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == ScheduleTask.ToString())?.ApiAddress;
                if (string.IsNullOrEmpty(apiAddress))
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, scheduleTaskDTO.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
                {
                    content.OK(agvContent.Message);
                }
                else
                {
                    content.Error(agvContent.Message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// AGV任务状态刷新/AGV任务完成
        /// </summary>
        /// <param name="agvUpdateModel"></param>
@@ -101,7 +182,7 @@
                    return WebResponseContent.Instance.Error($"未找到发送AGV任务接口,请检查接口配置");
                string response = HttpHelper.Post(apiAddress, agvPodModel.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "0")
                if (agvContent.Code == "1")
                {
                    content.OK(agvContent.Message);
                }