From 4f2fb79143f0545e96f114c92e1da733b2d9716a Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期六, 07 二月 2026 21:31:05 +0800
Subject: [PATCH] 1
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 259 insertions(+), 16 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs"
index 4e2449d..b0ab878 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs"
@@ -13,6 +13,7 @@
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
+using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
@@ -146,20 +147,7 @@
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
{
@@ -211,9 +199,264 @@
{
switch (key)
{
- default:
- return result;
+ case "taskTypeEnum":
+ {
+ 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;
+ case "taskStatusEnum":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(InTaskStatusEnum);
+ List<int> enums = Enum.GetValues(typeof(InTaskStatusEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(InTaskStatusEnum).GetField(((InTaskStatusEnum)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++;
+ }
+ }
+
+ {
+ Type type = typeof(OutTaskStatusEnum);
+ List<int> enums = Enum.GetValues(typeof(OutTaskStatusEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(OutTaskStatusEnum).GetField(((OutTaskStatusEnum)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++;
+ }
+ }
+
+ {
+ Type type = typeof(RelocationTaskStatusEnum);
+ List<int> enums = Enum.GetValues(typeof(RelocationTaskStatusEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(RelocationTaskStatusEnum).GetField(((RelocationTaskStatusEnum)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 "enableStatusEnum":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(EnableStatusEnum);
+ List<int> enums = Enum.GetValues(typeof(EnableStatusEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(EnableStatusEnum).GetField(((EnableStatusEnum)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 "locationStatusEnum":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(LocationStatusEnum);
+ List<int> enums = Enum.GetValues(typeof(LocationStatusEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(LocationStatusEnum).GetField(((LocationStatusEnum)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 "locationDepth":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(LocationDepth);
+ List<int> enums = Enum.GetValues(typeof(LocationDepth)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(LocationDepth).GetField(((LocationDepth)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 "locationTypeEnum":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(LocationTypeEnum);
+ List<int> enums = Enum.GetValues(typeof(LocationTypeEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(LocationTypeEnum).GetField(((LocationTypeEnum)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 "stockStatusEmun":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(StockStatusEmun);
+ List<int> enums = Enum.GetValues(typeof(StockStatusEmun)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(StockStatusEmun).GetField(((StockStatusEmun)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 "warehouseEnum":
+ {
+ List<object> data = new List<object>();
+
+ {
+ Type type = typeof(WarehouseEnum);
+ List<int> enums = Enum.GetValues(typeof(WarehouseEnum)).Cast<int>().ToList();
+ int index = 0;
+ foreach (var item in enums)
+ {
+ FieldInfo? fieldInfo = typeof(WarehouseEnum).GetField(((WarehouseEnum)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;
}
+ return result;
}
catch (Exception ex)
{
--
Gitblit v1.9.3