From 06e0e3b7d61e95902a6129de2490461cd0693e1d Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 15 十月 2025 15:06:40 +0800
Subject: [PATCH] 新增异步方法并优化服务调用逻辑在多个数据库文件中进行了二进制文件的修改、删除和新增操作,可能涉及数据库内容的更新或重建。在 HttpsClient.cs文件中新增了 PostNotLimitAsync方法,用于发送支持 JSON 格式的异步 HTTP POST 请求,并记录请求和响应参数。在 AgingInOrOutInputService.cs文件中,将 HttpsClient.PostAsync替换为PostNotLimitAsync,以利用新方法的功能特性。同时删除了不再需要的注释代码。
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 55 insertions(+), 3 deletions(-)
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 dec0451..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,12 +147,64 @@
/// <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 "鍙傛暟鏃犳晥"; }
// 涓嶅瓨鍦ㄧ殑瀛楁鐩存帴绉婚櫎
- dic.Where(x => !propertyInfo.Any(p => p.Name == x.Key.FirstLetterToUpper())).Select(s => s.Key).ToList().ForEach(f =>
+ dic.Where(x => !propertyInfo.Any(p => p.Name.ToUpper() == x.Key.ToUpper())).Select(s => s.Key).ToList().ForEach(f =>
{
dic.Remove(f);
});
@@ -187,14 +239,14 @@
}
continue;
}
- if(dic[property.Name.FirstLetterToLower()] != null)
+ if (dic[property.Name.FirstLetterToLower()] != null)
{
string str = dic[property.Name.FirstLetterToLower()].ToString();
//灏嗘墍鏈夌┖鍊艰缃负null
if (str == string.Empty)
dic[property.Name.FirstLetterToLower()] = null;
}
-
+
}
return string.Empty;
}
--
Gitblit v1.9.3