From 1f9a89458a66c12c1f7dfbceb2588ada8fbf16f4 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期四, 13 十一月 2025 17:35:36 +0800
Subject: [PATCH] 新增移库页面与WebSocket支持,优化任务逻辑新增移库页面支持移库任务输入与提交。新增 WebSocket 支持(`websocket.js`、`WebSocketSetup.cs`),实现实时通信功能。 在任务状态枚举中新增 AGV 移库任务状`TaskStatusEnum.cs`)- 重构库存数据展示页面(`Home.vue`),新增数据总览与图表展示功能。 - 新增库存数据接口(`StockInfoService.cs`、`StockInfoController.cs`),支持库存统计与展示。 - 优化任务状态管理逻辑,支持 AGV 移库任务(`Dt_TaskService.cs`)。
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 237 insertions(+), 1 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs"
index 13329dd..5dde269 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_DictionaryController.cs"
@@ -370,7 +370,243 @@
result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
}
break;
-
+ case "operateTypeEnum":
+ {
+ List<object> data = new List<object>();
+
+ #region operateTypeEnum
+ {
+ Type type = typeof(OperateTypeEnum);
+ List<int> enums = Enum.GetValues(typeof(OperateTypeEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(OperateTypeEnum).GetField(((OperateTypeEnum)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+ case "LocationState":
+ {
+ List<object> data = new List<object>();
+
+ #region LocationEnum
+ {
+ Type type = typeof(LocationEnum);
+ List<int> enums = Enum.GetValues(typeof(LocationEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(LocationEnum).GetField(((LocationEnum)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+ case "StockStateEmun":
+ {
+ List<object> data = new List<object>();
+
+ #region StockStateEmun
+ {
+ Type type = typeof(StockStateEmun);
+ List<int> enums = Enum.GetValues(typeof(StockStateEmun)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(StockStateEmun).GetField(((StockStateEmun)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+ case "EnableEnum":
+ {
+ List<object> data = new List<object>();
+
+ #region EnableEnum
+ {
+ Type type = typeof(EnableEnum);
+ List<int> enums = Enum.GetValues(typeof(EnableEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(EnableEnum).GetField(((EnableEnum)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+
+ case "OrderStateEmun":
+ {
+ List<object> data = new List<object>();
+
+ #region OrderStateEmun
+ {
+ Type type = typeof(OrderStateEmun);
+ List<int> enums = Enum.GetValues(typeof(OrderStateEmun)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(OrderStateEmun).GetField(((OrderStateEmun)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+
+ case "OrderTypeEmun":
+ {
+ List<object> data = new List<object>();
+
+ #region OrderTypeEmun
+ {
+ Type type = typeof(OrderTypeEmun);
+ List<int> enums = Enum.GetValues(typeof(OrderTypeEmun)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(OrderTypeEmun).GetField(((OrderTypeEmun)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+
+ case "OrderCreateTypeEmun":
+ {
+ List<object> data = new List<object>();
+
+ #region OrderCreateTypeEmun
+ {
+ Type type = typeof(OrderCreateTypeEmun);
+ List<int> enums = Enum.GetValues(typeof(OrderCreateTypeEmun)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(OrderCreateTypeEmun).GetField(((OrderCreateTypeEmun)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+
+ case "InventoryStatus":
+ {
+ List<object> data = new List<object>();
+
+ #region InventoryStatus
+ {
+ Type type = typeof(InventoryStatus);
+ List<int> enums = Enum.GetValues(typeof(InventoryStatus)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(InventoryStatus).GetField(((InventoryStatus)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++;
+ }
+ }
+ #endregion
+
+ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+ }
+ break;
+
}
return result;
}
--
Gitblit v1.9.3