yanjinhui
2 天以前 91f8fb7a6b52f5c6ff2119e34ef1359ec79d189e
优化重写plc信号以及编写海康小车报警信号
已添加1个文件
已修改4个文件
120 ■■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HKDeviceAalarmDTO.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/AGV/HIKROBOT/HKDeviceAalarmDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.AGV.HIKROBOT
{
    /// <summary>
    /// æµ·åº·å¼‚常告警DTO
    /// </summary>
    public class HKDeviceAalarmDTO
    {
        /// <summary>
        /// å‡ºçŽ°å¼‚å¸¸çš„ä»»åŠ¡å”¯ä¸€æ ‡è¯†ã€‚
        /// </summary>
        public string robotTaskCode { get; set; }
        /// <summary>
        /// ä»»åŠ¡å¼‚å¸¸å‘Šè­¦å•å·
        /// </summary>
        public string taskWarnCode { get; set; }
        /// <summary>
        /// åˆæ¬¡å‡ºçŽ°æ•…éšœçš„æ—¶é—´
        /// </summary>
        public string startTime { get; set; }
        /// <summary>
        /// æ­£åœ¨æ‰§è¡Œä»»åŠ¡çš„æœºå™¨äººå”¯ä¸€æ ‡è¯†ã€‚
        /// </summary>
        public string singleRobotCode { get; set; }
        /// <summary>
        /// è‡ªå®šä¹‰æ•…障码
        /// </summary>
        public string errorCode { get; set; }
        /// <summary>
        /// è‡ªå®šä¹‰æ•…障消息
        /// </summary>
        public string errorMsg { get; set; }
        /// <summary>
        /// è‡ªå®šä¹‰æ‰©å±•字段
        /// </summary>
        public string extra { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -312,6 +312,8 @@
        /// <param name="TaskCode">任务号</param>
        /// <returns></returns>
        WebResponseContent Hikvisiontaskscontinue(string TaskCode, string Address = null);
        /// <summary>
        /// å¹³åº“货位上下架容器
        /// </summary>
@@ -326,5 +328,13 @@
        /// <param name="upLocationStatusDTO"></param>
        /// <returns></returns>
        WebResponseContent UpLocationStatus(UpLocationStatusDTO upLocationStatusDTO);
        /// <summary>
        /// æµ·åº·è®¾å¤‡æŠ¥è­¦ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
         WebResponseContent HKDeviceAlarm(HKDeviceAalarmDTO hKDeviceAalarmDTO);
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs
@@ -460,6 +460,49 @@
            {
                _trackloginfoService.AddTrackLog(hIKROBOTTaskContinue, content, "海康AGV继续执行任务", "", hIKROBOTReturn.message);
            }
            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;
        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs
@@ -162,7 +162,7 @@
                                        }
                                        catch (Exception ex)
                                        {
                                            task.ExceptionMessage = $"【{task.SourceAddress}】写入3楼出库箱放到位失败";
                                            task.ExceptionMessage = $"【{task.SourceAddress}】写入3楼出库箱放到位失败{ex.Message}";
                                            task.Remark = $"{device.DeviceCode}_Outboundboxon_{1}_{task.SourceAddress}"; throw;
                                        }
                                        
@@ -198,7 +198,7 @@
                                        catch (Exception ex)
                                        {
                                            task.ExceptionMessage = $"【{task.TargetAddress}】写入4楼空箱放到位失败";
                                            task.ExceptionMessage = $"【{task.TargetAddress}】写入4楼空箱放到位失败{ex.Message}";
                                            task.Remark = $"{device.DeviceCode}_Emptyboxplacedinposition_{1}_{task.TargetAddress}";
                                        }
                                        
@@ -234,7 +234,7 @@
                                        catch (Exception ex)
                                        {
                                            task.ExceptionMessage = $"【{task.SourceAddress}】写入4楼出库取箱完成失败";
                                            task.ExceptionMessage = $"【{task.SourceAddress}】写入4楼出库取箱完成失败{ex.Message}";
                                            task.Remark = $"{device.DeviceCode}_Outboundboxretrievalcompleted_{1}_{task.SourceAddress}";
                                        }
                                      
@@ -271,7 +271,7 @@
                                        catch (Exception ex)
                                        {
                                            task.ExceptionMessage = $"【{Address}】关闭请求进入失败!";
                                            task.ExceptionMessage = $"【{Address}】关闭请求进入失败!{ex.Message}";
                                            task.Remark = $"{device.DeviceCode}_RequestToEnter_{false}_{Address}";
                                        }
                                        
@@ -315,7 +315,7 @@
                                    catch (Exception ex)
                                    {
                                        task.ExceptionMessage = $"【TSJR3F】3楼读码触发失败!";
                                        task.ExceptionMessage = $"【TSJR3F】3楼读码触发失败!{ex.Message}";
                                        task.Remark = $"{device.DeviceCode}_Codereadingtriggered_{1}_TSJR3F";
                                    }
                                    
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs