yanjinhui
2 天以前 fe596f9db05103917c9257348edcbd3ecb5b46e8
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs
@@ -34,9 +34,9 @@
            try
            {
                Dt_HKLocationInfo? hKLocationInfo = null;
                if (taskType==(int)TaskTypeEnum.STURR)
                if (taskType == (int)TaskTypeEnum.STURR)
                {
                    var reslut=_stationInfo.Repository.QueryFirst(x=>x.StationCode==taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点货位【{taskDTO.fromLocationCode}】");
                    var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点货位【{taskDTO.fromLocationCode}】");
                }
                #region ç‚¹åˆ°ç‚¹
                if (!string.IsNullOrEmpty(taskDTO.toLocationCode))
@@ -143,7 +143,7 @@
                        throw new Exception($"终点站台【{taskDTO.toLocationCode}】状态不为空闲!");
                    }
                }
                    Dt_Task dt_Task = new Dt_Task()
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
@@ -255,7 +255,7 @@
            {
                var tasktype = (TaskTypeEnum)Enum.GetValues(typeof(TaskTypeEnum)).GetValue(task.TaskType - 1);
                hIKROBOTTaskSubmit.initPriority = task.Grade;
                if (task.PalletCode== "MR-Q3-600LE-D(M)")
                if (task.PalletCode == "MR-Q3-600LE-D(M)")
                {
                    hIKROBOTTaskSubmit.robotType = "19"; //海康 è½¬è¿è½¦
                }
@@ -464,5 +464,48 @@
            return content;
        }
        public WebResponseContent HKDeviceAlarm(HKDeviceAalarmDTO hKDeviceAalarmDTO)
        {
            WebResponseContent content = new WebResponseContent();
            WMSReturn wMSReturn = null;
            HKDeviceAalarmDTO hIKROBOTDeviceAlarm = null;
            try
            {
                Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(HKDeviceAalarmDTO)) ?? throw new Exception("未找到上报海康AGV设备报警接口配置信息!请检查接口配置");
                hIKROBOTDeviceAlarm = new HKDeviceAalarmDTO()
                {
                    robotTaskCode = hKDeviceAalarmDTO.robotTaskCode,
                    taskWarnCode = hKDeviceAalarmDTO.taskWarnCode,
                    startTime = hKDeviceAalarmDTO.startTime,
                    singleRobotCode = hKDeviceAalarmDTO.singleRobotCode,
                    errorCode = hKDeviceAalarmDTO.errorCode,
                    errorMsg = hKDeviceAalarmDTO.errorMsg,
                    extra = hKDeviceAalarmDTO.extra,
                };
                string response = HttpHelper.Post(apiInfo.ApiAddress, hIKROBOTDeviceAlarm.Serialize());
                wMSReturn = response.DeserializeObject<WMSReturn>();
                if (wMSReturn.success == true && wMSReturn.message == "success")
                {
                    content.OK("上报海康AGV设备报警信息成功");
                }
                else
                {
                    content.Error(wMSReturn.message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            finally
            {
                _trackloginfoService.AddTrackLog(hIKROBOTDeviceAlarm, content, "上报海康AGV设备报警信息", "", "");
            }
            return content;
        }
    }
}