杨前锦
2025-05-26 d0a265713fd18162f3a82bdcd22e267df7298c7b
HH.WCS.Mobox3/HH.WCS.Mobox3.YNJT_BZP/dispatch/WCSDispatch.cs
File was renamed from HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/dispatch/WCSDispatch.cs
@@ -3,13 +3,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HH.WCS.Mobox3.FJJT.util;
using HH.WCS.Mobox3.FJJT.wms;
using HH.WCS.Mobox3.YNJT_BZP.util;
using HH.WCS.Mobox3.YNJT_BZP.wms;
using Newtonsoft.Json;
using static HH.WCS.Mobox3.FJJT.api.ApiModel;
using static HH.WCS.Mobox3.FJJT.util.ExcetionHelper;
using static HH.WCS.Mobox3.YNJT_BZP.api.ApiModel;
namespace HH.WCS.Mobox3.FJJT.dispatch
namespace HH.WCS.Mobox3.YNJT_BZP.dispatch
{
    internal class WCSDispatch
    {
@@ -46,26 +45,15 @@
                    {
                        result = true;
                    }
                    else
                    {
                        WMSHelper.addAlarmRecord("流程异常", "高", $"下发WCS任务失败,WCS反馈原因:{dataResult.msg}");
                        throw new BusinessException($"下发WCS任务失败,WCS反馈原因:{dataResult.msg}");
                    }
                }
                else
                {
                    WMSHelper.addAlarmRecord("流程异常", "高", $"下发WCS任务失败,WCS没有返回数据");
                    throw new BusinessException($"下发WCS任务失败,WCS没有返回数据");
                }
            }
            catch (BusinessException be)
            {
                throw be;
            }
            catch (Exception ex)
            {
                WMSHelper.addAlarmRecord("系统异常", "高", $"下发WCS任务错误,错误原因:{ex.Message}");
                throw new BusinessException($"下发WCS任务错误,错误原因:{ex.Message}");
            }
            return result;
        }
@@ -93,26 +81,16 @@
                    {
                        result = true;
                    }
                    else
                    {
                        WMSHelper.addAlarmRecord("流程异常", "高", $"取消WCS任务失败,WCS反馈原因:{dataResult.msg}");
                        throw new BusinessException($"取消WCS任务失败,WCS反馈原因:{dataResult.msg}");
                    }
                }
                else
                {
                    WMSHelper.addAlarmRecord("流程异常", "高", $"取消WCS任务失败,WCS没有返回数据");
                    throw new BusinessException($"取消WCS任务失败,WCS没有返回数据");
                }
            }
            catch (BusinessException be)
            {
                throw be;
            }
            catch (Exception ex)
            {
                WMSHelper.addAlarmRecord("系统异常", "高", $"取消WCS任务错误,错误原因:{ex.Message}");
                throw new BusinessException($"取消WCS任务错误,错误原因:{ex.Message}");
            }
            return result;
        }
@@ -146,26 +124,17 @@
                    {
                        deviceStatusDatas = JsonConvert.DeserializeObject<List<DeviceStatusData>>(response);
                    }
                    else
                    {
                        WMSHelper.addAlarmRecord("流程异常", "高", $"获取设备状态失败,WCS反馈原因:{dataResult.msg}");
                        throw new BusinessException($"获取设备状态失败,WCS反馈原因:{dataResult.msg}");
                    }
                }
                else
                {
                    WMSHelper.addAlarmRecord("流程异常", "高", $"获取设备状态失败,WCS没有返回数据");
                    throw new BusinessException($"获取设备状态失败,WCS没有返回数据");
                }
            }
            catch (BusinessException be)
            {
                throw be;
            }
            catch (Exception ex)
            {
                WMSHelper.addAlarmRecord("系统异常", "高", $"获取设备状态错误,错误原因:{ex.Message}");
                throw new BusinessException($"获取设备状态错误,错误原因:{ex.Message}");
            }
            return deviceStatusDatas;
        }
@@ -193,26 +162,16 @@
                    {
                        result = true;
                    }
                    else
                    {
                        WMSHelper.addAlarmRecord("流程异常", "高", $"修改任务优先级失败,WCS反馈原因:{dataResult.msg}");
                        throw new BusinessException($"修改任务优先级失败,WCS反馈原因:{dataResult.msg}");
                    }
                }
                else
                {
                    WMSHelper.addAlarmRecord("流程异常", "高", $"修改任务优先级失败,WCS没有返回数据");
                    throw new BusinessException($"修改任务优先级失败,WCS没有返回数据");
                }
            }
            catch (BusinessException be)
            {
                throw be;
            }
            catch (Exception ex)
            {
                WMSHelper.addAlarmRecord("系统异常", "高", $"修改任务优先级错误,错误原因:{ex.Message}");
                throw new BusinessException($"修改任务优先级错误,错误原因:{ex.Message}");
            }
            return result;
        }
@@ -247,26 +206,15 @@
                    {
                        result = true;
                    }
                    else
                    {
                        WMSHelper.addAlarmRecord("流程异常", "高", $"AGV安全交互请求失败,WCS反馈原因:{dataResult.msg}");
                        throw new BusinessException($"AGV安全交互请求失败,WCS反馈原因:{dataResult.msg}");
                    }
                }
                else
                {
                    WMSHelper.addAlarmRecord("流程异常", "高", $"AGV安全交互请求失败,WCS没有返回数据");
                    throw new BusinessException($"AGV安全交互请求失败,WCS没有返回数据");
                    LogHelper.Info("调用WCS安全请求接口失败", "AGV");
                }
            }
            catch (BusinessException be)
            {
                throw be;
            }
            catch (Exception ex)
            {
                WMSHelper.addAlarmRecord("系统异常", "高", $"AGV安全交互请求错误,错误原因:{ex.Message}");
                throw new BusinessException($"AGV安全交互请求错误,错误原因:{ex.Message}");
                LogHelper.Info($"调用WCS安全请求接口错误,错误原因:{ex.Message}", "AGV");
            }
            return result;
        }