|
|
@@ -37,7 +37,7 @@ public class EnumToDictJob : IJob
|
|
|
// 校验枚举类命名规范,字典相关功能中需要通过后缀判断是否为枚举类型
|
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
|
foreach (var dictType in sysDictTypeList.Where(x => !x.Code.EndsWith("Enum")))
|
|
|
- Console.WriteLine($"【{DateTime.Now}】系统枚举转换字典的枚举类名称必须以Enum结尾: {dictType.Code} ({dictType.Name}-{dictType.Remark})");
|
|
|
+ Console.WriteLine($"【{DateTime.Now}】系统枚举转换字典的枚举类名称必须以Enum结尾: {dictType.Code} ({dictType.Name})");
|
|
|
sysDictTypeList = sysDictTypeList.Where(x => x.Code.EndsWith("Enum")).ToList();
|
|
|
|
|
|
await SyncEnumToDictInfoAsync(db, sysDictTypeList);
|
|
|
@@ -50,8 +50,8 @@ public class EnumToDictJob : IJob
|
|
|
.SplitUpdate(it => it.Any())
|
|
|
.SplitInsert(_ => true)
|
|
|
.ToStorageAsync();
|
|
|
- await storageable1.AsInsertable.ExecuteCommandAsync(stoppingToken);
|
|
|
- await storageable1.AsUpdateable.ExecuteCommandAsync(stoppingToken);
|
|
|
+ await storageable1.BulkCopyAsync();
|
|
|
+ await storageable1.BulkUpdateAsync();
|
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】系统枚举类转字典类型数据: 插入{storageable1.InsertList.Count}条, 更新{storageable1.UpdateList.Count}条, 共{storageable1.TotalList.Count}条。");
|
|
|
|
|
|
@@ -60,14 +60,8 @@ public class EnumToDictJob : IJob
|
|
|
.SplitUpdate(it => it.Any())
|
|
|
.SplitInsert(_ => true)
|
|
|
.ToStorageAsync();
|
|
|
- await storageable2.AsInsertable.ExecuteCommandAsync(stoppingToken);
|
|
|
- await storageable2.AsUpdateable.UpdateColumns(u => new
|
|
|
- {
|
|
|
- u.Label,
|
|
|
- u.Name,
|
|
|
- u.Value,
|
|
|
- u.TenantId
|
|
|
- }).ExecuteCommandAsync(stoppingToken);
|
|
|
+ await storageable2.BulkCopyAsync();
|
|
|
+ await storageable2.BulkUpdateAsync(nameof(SysDictData.Label), nameof(SysDictData.Value), nameof(SysDictData.Name), nameof(SysDictData.TenantId));
|
|
|
|
|
|
Console.WriteLine($"【{DateTime.Now}】系统枚举项转字典值数据: 插入{storageable2.InsertList.Count}条, 更新{storageable2.UpdateList.Count}条, 共{storageable2.TotalList.Count}条。");
|
|
|
|
|
|
@@ -124,10 +118,10 @@ public class EnumToDictJob : IJob
|
|
|
{
|
|
|
var dictType = new SysDictType
|
|
|
{
|
|
|
- Id = 900000000000 + CommonUtil.GetFixedHashCode(type.TypeFullName),
|
|
|
+ Id = 900000000000 + CommonUtil.GetFixedHashCode(type.TypeName),
|
|
|
Code = type.TypeName,
|
|
|
Name = type.TypeDescribe,
|
|
|
- Remark = type.TypeFullName,
|
|
|
+ Remark = type.TypeRemark,
|
|
|
TenantId = SqlSugarConst.DefaultTenantId
|
|
|
};
|
|
|
dictType.Children = type.EnumEntities.Select(x => new SysDictData
|