File was renamed from HH.WCS.Mobox3/HH.WCS.Mobox3.FJJT/dispatch/WCSDispatch.cs |
| | |
| | | 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 |
| | | { |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |