From fe00bef53c31cd66d6bcfcc39b4c3d7c295f9caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=AE=B9=E6=98=93ljg?= <1132134484@qq.com> Date: Wed, 27 Aug 2025 01:41:03 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8=E9=9B=AA?= =?UTF-8?q?=E8=8A=B1id=E6=97=B6=EF=BC=8C=E5=AF=BC=E5=85=A5=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=87=AA=E5=8A=A8=E8=B5=8B=E5=80=BC=E7=9A=84bug=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8=E9=9B=AA=E8=8A=B1id?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=AF=BC=E5=85=A5=E4=B8=8D=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=B5=8B=E5=80=BC=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 不容易ljg <1132134484@qq.com> --- vol.api/VOL.Core/Utilities/EPPlusHelper.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vol.api/VOL.Core/Utilities/EPPlusHelper.cs b/vol.api/VOL.Core/Utilities/EPPlusHelper.cs index 239db8e3..45726bbe 100644 --- a/vol.api/VOL.Core/Utilities/EPPlusHelper.cs +++ b/vol.api/VOL.Core/Utilities/EPPlusHelper.cs @@ -1,4 +1,4 @@ -using OfficeOpenXml; +using OfficeOpenXml; using OfficeOpenXml.Style; using System; using System.Collections.Generic; @@ -187,6 +187,11 @@ namespace VOL.Core.Utilities property.SetValue(entity, value.ChangeType(property.PropertyType)); } + + PropertyInfo entityKey = typeof(T).GetKeyProperty(); + if (AppSetting.EnableSnowFlakeID && entityKey.PropertyType == typeof(long)) + entityKey.SetValue(entity, YitIdHelper.NextId()); + entity.SetCreateDefaultVal(); entities.Add(entity); } -- Gitee