From f29f358f589f5b1c2589c07b65845650be7aafef Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期一, 08 十二月 2025 21:21:08 +0800
Subject: [PATCH] 代码优化

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs |   62 ++++++++++++++++++++++++++++++-
 1 files changed, 60 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs"
index 4e2449d..9fde9bf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs"
@@ -24,6 +24,7 @@
 using WIDESEA_DTO.System;
 using WIDESEA_ISystemService;
 using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Basic;
 
 namespace WIDESEA_SystemService
 {
@@ -211,9 +212,66 @@
             {
                 switch (key)
                 {
-                    default:
-                        return result;
+                    case "warehouses":
+                        {
+                            List<object> data = new List<object>();
+
+                            {
+                                List<Dt_WarehouseArea> warehouses = BaseDal.Db.Queryable<Dt_WarehouseArea>().ToList();
+                                int index = 0;
+                                foreach (var item in warehouses)
+                                {
+                                    data.Add(new { key = item.Code, value = item.Name });
+                                    index++;
+                                }
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+                    case "locationTypes":
+                        {
+                            List<object> data = new List<object>();
+
+                            {
+                                List<Dt_LocationType> warehouses = BaseDal.Db.Queryable<Dt_LocationType>().ToList();
+                                int index = 0;
+                                foreach (var item in warehouses)
+                                {
+                                    data.Add(new { key = item.LocationType, value = item.LocationTypeDesc });
+                                    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;
                 }
+                return result;
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.3