zhangchengsong
2026-01-20 97485ed8543cc34a21c7e42fdbd1be3d8c03392c
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -151,6 +151,11 @@
                    else if(task.TaskState == (int)TaskStatusEnum.AGV_Executing)
                    {
                        task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
                    }else if(task.TaskState == (int)TaskStatusEnum.AGV_Exception)
                    {
                        task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt();
                        task.Remark = "";
                    }
                    else
                    {
@@ -478,9 +483,9 @@
                {
                    return WebResponseContent.Instance.Error($"未找到WMSApi地址");
                }
                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}&palletCode={palletCode}");
                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}");
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? throw new Exception("结果返回为空");
                if (responseContent != null && responseContent.Status && responseContent.Data != null)
                if (responseContent.Status && responseContent.Data != null)
                {
                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
                    if (taskDTO != null)
@@ -607,6 +612,34 @@
            }
            return "";
        }
        /// <summary>
        /// å‘WMS成品入库扫码请求更新条码
        /// </summary>
        /// <param name="taskNum">任务号</param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public WebResponseContent RequestInBoundPalletCode(int taskNum,string barCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string address = AppSettings.Get("WMSApiAddress");
                if (string.IsNullOrEmpty(address)) throw new Exception("未找到WMSApi地址");
                string responseStr = HttpHelper.Get($"{address}/api/Task/InBoundPalletCode?taskNum={taskNum}&barCode={barCode}");
                WebResponseContent responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? throw new Exception("未收到返回参数");
                if (!responseContent.Status)
                {
                    return responseContent;
                }
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// å‘WMS申请出库AGV终点
@@ -942,6 +975,11 @@
                        nextStatus = TaskStatusEnum.SC_Executing;
                    }
                }
                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                {
                    task.TaskState = (int)TaskStatusEnum.SC_Executing;
                    nextStatus = TaskStatusEnum.SC_Executing;
                }
                else
                {
                    throw new Exception($"任务类型错误,未找到该任务类型,任务号:【{task.TaskNum}】,任务类型:【{task.TaskType}】");