diff --git a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
index 62f6ca6..c10d756 100644
--- a/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
+++ b/src/Shentun.Peis.Application/DataMigrations/BaseDataHandleAppService.cs
@@ -32,7 +32,8 @@ namespace Shentun.Peis.DataMigrations
///
/// 基础数据处理
///
- //[Authorize]
+ [Authorize]
+ [RemoteService(false)]
public class BaseDataHandleAppService : ApplicationService
{
@@ -43,6 +44,13 @@ namespace Shentun.Peis.DataMigrations
IsAutoCloseConnection = true
});
+ private readonly SqlSugarClient PgDb = new SqlSugarClient(new ConnectionConfig()
+ {
+ ConnectionString = "Host=140.143.162.39;Port=5432;Database=ShentunPeis070703;User ID=postgres;Password=shentun123;",
+ DbType = SqlSugar.DbType.PostgreSQL,
+ IsAutoCloseConnection = true
+ });
+
//默认指引类别ID
private readonly Guid defaultGuidTypeId = Guid.Parse("3a120284-df18-7b36-4b12-0423a7d5c1c6");
@@ -70,6 +78,7 @@ namespace Shentun.Peis.DataMigrations
private readonly IRepository _itemResultTemplateRepository;
private readonly IRepository _ItemResultMatchRepository;
private readonly MyUserAppService _myUserAppService;
+ private readonly IRepository _menuInfoRepository;
public BaseDataHandleAppService(
IRepository deviceTypeRepository,
@@ -91,7 +100,8 @@ namespace Shentun.Peis.DataMigrations
IRepository itemResultMatchRepository,
IRepository diagnosisRepository,
IRepository suggestionRepository,
- MyUserAppService myUserAppService)
+ MyUserAppService myUserAppService,
+ IRepository menuInfoRepository)
{
_deviceTypeRepository = deviceTypeRepository;
_itemTypeRepository = itemTypeRepository;
@@ -113,6 +123,7 @@ namespace Shentun.Peis.DataMigrations
_diagnosisRepository = diagnosisRepository;
_suggestionRepository = suggestionRepository;
_myUserAppService = myUserAppService;
+ _menuInfoRepository = menuInfoRepository;
}
///
@@ -1187,6 +1198,47 @@ namespace Shentun.Peis.DataMigrations
}
+ ///
+ /// 迁移菜单
+ ///
+ ///
+ public async Task TransferMenuInfoData()
+ {
+ var oldMenuInfoList = await PgDb.Ado.GetDataTableAsync("select * from menu_info");
+ if (oldMenuInfoList.Rows.Count > 0)
+ {
+
+ List dataList = new List();
+
+ foreach (DataRow menuInfo in oldMenuInfoList.Rows)
+ {
+ var data = new MenuInfo(Guid.Parse(menuInfo["id"].ToString()))
+ {
+ DisplayName = menuInfo["display_name"].ToString(),
+ DisplayOrder = Convert.ToInt32(menuInfo["display_order"].ToString()),
+ IconName = menuInfo["icon_name"].ToString(),
+ IsActive = Convert.ToChar(menuInfo["is_active"].ToString()),
+ MenuType = Convert.ToChar(menuInfo["menu_type"].ToString()),
+ ParentId = !string.IsNullOrWhiteSpace(menuInfo["parent_id"].ToString()) ? Guid.Parse(menuInfo["parent_id"].ToString()) : null,
+ RouteUrl = menuInfo["route_url"].ToString(),
+ SimpleCode = menuInfo["simple_code"].ToString()
+ };
+
+ dataList.Add(data);
+
+ }
+
+ if (dataList.Any())
+ await _menuInfoRepository.InsertManyAsync(dataList);
+
+
+
+
+
+ }
+ }
+
+
private void LoadDLL()
{
// 定义dll文件夹路径
diff --git a/src/Shentun.Peis.Domain/MenuInfos/MenuInfo.cs b/src/Shentun.Peis.Domain/MenuInfos/MenuInfo.cs
index 8d509b0..b379612 100644
--- a/src/Shentun.Peis.Domain/MenuInfos/MenuInfo.cs
+++ b/src/Shentun.Peis.Domain/MenuInfos/MenuInfo.cs
@@ -15,7 +15,17 @@ namespace Shentun.Peis.Models
[Index(nameof(DisplayName), nameof(ParentId), Name = "ix_menu_info", IsUnique = true)]
public class MenuInfo : AuditedEntity, IDisplayOrder, IDisplayName, IHasConcurrencyStamp
{
-
+
+ protected MenuInfo()
+ {
+
+ }
+
+ public MenuInfo(Guid id) : base(id)
+ {
+
+ }
+
///
/// 名称
///
@@ -44,7 +54,7 @@ namespace Shentun.Peis.Models
///
[Column("simple_code")]
[StringLength(20)]
- public string SimpleCode { get; set; }
+ public string SimpleCode { get; set; }
///
/// 父id
diff --git a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
index fcaa56d..ace2861 100644
--- a/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
+++ b/src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
@@ -116,7 +116,7 @@ public class PeisHttpApiHostModule : AbpModule
opt.Password.RequireLowercase = false;
opt.Password.RequireUppercase = false;
opt.Password.RequireNonAlphanumeric = false;
- opt.Password.RequiredLength = 6;
+ opt.Password.RequiredLength = 1;
});
//防伪令牌