diff --git a/Hadoop/ZKLT.Hadoop.Model/HDP_Table.cs b/Hadoop/ZKLT.Hadoop.Model/HDP_Table.cs index 91d3b03..b9d7147 100644 --- a/Hadoop/ZKLT.Hadoop.Model/HDP_Table.cs +++ b/Hadoop/ZKLT.Hadoop.Model/HDP_Table.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; @@ -146,21 +147,7 @@ namespace ZKLT.Hadoop.Model /// 数据 /// public static JObject Class2JObject(object data) { - var _result = new JObject(); - - Type _type = data.GetType(); - - var _properties = _type.GetProperties(); - - foreach (var _property in _properties) - { - if (_property.GetValue(data) != null) - { - _result.Add(new JProperty(_property.Name, _property.GetValue(data)!)); - } - } - - return _result; + return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(data)!)!; } } } diff --git a/Hadoop/ZKLT.Hadoop/TableService.cs b/Hadoop/ZKLT.Hadoop/TableService.cs index 767819a..7895dd5 100644 --- a/Hadoop/ZKLT.Hadoop/TableService.cs +++ b/Hadoop/ZKLT.Hadoop/TableService.cs @@ -483,7 +483,7 @@ namespace ZKLT.Hadoop _result += _connection.Execute(_command.ToString(), _params); } _connection.Close(); - if (_result == _data.Count) + if (_result >= _data.Count) { _scope.Complete(); return true; @@ -581,7 +581,7 @@ namespace ZKLT.Hadoop _result += _connection.Execute(_command.ToString(), _params); } _connection.Close(); - if (_result == _data.Count) + if (_result >= _data.Count) { _scope.Complete(); return true; @@ -657,7 +657,7 @@ namespace ZKLT.Hadoop _result += _connection.Execute(_command.ToString(), _params); } _connection.Close(); - if (_result == _data.Count) + if (_result >= _data.Count) { _scope.Complete(); return true;