From 8f872af917daaf693368b166a6985410976ca30a Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <1247017146@qq.com> Date: 星期一, 07 四月 2025 14:23:43 +0800 Subject: [PATCH] 优化底层查询添加 --- Code Management/WCS/WIDESEAWCS_Client/package.json | 2 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocol.cs | 2 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/WIDESEAWCS_IProcessService.csproj | 2 Code Management/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue | 1 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DispatchInfo.cs | 2 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocolDetail.cs | 2 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceInfo.cs | 2 Code Management/WCS/WIDESEAWCS_Client/src/views/system/Sys_User.vue | 1 Code Management/WMS/WIDESEA_WMSClient/src/api/http.js | 2 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs | 121 +++++++++++-- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs | 64 ++++++ Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/ObjectExtension.cs | 31 ++ Code Management/WCS/WIDESEAWCS_Client/src/api/http.js | 2 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs | 66 +----- Code Management/WMS/WIDESEA_WMSClient/package-lock.json | 204 ++++++++++------------ Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs | 9 16 files changed, 309 insertions(+), 204 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Client/package.json b/Code Management/WCS/WIDESEAWCS_Client/package.json index 3735f3a..58b8ffa 100644 --- a/Code Management/WCS/WIDESEAWCS_Client/package.json +++ b/Code Management/WCS/WIDESEAWCS_Client/package.json @@ -22,7 +22,7 @@ "vue": "^3.2.37", "vue-draggable-next": "^2.0.1", "vue-router": "^4.0.0-0", - "vuex": "^4.0.0-0", + "vuex": "^4.0.0-0", "wangeditor": "^4.7.6" }, "devDependencies": { diff --git a/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js b/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js index 10258dc..a92c0c7 100644 --- a/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js +++ b/Code Management/WCS/WIDESEAWCS_Client/src/api/http.js @@ -20,7 +20,7 @@ } else if (process.env.NODE_ENV == 'production') { - axios.defaults.baseURL = 'http://192.168.20.251:9291/'; + axios.defaults.baseURL = 'http://192.168.20.253:9291/'; } if (!axios.defaults.baseURL.endsWith('/')) { axios.defaults.baseURL+="/"; diff --git a/Code Management/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue b/Code Management/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue index 65f1f75..3bc3b92 100644 --- a/Code Management/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue +++ b/Code Management/WCS/WIDESEAWCS_Client/src/views/quartzJob/deviceInfo.vue @@ -27,6 +27,7 @@ sortName: "createDate", }); const editFormFields = ref({ + id:"", deviceCode: "", deviceName: "", deviceType: "", diff --git a/Code Management/WCS/WIDESEAWCS_Client/src/views/system/Sys_User.vue b/Code Management/WCS/WIDESEAWCS_Client/src/views/system/Sys_User.vue index 21530cd..c91b488 100644 --- a/Code Management/WCS/WIDESEAWCS_Client/src/views/system/Sys_User.vue +++ b/Code Management/WCS/WIDESEAWCS_Client/src/views/system/Sys_User.vue @@ -36,6 +36,7 @@ gender: "", remark: "", headImageUrl: "", + roleName:"", }); const editFormOptions = ref([ [{ title: "甯愬彿", required: true, field: "userName"}], diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs index 7b5b5b2..71e0481 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs @@ -60,6 +60,73 @@ } + //protected string ValidatePageOptions(PageDataOptions options) + //{ + // options = options ?? new PageDataOptions(); + // string where = ""; + // List<SearchParameters> searchParametersList = new List<SearchParameters>(); + // if (options.Filter != null && options.Filter.Count > 0) + // { + // searchParametersList.AddRange(options.Filter); + // } + // else if (!string.IsNullOrEmpty(options.Wheres)) + // { + // try + // { + // searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); + // options.Filter = searchParametersList; + // } + // catch { } + // } + // QueryRelativeList?.Invoke(searchParametersList); + + // for (int i = 0; i < searchParametersList.Count; i++) + // { + // if (string.IsNullOrEmpty(searchParametersList[i].Value)) + // { + // continue; + // } + + // PropertyInfo property = TProperties.Where(c => c.Name.ToUpper() == searchParametersList[i].Name.ToUpper()).FirstOrDefault(); + + // if (property == null) continue; + + // List<(bool, string, object)> results = property.ValidationValueForDbType(searchParametersList[i].Value.Split(',')).ToList(); + // if (results == null || results.Count() == 0) + // { + // continue; + // } + // for (int j = 0; j < results.Count(); j++) + // { + // if (j == 0) + // { + // where += "("; + // } + // LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition(); + // if (expressionType == LinqExpressionType.Equal) + // { + // where += $"{searchParametersList[i].Name} like '%{results[j].Item3}%'"; + // } + // else + // { + // where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{results[j].Item3}'"; + // } + + // if (j == results.Count() - 1) + // { + // where += ")"; + // } + // else + // { + // where += " or "; + // } + // } + // if (i < searchParametersList.Count - 1) + // where += " and "; + // } + // return where; + //} + protected string ValidatePageOptions(PageDataOptions options) { options = options ?? new PageDataOptions(); @@ -91,38 +158,48 @@ if (property == null) continue; - List<(bool, string, object)> results = property.ValidationValueForDbType(searchParametersList[i].Value.Split(',')).ToList(); - if (results == null || results.Count() == 0) + (bool, string, object) result = property.ValidationVal(searchParametersList[i].Value); + if (!result.Item1) { continue; } - for (int j = 0; j < results.Count(); j++) - { - if (j == 0) - { - where += "("; - } - LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition(); - if (expressionType == LinqExpressionType.Equal) - { - where += $"{searchParametersList[i].Name} like '%{results[j].Item3}%'"; - } - else - { - where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{results[j].Item3}'"; - } - if (j == results.Count() - 1) + LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition(); + if (expressionType == LinqExpressionType.Equal) + { + if (string.IsNullOrEmpty(where)) { - where += ")"; + // 閽堝瀛楃涓茬被鍨嬬殑瀛楁浣跨敤妯$硦鏌ヨ + //where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false") + { + where += $" {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'"; + } + else + { + where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + } } else { - where += " or "; + // 閽堝甯冨皵绫诲瀷瀛楁杩涜绮剧‘鏌ヨ + if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false") + { + where += $" and {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'"; + } + else + { + where += $" and {searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + } } } - if (i < searchParametersList.Count - 1) - where += " and "; + else + { + if (string.IsNullOrEmpty(where)) + where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; + else + where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; + } } return where; } diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/ObjectExtension.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/ObjectExtension.cs index 6e000c3..781918a 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/ObjectExtension.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/ObjectExtension.cs @@ -21,21 +21,42 @@ public static T DicToModel<T>(this Dictionary<string, object> dic) { + //T model = Activator.CreateInstance<T>(); + //PropertyInfo[] propertyInfos = typeof(T).GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance); + + //Dictionary<string, object> upperDic = dic.ToDictionary(k => k.Key.ToUpper(), v => v.Value); + + //foreach (var property in propertyInfos) + //{ + // object value = null; + // if (!upperDic.TryGetValue(property.Name.ToUpper(), out value)) + // { + // continue; + // } + // property.SetValue(model, value?.ToString().ChangeType(property.PropertyType)); + //} + //return model; + T model = Activator.CreateInstance<T>(); PropertyInfo[] propertyInfos = typeof(T).GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance); - - Dictionary<string, object> upperDic = dic.ToDictionary(k => k.Key.ToUpper(), v => v.Value); - foreach (var property in propertyInfos) { object value = null; - if (!upperDic.TryGetValue(property.Name.ToUpper(), out value)) + if (!dic.TryGetValue(property.Name, out value)) { - continue; + if (!dic.TryGetValue(property.Name.FirstLetterToUpper(), out value)) + { + if (!dic.TryGetValue(property.Name.FirstLetterToLower(), out value)) + { + continue; + } + } } + ; property.SetValue(model, value?.ToString().ChangeType(property.PropertyType)); } return model; + } } } diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs index 11ea985..b22b218 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs @@ -147,6 +147,58 @@ /// <param name="removeNotContains">绉婚櫎涓嶅瓨鍦ㄥ瓧娈�</param> /// <param name="removerKey">绉婚櫎涓婚敭</param> /// <returns></returns> + //public static string ValidateDicInEntity(this Type typeinfo, Dictionary<string, object> dic, bool removerKey, PropertyInfo[] propertyInfo, string[] ignoreFields = null) + //{ + // if (dic == null || dic.Count == 0) { return "鍙傛暟鏃犳晥"; } + + // // 涓嶅瓨鍦ㄧ殑瀛楁鐩存帴绉婚櫎 + // dic.Where(x => !propertyInfo.Any(p => p.Name.ToUpper() == x.Key.ToUpper())).Select(s => s.Key).ToList().ForEach(f => + // { + // dic.Remove(f); + // }); + + // string keyName = typeinfo.GetKeyName(); + // //绉婚櫎涓婚敭 + // if (removerKey) + // dic.Remove(keyName); + // //else + // //{ + // // if (!dic.ContainsKey(keyName)) + // // return "璇蜂紶鍏ヤ富閿弬鏁�"; + // //} + + // foreach (PropertyInfo property in propertyInfo) + // { + // SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>(); + // if (sugarColumn == null) + // return "璇烽厤缃甋ugarColumn灞炴��"; + // //蹇界暐涓庝富閿殑瀛楁涓嶅仛楠岃瘉 + // if (property.Name.ToUpper() == keyName.ToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore) + // continue; + + // //涓嶅湪缂栬緫涓殑鍒楋紝鏄惁涔熻蹇呭~ + // if (!dic.ContainsKey(property.Name.ToUpper())) + // { + // if (!sugarColumn.IsNullable) + // { + // if (sugarColumn.DefaultValue == null) + // return sugarColumn.ColumnDescription + "涓哄繀椤绘彁浜ら」"; + // continue; + // } + // continue; + // } + // if(dic[property.Name.ToUpper()] != null) + // { + // string str = dic[property.Name.ToUpper()].ToString(); + // //灏嗘墍鏈夌┖鍊艰缃负null + // if (str == string.Empty) + // dic[property.Name.ToUpper()] = null; + // } + + // } + // return string.Empty; + //} + public static string ValidateDicInEntity(this Type typeinfo, Dictionary<string, object> dic, bool removerKey, PropertyInfo[] propertyInfo, string[] ignoreFields = null) { if (dic == null || dic.Count == 0) { return "鍙傛暟鏃犳晥"; } @@ -173,11 +225,11 @@ if (sugarColumn == null) return "璇烽厤缃甋ugarColumn灞炴��"; //蹇界暐涓庝富閿殑瀛楁涓嶅仛楠岃瘉 - if (property.Name.ToUpper() == keyName.ToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore) + if (property.Name == keyName.FirstLetterToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore) continue; //涓嶅湪缂栬緫涓殑鍒楋紝鏄惁涔熻蹇呭~ - if (!dic.ContainsKey(property.Name.ToUpper())) + if (!dic.ContainsKey(property.Name.FirstLetterToLower())) { if (!sugarColumn.IsNullable) { @@ -187,14 +239,14 @@ } continue; } - if(dic[property.Name.ToUpper()] != null) + if (dic[property.Name.FirstLetterToLower()] != null) { - string str = dic[property.Name.ToUpper()].ToString(); + string str = dic[property.Name.FirstLetterToLower()].ToString(); //灏嗘墍鏈夌┖鍊艰缃负null if (str == string.Empty) - dic[property.Name.ToUpper()] = null; + dic[property.Name.FirstLetterToLower()] = null; } - + } return string.Empty; } diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/WIDESEAWCS_IProcessService.csproj b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/WIDESEAWCS_IProcessService.csproj index 75b2aa7..704da74 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/WIDESEAWCS_IProcessService.csproj +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/WIDESEAWCS_IProcessService.csproj @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk"> +锘�<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceInfo.cs index 848144b..783732e 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceInfo.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceInfo.cs @@ -37,7 +37,7 @@ /// </summary> [ImporterHeader(IsIgnore = true)] [ExporterHeader(DisplayName = "涓婚敭")] - [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] + [SugarColumn(IsIdentity = true, IsNullable = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } /// <summary> diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocol.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocol.cs index fbaf7e2..84b2e9c 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocol.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocol.cs @@ -37,7 +37,7 @@ /// </summary> [ImporterHeader(IsIgnore = true)] [ExporterHeader(IsIgnore = true)] - [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] + [SugarColumn(IsIdentity = true, IsNullable = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } /// <summary> diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocolDetail.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocolDetail.cs index 247be22..55d54ae 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocolDetail.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DeviceProtocolDetail.cs @@ -37,7 +37,7 @@ /// </summary> [ImporterHeader(Name = "涓婚敭")] [ExporterHeader(DisplayName = "涓婚敭")] - [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] + [SugarColumn(IsIdentity = true, IsNullable = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } /// <summary> diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DispatchInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DispatchInfo.cs index 0e7b97a..92e3262 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DispatchInfo.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Models/Dt_DispatchInfo.cs @@ -38,7 +38,7 @@ /// </summary> [ImporterHeader(Name = "涓婚敭")] [ExporterHeader(DisplayName = "涓婚敭")] - [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] + [SugarColumn(IsIdentity = true, IsNullable = true, IsPrimaryKey = true, ColumnDescription = "涓婚敭")] public int Id { get; set; } /// <summary> diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs index c759c5b..313f1b6 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs @@ -21,6 +21,7 @@ using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core.Enums; using WIDESEAWCS_Core.Caches; +using WIDESEAWCS_QuartzJob.DeviceEnum; namespace WIDESEAWCS_WCSServer.Controllers.System { @@ -107,8 +108,8 @@ { Type type = typeof(IDevice); var basePath = AppContext.BaseDirectory; - string path = Path.Combine(basePath, Assembly.GetExecutingAssembly().GetName().Name); - Assembly assembly = Assembly.LoadFrom(path); + //string path = Path.Combine("", Assembly.GetAssembly(type).GetName()); + Assembly assembly = Assembly.GetAssembly(type); List<Type> types = assembly.GetTypes().Where(x => type.IsAssignableFrom(x) && !x.IsAbstract && !x.IsInterface).ToList(); List<object> data = new List<object>(); foreach (var deviceType in types) @@ -147,12 +148,12 @@ case "deviceStatus": { List<object> data = new List<object>(); - Type type = Type.GetType("WIDESEAWCS_QuartzJob.DeviceEnum.DeviceStatusEnum"); + Type type = typeof(DeviceStatusEnum); List<int> enums = Enum.GetValues(type).Cast<int>().ToList(); int index = 0; foreach (var item in enums) { - FieldInfo? fieldInfo = type.GetField((item).ToString()); + FieldInfo? fieldInfo = type.GetField(((DeviceStatusEnum)item).ToString()); DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); if (description != null) { diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs index ee6f4d9..e28b372 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/Sys_DictionaryService.cs @@ -35,62 +35,30 @@ public List<VueDictionaryDTO> GetVueDictionary(string[] dicNos) { if (dicNos == null || dicNos.Count() == 0) return new List<VueDictionaryDTO>(); - List<VueDictionaryDTO> vueDictionaryDTOs = new List<VueDictionaryDTO>(); - List<string> cacheDicNos = new List<string>(); - foreach (string n in dicNos) + var dicConfig = BaseDal.GetDictionaries(dicNos, false).Select(s => new { - string str = _cacheService.Get(n); - if (!string.IsNullOrEmpty(str)) - { - VueDictionaryDTO? vueDictionary = JsonConvert.DeserializeObject<VueDictionaryDTO>(str); + dicNo = s.DicNo, + config = s.Config, + dbSql = s.DBSql, + list = s.DicList.OrderByDescending(o => o.OrderNo).Select(list => new { key = list.DicValue, value = list.DicName }) + }).ToList(); - if (vueDictionary != null) - { - vueDictionaryDTOs.Add(vueDictionary); - cacheDicNos.Add(n); - } - } - } - if (dicNos.Where(x => !cacheDicNos.Contains(x)).Count() > 0) + object GetSourceData(string dicNo, string dbSql, object data) { - List<VueDictionaryDTO> selectDics = BaseDal.GetDictionaries(dicNos.Where(x => !cacheDicNos.Contains(x))).Select(s => new VueDictionaryDTO + if (string.IsNullOrEmpty(dbSql)) { - DicNo = s.DicNo, - Config = s.Config, - //dbSql = s.Sql, - Data = s.DicList.OrderByDescending(o => o.OrderNo).Select(list => new { key = list.DicValue, value = list.DicName }) - }).ToList(); - - foreach (var item in selectDics) - { - if (!_cacheService.Exists(item.DicNo)) - { - _cacheService.Add(item.DicNo, item.Serialize()); - } + return data; } - vueDictionaryDTOs.AddRange(selectDics); + return BaseDal.QueryObjectDataBySql(dbSql, null); } - - //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(); - - - return vueDictionaryDTOs; + var x = dicConfig.Select(item => new VueDictionaryDTO + { + DicNo = item.dicNo, + Config = item.config, + Data = GetSourceData(item.dicNo, item.dbSql, item.list) + }).ToList(); + return x; } - - } } diff --git a/Code Management/WMS/WIDESEA_WMSClient/package-lock.json b/Code Management/WMS/WIDESEA_WMSClient/package-lock.json index 9337fdd..1f45467 100644 --- a/Code Management/WMS/WIDESEA_WMSClient/package-lock.json +++ b/Code Management/WMS/WIDESEA_WMSClient/package-lock.json @@ -660,6 +660,93 @@ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + } } }, "@jridgewell/gen-mapping": { @@ -756,11 +843,6 @@ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "optional": true - }, - "@popperjs/core": { - "version": "npm:@sxzz/popperjs-es@2.11.7", - "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", - "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" }, "@rushstack/eslint-patch": { "version": "1.10.4", @@ -2158,6 +2240,13 @@ "lodash-unified": "^1.0.2", "memoize-one": "^6.0.0", "normalize-wheel-es": "^1.2.0" + }, + "dependencies": { + "@popperjs/core": { + "version": "npm:@sxzz/popperjs-es@2.11.7", + "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", + "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" + } } }, "emoji-regex": { @@ -4965,40 +5054,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "string.prototype.padend": { "version": "3.1.6", "resolved": "https://registry.npmmirror.com/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", @@ -5060,23 +5115,6 @@ "dev": true, "requires": { "ansi-regex": "^6.0.1" - } - }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - } } }, "strip-bom": { @@ -5859,60 +5897,6 @@ "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" - } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } } }, "wrappy": { diff --git a/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js b/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js index efcdc6d..789bd9f 100644 --- a/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js +++ b/Code Management/WMS/WIDESEA_WMSClient/src/api/http.js @@ -19,7 +19,7 @@ } else if (process.env.NODE_ENV == 'production') { // axios.defaults.baseURL = 'http://127.0.0.1:5000/'; - axios.defaults.baseURL = 'http://192.168.5.251:5000/'; + axios.defaults.baseURL = 'http://192.168.20.253:5000/'; } //axios.defaults.baseURL = 'http://api.volcore.xyz/'; -- Gitblit v1.9.3