From 3aa0413bd61b49d55897ec3da5e19f8e62ff3f5e Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Sat, 20 Apr 2024 10:58:39 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E3=80=81=E5=AF=86?=
=?UTF-8?q?=E7=A0=81=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../BaseDataHandleAppService.cs | 56 ++++++++++++++++++-
src/Shentun.Peis.Domain/MenuInfos/MenuInfo.cs | 14 ++++-
.../PeisHttpApiHostModule.cs | 2 +-
3 files changed, 67 insertions(+), 5 deletions(-)
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;
});
//防伪令牌
From b02edb134801bee7a5bc60afbff5b0c76eb9d9a4 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Sat, 20 Apr 2024 11:04:44 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E5=BB=BA=E8=AE=AE?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Suggestions/CreateSuggestionManyDto.cs | 2 +-
src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs b/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs
index 19db928..a5195d8 100644
--- a/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/Suggestions/CreateSuggestionManyDto.cs
@@ -15,7 +15,7 @@ namespace Shentun.Peis.Suggestions
public Guid DiagnosisId { get; set; }
///
- /// 建议类型(0-代表医学解释,1-代表健康指导)
+ /// 建议类型(0-代表医学解释,1-代表常见原因,2-代表健康指导)
///
public char SuggestionType { get; set; }
diff --git a/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs b/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs
index 80d4abd..a231bba 100644
--- a/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs
+++ b/src/Shentun.Peis.Domain.Shared/Enums/SuggestionTypeFlag.cs
@@ -21,7 +21,7 @@ namespace Shentun.Peis.Enums
public const char CommonReasons = '1';
///
- /// 常见原因
+ /// 健康指导
///
[Description("健康指导")]
public const char HealthGuidance = '2';