dengjunjie
昨天 28a788d3fca51fb4fd2f668b90fa95e87c2633a1
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.RGV.FOURBOT;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_Tasks
@@ -16,7 +19,9 @@
        #region ä¸‹å‘凯乐士AGV任务
        public void SendGALAXISTask(List<Dt_Task> tasks)
        {
            WebResponseContent content = new WebResponseContent(); // åˆ›å»ºå“åº”对象
            GALAXISTaskInfo gALAXISTaskInfo = new();
            GALAXISReturn agvContent = new();
            try
            {
                gALAXISTaskInfo.groupId = DateTime.Now.ToString("yyMMddHHmmss");
@@ -37,7 +42,8 @@
                }
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("未找到凯乐士AGV任务下发接口配置信息!请检查接口配置");
                string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize());
                GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>();
                agvContent = response.DeserializeObject<GALAXISReturn>();
                content.OK(data: agvContent);
                if (agvContent.success)
                {
                    if (agvContent.data.returnStatus != 0) throw new Exception(agvContent.data.returnInfo);
@@ -45,12 +51,19 @@
                    {
                        task.TaskState = (int)TaskStatusEnum.Execut;
                    });
                    content.OK();
                    _taskService.UpdateData(tasks);
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(TaskJob), ex.Message, ex);
                content.Error(ex.Message);
                //WriteError(nameof(TaskJob), ex.Message, ex);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(gALAXISTaskInfo, content, "下发凯乐士AGV任务", "", agvContent.data.returnInfo);
                //dt_trackloginfoService.Instance.AddTrackLog(outTaskInfo, content, "接收宇航WMS出库任务下发", "", $"{msg},变更结果:{content.Status}");
            }
        }
        #endregion