From 64d374283309d4423f6c844e59440f9b8527fe6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E5=BB=BA=E4=B8=9C?= <617601767@qq.com> Date: Mon, 18 Mar 2024 21:37:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hadoop/ZKLT.Hadoop.Model/HDP_Table.cs | 19 +++---------------- Hadoop/ZKLT.Hadoop/TableService.cs | 6 +++--- 2 files changed, 6 insertions(+), 19 deletions(-) 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;