From 3799054e5cd8a42a49cc902cc9d9cb46059b3a7d Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期日, 14 九月 2025 10:54:54 +0800
Subject: [PATCH] 添加WebSocket将设备运行信息推送到前端,前端将数据接收赋值到对应设备监控页面

---
 项目代码/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs |  510 ++++++--------------------------------------------------
 1 files changed, 57 insertions(+), 453 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs"
index f776039..9bb8716 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_SystemService/Sys_DictionaryService.cs"
@@ -109,22 +109,6 @@
                 }
                 vueDictionaryDTOs.AddRange(selectDics);
             }
-
-            //object GetSourceData(string dicNo, string dbSql, object data)
-            //{
-            //    if (string.IsNullOrEmpty(dbSql))
-            //    {
-            //        return data;
-            //    }
-            //    return BaseDal.QueryObjectDataBySql(dbSql, null);
-            //}
-            //List<VueDictionaryDTO> vueDictionaryDTOs = dicConfig.Select(item => new VueDictionaryDTO
-            //{
-            //    DicNo = item.dicNo,
-            //    Config = item.config,
-            //    Data = GetSourceData(item.dicNo, item.dbSql, item.list)
-            //}).ToList();
-
             try
             {
                 List<string> dicList = dicNos.ToList();
@@ -211,54 +195,6 @@
                             }
                         }
                         break;
