|
|
@@ -104,8 +104,8 @@ public static class SqlSugarSetup
|
|
|
{
|
|
|
if (entityInfo.OperationType == DataFilterType.InsertByObject)
|
|
|
{
|
|
|
- // 主键(long类型)非自增且没有值的---赋值雪花Id
|
|
|
- if (entityInfo.EntityColumnInfo.IsPrimarykey && !entityInfo.EntityColumnInfo.IsIdentity && entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(long))
|
|
|
+ // 主键(long类型)且没有值的---赋值雪花Id
|
|
|
+ if (entityInfo.EntityColumnInfo.IsPrimarykey && entityInfo.EntityColumnInfo.PropertyInfo.PropertyType == typeof(long))
|
|
|
{
|
|
|
var id = entityInfo.EntityColumnInfo.PropertyInfo.GetValue(entityInfo.EntityValue);
|
|
|
if (id == null || (long)id == 0)
|