|
|
@ -32,7 +32,8 @@ namespace Shentun.Peis.DataMigrations |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 基础数据处理
|
|
|
/// 基础数据处理
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
//[Authorize]
|
|
|
|
|
|
|
|
|
[Authorize] |
|
|
|
|
|
[RemoteService(false)] |
|
|
public class BaseDataHandleAppService : ApplicationService |
|
|
public class BaseDataHandleAppService : ApplicationService |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
@ -43,6 +44,13 @@ namespace Shentun.Peis.DataMigrations |
|
|
IsAutoCloseConnection = true |
|
|
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
|
|
|
//默认指引类别ID
|
|
|
private readonly Guid defaultGuidTypeId = Guid.Parse("3a120284-df18-7b36-4b12-0423a7d5c1c6"); |
|
|
private readonly Guid defaultGuidTypeId = Guid.Parse("3a120284-df18-7b36-4b12-0423a7d5c1c6"); |
|
|
@ -70,6 +78,7 @@ namespace Shentun.Peis.DataMigrations |
|
|
private readonly IRepository<ItemResultTemplate, Guid> _itemResultTemplateRepository; |
|
|
private readonly IRepository<ItemResultTemplate, Guid> _itemResultTemplateRepository; |
|
|
private readonly IRepository<ItemResultMatch, Guid> _ItemResultMatchRepository; |
|
|
private readonly IRepository<ItemResultMatch, Guid> _ItemResultMatchRepository; |
|
|
private readonly MyUserAppService _myUserAppService; |
|
|
private readonly MyUserAppService _myUserAppService; |
|
|
|
|
|
private readonly IRepository<MenuInfo, Guid> _menuInfoRepository; |
|
|
|
|
|
|
|
|
public BaseDataHandleAppService( |
|
|
public BaseDataHandleAppService( |
|
|
IRepository<DeviceType, Guid> deviceTypeRepository, |
|
|
IRepository<DeviceType, Guid> deviceTypeRepository, |
|
|
@ -91,7 +100,8 @@ namespace Shentun.Peis.DataMigrations |
|
|
IRepository<ItemResultMatch, Guid> itemResultMatchRepository, |
|
|
IRepository<ItemResultMatch, Guid> itemResultMatchRepository, |
|
|
IRepository<Diagnosis, Guid> diagnosisRepository, |
|
|
IRepository<Diagnosis, Guid> diagnosisRepository, |
|
|
IRepository<Suggestion, Guid> suggestionRepository, |
|
|
IRepository<Suggestion, Guid> suggestionRepository, |
|
|
MyUserAppService myUserAppService) |
|
|
|
|
|
|
|
|
MyUserAppService myUserAppService, |
|
|
|
|
|
IRepository<MenuInfo, Guid> menuInfoRepository) |
|
|
{ |
|
|
{ |
|
|
_deviceTypeRepository = deviceTypeRepository; |
|
|
_deviceTypeRepository = deviceTypeRepository; |
|
|
_itemTypeRepository = itemTypeRepository; |
|
|
_itemTypeRepository = itemTypeRepository; |
|
|
@ -113,6 +123,7 @@ namespace Shentun.Peis.DataMigrations |
|
|
_diagnosisRepository = diagnosisRepository; |
|
|
_diagnosisRepository = diagnosisRepository; |
|
|
_suggestionRepository = suggestionRepository; |
|
|
_suggestionRepository = suggestionRepository; |
|
|
_myUserAppService = myUserAppService; |
|
|
_myUserAppService = myUserAppService; |
|
|
|
|
|
_menuInfoRepository = menuInfoRepository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -1187,6 +1198,47 @@ namespace Shentun.Peis.DataMigrations |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 迁移菜单
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public async Task TransferMenuInfoData() |
|
|
|
|
|
{ |
|
|
|
|
|
var oldMenuInfoList = await PgDb.Ado.GetDataTableAsync("select * from menu_info"); |
|
|
|
|
|
if (oldMenuInfoList.Rows.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
List<MenuInfo> dataList = new List<MenuInfo>(); |
|
|
|
|
|
|
|
|
|
|
|
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() |
|
|
private void LoadDLL() |
|
|
{ |
|
|
{ |
|
|
// 定义dll文件夹路径
|
|
|
// 定义dll文件夹路径
|
|
|
|