-                    case "returnStatus":
-                        {
-                            List<object> data = new List<object>();
-                            Type type = typeof(ReturnOrderStatusEnum);
-                            List<int> enums = Enum.GetValues(typeof(ReturnOrderStatusEnum)).Cast<int>().ToList();
-                            int index = 0;
-                            foreach (var item in enums)
-                            {
-                                FieldInfo? fieldInfo = typeof(ReturnOrderStatusEnum).GetField(((ReturnOrderStatusEnum)item).ToString());
-                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                if (description != null)
-                                {
-                                    data.Add(new { key = item.ToString(), value = description.Description });
-                                }
-                                else
-                                {
-                                    data.Add(new { key = item.ToString(), value = item.ToString() });
-                                }
-                                index++;
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "returnType":
-                        {
-                            List<object> data = new List<object>();
-                            Type type = typeof(ReturnOrderTypeEnum);
-                            List<int> enums = Enum.GetValues(typeof(ReturnOrderTypeEnum)).Cast<int>().ToList();
-                            int index = 0;
-                            foreach (var item in enums)
-                            {
-                                FieldInfo? fieldInfo = typeof(ReturnOrderTypeEnum).GetField(((ReturnOrderTypeEnum)item).ToString());
-                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                if (description != null)
-                                {
-                                    data.Add(new { key = item.ToString(), value = description.Description });
-                                }
-                                else
-                                {
-                                    data.Add(new { key = item.ToString(), value = item.ToString() });
-                                }
-                                index++;
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
                     case "taskType":
                         {
                             List<object> data = new List<object>();
@@ -331,112 +267,6 @@
                                     data.Add(new { key = item.ToString(), value = item.ToString() });
                                 }
                                 index++;
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-
-                    case "outLockStockStatusEnum":
-                        {
-                            List<object> data = new List<object>();
-                            Type type = typeof(OutLockStockStatusEnum);
-                            List<int> enums = Enum.GetValues(typeof(OutLockStockStatusEnum)).Cast<int>().ToList();
-                            int index = 0;
-                            foreach (var item in enums)
-                            {
-                                FieldInfo? fieldInfo = typeof(OutLockStockStatusEnum).GetField(((OutLockStockStatusEnum)item).ToString());
-                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                if (description != null)
-                                {
-                                    data.Add(new { key = item.ToString(), value = description.Description });
-                                }
-                                else
-                                {
-                                    data.Add(new { key = item.ToString(), value = item.ToString() });
-                                }
-                                index++;
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "inOrderType":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(InOrderTypeEnum);
-                                List<int> enums = Enum.GetValues(typeof(InOrderTypeEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(InOrderTypeEnum).GetField(((InOrderTypeEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "outOrderType":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(OutOrderTypeEnum);
-                                List<int> enums = Enum.GetValues(typeof(OutOrderTypeEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(OutOrderTypeEnum).GetField(((OutOrderTypeEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "orderDetailStatusEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(OrderDetailStatusEnum);
-                                List<int> enums = Enum.GetValues(typeof(OrderDetailStatusEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(OrderDetailStatusEnum).GetField(((OrderDetailStatusEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
                             }
 
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
@@ -581,26 +411,6 @@
                         {
                             List<object> data = new List<object>();
 
-                            //{
-                            //    Type type = typeof(TaskTypeEnum);
-                            //    List<int> enums = Enum.GetValues(typeof(TaskTypeEnum)).Cast<int>().ToList();
-                            //    int index = 0;
-                            //    foreach (var item in enums)
-                            //    {
-                            //        FieldInfo? fieldInfo = typeof(TaskTypeEnum).GetField(((TaskTypeEnum)item).ToString());
-                            //        DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                            //        if (description != null)
-                            //        {
-                            //            data.Add(new { key = item.ToString(), value = description.Description });
-                            //        }
-                            //        else
-                            //        {
-                            //            data.Add(new { key = item.ToString(), value = item.ToString() });
-                            //        }
-                            //        index++;
-                            //    }
-                            //}
-
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
@@ -628,25 +438,6 @@
                                 }
                             }
 
-                            //{
-                            //    Type type = typeof(TaskStatusEnum);
-                            //    List<int> enums = Enum.GetValues(typeof(TaskStatusEnum)).Cast<int>().ToList();
-                            //    int index = 0;
-                            //    foreach (var item in enums)
-                            //    {
-                            //        FieldInfo? fieldInfo = typeof(TaskStatusEnum).GetField(((TaskStatusEnum)item).ToString());
-                            //        DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                            //        if (description != null)
-                            //        {
-                            //            data.Add(new { key = item.ToString(), value = description.Description });
-                            //        }
-                            //        else
-                            //        {
-                            //            data.Add(new { key = item.ToString(), value = item.ToString() });
-                            //        }
-                            //        index++;
-                            //    }
-                            //}
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
@@ -693,57 +484,6 @@
                                     data.Add(new { key = item.ToString(), value = item.ToString() });
                                 }
                                 index++;
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "outStockStatus":
-                        {
-                            List<object> data = new List<object>();
-                            Type type = typeof(OutLockStockStatusEnum);
-                            List<int> enums = Enum.GetValues(typeof(OutLockStockStatusEnum)).Cast<int>().ToList();
-                            int index = 0;
-                            foreach (var item in enums)
-                            {
-                                FieldInfo? fieldInfo = typeof(OutLockStockStatusEnum).GetField(((OutLockStockStatusEnum)item).ToString());
-                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                if (description != null)
-                                {
-                                    data.Add(new { key = item.ToString(), value = description.Description });
-                                }
-                                else
-                                {
-                                    data.Add(new { key = item.ToString(), value = item.ToString() });
-                                }
-                                index++;
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "receiveOrderTypeEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(ReceiveOrderTypeEnum);
-                                List<int> enums = Enum.GetValues(typeof(ReceiveOrderTypeEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(ReceiveOrderTypeEnum).GetField(((ReceiveOrderTypeEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
                             }
 
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
@@ -814,87 +554,6 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
-                    case "receiveStatus":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(ReceiveOrderStatusEnum);
-                                List<int> enums = Enum.GetValues(typeof(ReceiveOrderStatusEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(ReceiveOrderStatusEnum).GetField(((ReceiveOrderStatusEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break; 
-                    case "purchaseType":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(PurchaseOrderTypeEnum);
-                                List<string> enums = Enum.GetValues(typeof(PurchaseOrderTypeEnum)).Cast<string>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    //FieldInfo? fieldInfo = typeof(PurchaseOrderTypeEnum).GetField(((PurchaseOrderTypeEnum)item).ToString());
-                                    //DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    //if (description != null)
-                                    //{
-                                    //    data.Add(new { key = item.ToString(), value = description.Description });
-                                    //}
-                                    //else
-                                    //{
-                                    //    data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    //}
-                                    //index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break; 
-                    case "purchaseOrderStatus":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(PurchaseOrderStatusEnum);
-                                List<int> enums = Enum.GetValues(typeof(PurchaseOrderStatusEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(PurchaseOrderStatusEnum).GetField(((PurchaseOrderStatusEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
                     case "printStatus":
                         {
                             List<object> data = new List<object>();
@@ -906,87 +565,6 @@
                                 foreach (var item in enums)
                                 {
                                     FieldInfo? fieldInfo = typeof(PrintStatusEnum).GetField(((PrintStatusEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "checkOrderStatusEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(CheckOrderStatusEnum);
-                                List<int> enums = Enum.GetValues(typeof(CheckOrderStatusEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(CheckOrderStatusEnum).GetField(((CheckOrderStatusEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "checkAcceptEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(CheckAcceptEnum);
-                                List<string> enumNames = Enum.GetNames(typeof(CheckAcceptEnum)).ToList();
-                                int index = 0;
-                                foreach (var item in enumNames)
-                                {
-                                    FieldInfo? fieldInfo = typeof(CheckAcceptEnum).GetField((item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
-                    case "checkUploadEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(CheckUploadEnum);
-                                List<int> enums = Enum.GetValues(typeof(CheckUploadEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(CheckUploadEnum).GetField(((CheckUploadEnum)item).ToString());
                                     DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                     if (description != null)
                                     {
@@ -1030,33 +608,6 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
-                    case "materielSourceTypeEnum":
-                        {
-                            List<object> data = new List<object>();
-
-                            {
-                                Type type = typeof(MaterielSourceTypeEnum);
-                                List<int> enums = Enum.GetValues(typeof(MaterielSourceTypeEnum)).Cast<int>().ToList();
-                                int index = 0;
-                                foreach (var item in enums)
-                                {
-                                    FieldInfo? fieldInfo = typeof(MaterielSourceTypeEnum).GetField(((MaterielSourceTypeEnum)item).ToString());
-                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
-                                    if (description != null)
-                                    {
-                                        data.Add(new { key = item.ToString(), value = description.Description });
-                                    }
-                                    else
-                                    {
-                                        data.Add(new { key = item.ToString(), value = item.ToString() });
-                                    }
-                                    index++;
-                                }
-                            }
-
-                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
-                        }
-                        break;
                     case "materielTypeEnum":
                         {
                             List<object> data = new List<object>();
@@ -1084,17 +635,70 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
-                    case "customerOutRuleEnum":
+                    case "materielUnitEnum":
                         {
                             List<object> data = new List<object>();
 
                             {
-                                Type type = typeof(CustomerOutRuleEnum);
-                                List<int> enums = Enum.GetValues(typeof(CustomerOutRuleEnum)).Cast<int>().ToList();
+                                Type type = typeof(MaterielUnitEnum);
+                                List<string> enumNames = Enum.GetNames(typeof(MaterielUnitEnum)).ToList();
+                                int index = 0;
+                                foreach (var item in enumNames)
+                                {
+                                    FieldInfo? fieldInfo = typeof(MaterielUnitEnum).GetField((item).ToString());
+                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
+                                    if (description != null)
+                                    {
+                                        data.Add(new { key = item.ToString(), value = description.Description });
+                                    }
+                                    else
+                                    {
+                                        data.Add(new { key = item.ToString(), value = item.ToString() });
+                                    }
+                                    index++;
+                                }
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+                    case "agvStationAreaEnum":
+                        {
+                            List<object> data = new List<object>();
+
+                            {
+                                Type type = typeof(AGVStationAreaEnum);
+                                List<int> enums = Enum.GetValues(typeof(AGVStationAreaEnum)).Cast<int>().ToList();
                                 int index = 0;
                                 foreach (var item in enums)
                                 {
-                                    FieldInfo? fieldInfo = typeof(CustomerOutRuleEnum).GetField(((CustomerOutRuleEnum)item).ToString());
+                                    FieldInfo? fieldInfo = typeof(AGVStationAreaEnum).GetField(((AGVStationAreaEnum)item).ToString());
+                                    DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
+                                    if (description != null)
+                                    {
+                                        data.Add(new { key = item.ToString(), value = description.Description });
+                                    }
+                                    else
+                                    {
+                                        data.Add(new { key = item.ToString(), value = item.ToString() });
+                                    }
+                                    index++;
+                                }
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+                    case "materielInvOrgEnum":
+                        {
+                            List<object> data = new List<object>();
+                            {
+                                Type type = typeof(MaterielInvOrgEnum);
+                                List<int> enums = Enum.GetValues(typeof(MaterielInvOrgEnum)).Cast<int>().ToList();
+                                int index = 0;
+                                foreach (var item in enums)
+                                {
+                                    FieldInfo? fieldInfo = typeof(MaterielInvOrgEnum).GetField(((MaterielInvOrgEnum)item).ToString());
                                     DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                     if (description != null)
                                     {

--
Gitblit v1.9.3