Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
commit
b5d259f907
|
|
@ -228,7 +228,7 @@ namespace IRaCIS.Api.Controllers
|
||||||
|
|
||||||
[HttpGet("User/UserRedirect")]
|
[HttpGet("User/UserRedirect")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IActionResult> UserRedirect([FromServices] IRepository<UserRole> _userRoleRepository, string url, [FromServices] ILogger<ExtraController> _logger)
|
public async Task<IActionResult> UserRedirect([FromServices] IRepository<IdentityUser> _useRepository, string url, [FromServices] ILogger<ExtraController> _logger, [FromServices] ITokenService _tokenService)
|
||||||
{
|
{
|
||||||
|
|
||||||
var decodeUrl = System.Web.HttpUtility.UrlDecode(url);
|
var decodeUrl = System.Web.HttpUtility.UrlDecode(url);
|
||||||
|
|
@ -243,10 +243,22 @@ namespace IRaCIS.Api.Controllers
|
||||||
|
|
||||||
var errorUrl = domainStrList[0] + "//" + domainStrList[2] + "/error";
|
var errorUrl = domainStrList[0] + "//" + domainStrList[2] + "/error";
|
||||||
|
|
||||||
|
if (lang == "zh")
|
||||||
if (!await _userRoleRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd))
|
|
||||||
{
|
{
|
||||||
decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang == "zh" ? "您的初始化链接已过期" : "Error!The initialization link has expired. Return")} ";
|
CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.zh_CN);
|
||||||
|
CultureInfo.CurrentUICulture = new CultureInfo(StaticData.CultureInfo.zh_CN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.en_US);
|
||||||
|
CultureInfo.CurrentUICulture = new CultureInfo(StaticData.CultureInfo.en_US);
|
||||||
|
}
|
||||||
|
|
||||||
|
var isExpire = _tokenService.IsTokenExpired(token);
|
||||||
|
|
||||||
|
if (!await _useRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd) || isExpire)
|
||||||
|
{
|
||||||
|
decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(I18n.T("UserRedirect_InitializationLinkExpire"))} ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redirect(decodeUrl);
|
return Redirect(decodeUrl);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ namespace IRaCIS.Core.API
|
||||||
var config = new LoggerConfiguration()
|
var config = new LoggerConfiguration()
|
||||||
.MinimumLevel.Information()
|
.MinimumLevel.Information()
|
||||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
||||||
|
.MinimumLevel.Override("MassTransit", LogEventLevel.Warning)
|
||||||
|
//https://github.com/ZiggyCreatures/FusionCache/blob/main/docs/Logging.md
|
||||||
|
.MinimumLevel.Override("ZiggyCreatures.Caching.Fusion", LogEventLevel.Warning)
|
||||||
// Filter out ASP.NET Core infrastructre logs that are Information and below 日志太多了 一个请求 记录好几条
|
// Filter out ASP.NET Core infrastructre logs that are Information and below 日志太多了 一个请求 记录好几条
|
||||||
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
|
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
|
||||||
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning)
|
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
"OpenUserComplexPassword": true,
|
"OpenUserComplexPassword": true,
|
||||||
"OpenSignDocumentBeforeWork": true,
|
"OpenSignDocumentBeforeWork": true,
|
||||||
"OpenTrialRelationDelete": true,
|
"OpenTrialRelationDelete": true,
|
||||||
"OpenLoginLimit": true,
|
"OpenLoginLimit": false,
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 120,
|
"AutoLoginOutMinutes": 120,
|
||||||
|
|
|
||||||
|
|
@ -15567,6 +15567,13 @@
|
||||||
系统邮件配置表
|
系统邮件配置表
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Contracts.EmailNoticeConfigService.BatchUpdateEmail(System.Collections.Generic.List{IRaCIS.Core.Application.Contracts.BatchUpdateEmailTopicCommand})">
|
||||||
|
<summary>
|
||||||
|
批量更新邮件主题中英文
|
||||||
|
</summary>
|
||||||
|
<param name="inCommandList"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Contracts.ISystemBasicDataService">
|
<member name="T:IRaCIS.Core.Application.Contracts.ISystemBasicDataService">
|
||||||
<summary>
|
<summary>
|
||||||
ISystemBasicDataService
|
ISystemBasicDataService
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public UserTypeEnum? CopyUserType { get; set; }
|
public UserTypeEnum? CopyUserType { get; set; }
|
||||||
|
|
||||||
|
public BusinessLevel? BusinessLevelEnum { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,9 +96,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public CriterionType? CriterionTypeEnum { get; set; }
|
|
||||||
|
|
||||||
/// <summary> 业务模块 /// </summary>
|
/// <summary> 业务模块 /// </summary>
|
||||||
public int BusinessModuleEnum { get; set; }
|
public int BusinessModuleEnum { get; set; }
|
||||||
|
|
||||||
|
|
@ -140,6 +137,24 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public int? EmailDelaySeconds { get; set; }
|
public int? EmailDelaySeconds { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Comment("邮件配置的多个标准")]
|
||||||
|
public List<CriterionType>? CriterionTypeList { get; set; }
|
||||||
|
|
||||||
|
//public CriterionType? CriterionTypeEnum { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class BatchUpdateEmailTopicCommand
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string EmailTopic { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string EmailTopicCN { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
@ -25,7 +28,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||||
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
||||||
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
||||||
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
|
.WhereIf(inQuery.BusinessLevelEnum != null, t => t.BusinessLevelEnum == inQuery.BusinessLevelEnum)
|
||||||
|
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(t => t == inQuery.CriterionTypeEnum))
|
||||||
.WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum)
|
.WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum)
|
||||||
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
||||||
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
||||||
|
|
@ -38,14 +42,84 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
|
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量更新邮件主题中英文
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inCommandList"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<IResponseOutput> BatchUpdateEmail(List<BatchUpdateEmailTopicCommand> inCommandList)
|
||||||
|
{
|
||||||
|
var findIdList = inCommandList.Select(x => x.Id).ToList();
|
||||||
|
|
||||||
|
var regex = new Regex(@"\{\s*\d+\s*\}");
|
||||||
|
|
||||||
|
foreach (var inCommand in inCommandList)
|
||||||
|
{
|
||||||
|
if (regex.Matches($"{inCommand.EmailTopic}{inCommand.EmailTopicCN}")
|
||||||
|
.Any(t => t.Value.Contains(" ")))
|
||||||
|
{
|
||||||
|
//邮件模板占位符不允许有空格,请核查占位符的地方
|
||||||
|
return ResponseOutput.NotOk(I18n.T("EmailNoticeConfig_ContainEmpty"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = _emailNoticeConfigrepository.Where(t => findIdList.Contains(t.Id), true).ToList();
|
||||||
|
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
var exist = inCommandList.FirstOrDefault(t => t.Id == item.Id);
|
||||||
|
if (exist != null)
|
||||||
|
{
|
||||||
|
item.EmailTopic = exist.EmailTopic;
|
||||||
|
item.EmailTopicCN = exist.EmailTopicCN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await _emailNoticeConfigrepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
|
public async Task<IResponseOutput> AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
|
||||||
{
|
{
|
||||||
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
//var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||||
{
|
//{
|
||||||
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum,
|
// VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum == addOrEditEmailNoticeConfig.CriterionTypeEnum,
|
||||||
|
|
||||||
|
// VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
||||||
|
|
||||||
|
//};
|
||||||
|
|
||||||
|
var criterionList = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.IsEnable == true)
|
||||||
|
.Where(t => t.CriterionTypeList != null)
|
||||||
|
.WhereIf(addOrEditEmailNoticeConfig.Id != null, t => t.Id != addOrEditEmailNoticeConfig.Id)
|
||||||
|
.Select(t => t.CriterionTypeList).ToList();//不能使用selectMany 会当成关联对象,不能当成字符串
|
||||||
|
|
||||||
|
|
||||||
|
if (addOrEditEmailNoticeConfig.CriterionTypeList != null)
|
||||||
|
{
|
||||||
|
foreach (var item in addOrEditEmailNoticeConfig.CriterionTypeList)
|
||||||
|
{
|
||||||
|
foreach (var itemList in criterionList)
|
||||||
|
{
|
||||||
|
if (itemList.Any(t => t == item))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["EmailNoticeConfig_RepeatEmailScenario"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var verifyExp2 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||||
|
{
|
||||||
|
VerifyExp = t => t.Code == addOrEditEmailNoticeConfig.Code && t.IsDistinguishCriteria == addOrEditEmailNoticeConfig.IsDistinguishCriteria && t.SystemLevel == addOrEditEmailNoticeConfig.SystemLevel,
|
||||||
|
|
||||||
|
VerifyMsg = _localizer["EmailNoticeConfig_RepeatCode"]
|
||||||
|
|
||||||
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 匹配所有占位符的正则表达式,允许包含空格的占位符
|
// 匹配所有占位符的正则表达式,允许包含空格的占位符
|
||||||
|
|
@ -59,10 +133,14 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var entity = new EmailNoticeConfig() { };
|
||||||
|
|
||||||
if (addOrEditEmailNoticeConfig.Id == null)
|
if (addOrEditEmailNoticeConfig.Id == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var entity = _mapper.Map<EmailNoticeConfig>(addOrEditEmailNoticeConfig);
|
entity = _mapper.Map<EmailNoticeConfig>(addOrEditEmailNoticeConfig);
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in addOrEditEmailNoticeConfig.ToUserTypeList)
|
foreach (var item in addOrEditEmailNoticeConfig.ToUserTypeList)
|
||||||
|
|
@ -78,9 +156,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp1);
|
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp2);
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -101,14 +179,32 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp1);
|
entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp2);
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (addOrEditEmailNoticeConfig.EmailCron != string.Empty)
|
||||||
|
{
|
||||||
|
//var jobId = $"{entity.Id}_({addOrEditEmailNoticeConfig.BusinessScenarioEnum})";
|
||||||
|
|
||||||
|
//HangfireJobHelper.RemoveCronJob(jobId);
|
||||||
|
|
||||||
|
////有的job 可能编辑控制直接不发,需要移除已存在的
|
||||||
|
//if (entity.IsAutoSend && entity.IsEnable)
|
||||||
|
//{
|
||||||
|
// HangfireJobHelper.AddOrUpdateTimingCronJob(jobId, addOrEditEmailNoticeConfig.BusinessScenarioEnum, addOrEditEmailNoticeConfig.EmailCron);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1125,7 +1125,6 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 邮件导出
|
/// 邮件导出
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1140,9 +1139,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
{
|
{
|
||||||
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
|
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
|
||||||
//.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
//.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||||
//.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
||||||
//.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
||||||
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
|
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(c => c == inQuery.CriterionTypeEnum))
|
||||||
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
||||||
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
||||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//管理员重置密码发送邮件
|
//管理员重置密码发送邮件
|
||||||
public async Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456")
|
public async Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456")
|
||||||
{
|
{
|
||||||
var sysUserInfo = (await _userRoleRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).Include(t => t.UserRoleList).ThenInclude(c => c.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
|
|
@ -403,7 +403,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
sysUserInfo.FullName,
|
sysUserInfo.FullName,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.UserName,
|
||||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
//string.Join(',', sysUserInfo.UserRoleList.Select(t => t.UserTypeRole.UserTypeShortName)),
|
||||||
pwdNotMd5
|
pwdNotMd5
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//用户的数据稽查没有 临时处理
|
//用户的数据稽查没有 临时处理
|
||||||
|
|
||||||
|
|
||||||
var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.FullName, t.Phone, t.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.EMail, t.OrganizationName }).FirstOrDefaultAsync();
|
var userObj = await _userRoleRepository.Where(t => t.Id == objectRelationParentId).Select(t => new { UserRealName = t.IdentityUser.FullName, t.IdentityUser.Phone, t.IdentityUser.UserName, UserType = t.UserTypeRole.UserTypeShortName, t.UserTypeEnum, t.IdentityUser.EMail, t.IdentityUser.OrganizationName }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (userObj != null)
|
if (userObj != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1039,14 +1039,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPut("{newCheckCode}")]
|
[HttpPut("{newCheckCode}")]
|
||||||
public async Task<IResponseOutput> SetNewCheckCode(string newCheckCode)
|
public async Task<IResponseOutput> SetNewCheckCode(string newCheckCode)
|
||||||
{
|
{
|
||||||
var user = await _userRoleRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == _userInfo.UserRoleId);
|
var user = await _identityUserRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == _userInfo.IdentityUserId);
|
||||||
|
|
||||||
await _userRoleRepository.UpdatePartialFromQueryAsync(t => t.EMail == user.EMail, u => new UserRole()
|
await _identityUserRepository.UpdatePartialFromQueryAsync(t => t.EMail == user.EMail, u => new IdentityUser()
|
||||||
{
|
{
|
||||||
CheckCode = newCheckCode
|
CheckCode = newCheckCode
|
||||||
});
|
});
|
||||||
|
|
||||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.UserRoleId, OptUserId = _userInfo.UserRoleId, OptType = UserOptType.ModifyCheckCode }, true);
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = _userInfo.IdentityUserId, OptType = UserOptType.ModifyCheckCode }, true);
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,10 @@ namespace IRaCIS.Application.Services
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SponsorName), t => t.Sponsor.Contains(inQuery.SponsorName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SponsorName), t => t.Sponsor.Contains(inQuery.SponsorName))
|
||||||
.WhereIf(inQuery.TrialType != null, t => t.TrialType == inQuery.TrialType)
|
.WhereIf(inQuery.TrialType != null, t => t.TrialType == inQuery.TrialType)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialCode), t => t.TrialCode.Contains(inQuery.TrialCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialCode), t => t.TrialCode.Contains(inQuery.TrialCode))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA
|
|
||||||
|
//GA 要过滤课题组
|
||||||
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => _userInfo.HospitalGroupIdList.Contains(t.HospitalGroupId))
|
||||||
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.GA
|
||||||
, t => t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId))
|
, t => t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||||
.ProjectTo<NewTrialView>(_mapper.ConfigurationProvider);
|
.ProjectTo<NewTrialView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity
|
||||||
public string AttachPath { get; set; } = null!;
|
public string AttachPath { get; set; } = null!;
|
||||||
|
|
||||||
[Comment("业务级别")]
|
[Comment("业务级别")]
|
||||||
public int BusinessLevelEnum { get; set; }
|
public BusinessLevel BusinessLevelEnum { get; set; }
|
||||||
|
|
||||||
[Comment("业务模块")]
|
[Comment("业务模块")]
|
||||||
public BusinessModule BusinessModuleEnum { get; set; }
|
public BusinessModule BusinessModuleEnum { get; set; }
|
||||||
|
|
@ -33,9 +33,6 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity
|
||||||
|
|
||||||
public string Code { get; set; } = null!;
|
public string Code { get; set; } = null!;
|
||||||
|
|
||||||
[Comment("标准枚举")]
|
|
||||||
public CriterionType? CriterionTypeEnum { get; set; }
|
|
||||||
|
|
||||||
public string Description { get; set; } = null!;
|
public string Description { get; set; } = null!;
|
||||||
|
|
||||||
[Comment("发送周期")]
|
[Comment("发送周期")]
|
||||||
|
|
@ -68,6 +65,9 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity
|
||||||
public bool IsReturnRequired { get; set; }
|
public bool IsReturnRequired { get; set; }
|
||||||
|
|
||||||
public SysEmailLevel SystemLevel { get; set; }
|
public SysEmailLevel SystemLevel { get; set; }
|
||||||
|
|
||||||
|
[Comment("邮件配置的多个标准")]
|
||||||
|
public List<CriterionType>? CriterionTypeList { get; set; }
|
||||||
}
|
}
|
||||||
[Comment("后台 - 邮件配置用户类型表(需要同步)")]
|
[Comment("后台 - 邮件配置用户类型表(需要同步)")]
|
||||||
[Table("EmailNoticeUserType")]
|
[Table("EmailNoticeUserType")]
|
||||||
|
|
@ -83,6 +83,21 @@ public class EmailNoticeUserType : Entity
|
||||||
public EmailUserType EmailUserType { get; set; }
|
public EmailUserType EmailUserType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum BusinessLevel
|
||||||
|
{
|
||||||
|
Default = 0,
|
||||||
|
|
||||||
|
|
||||||
|
System = 1,
|
||||||
|
|
||||||
|
//需要手动添加到项目的邮件
|
||||||
|
Trial = 2,
|
||||||
|
|
||||||
|
//项目默认发送的邮件,不需要手动添加到项目
|
||||||
|
TrialDefault = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public enum BusinessModule
|
public enum BusinessModule
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
18820
IRaCIS.Core.Infra.EFCore/Migrations/20250819093830_emailMofify.Designer.cs
generated
Normal file
18820
IRaCIS.Core.Infra.EFCore/Migrations/20250819093830_emailMofify.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,40 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class emailMofify : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CriterionTypeEnum",
|
||||||
|
table: "EmailNoticeConfig");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CriterionTypeList",
|
||||||
|
table: "EmailNoticeConfig",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "邮件配置的多个标准");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CriterionTypeList",
|
||||||
|
table: "EmailNoticeConfig");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "CriterionTypeEnum",
|
||||||
|
table: "EmailNoticeConfig",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "标准枚举");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1933,9 +1933,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Property<Guid>("CreateUserId")
|
b.Property<Guid>("CreateUserId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int?>("CriterionTypeEnum")
|
b.Property<string>("CriterionTypeList")
|
||||||
.HasColumnType("int")
|
.HasColumnType("nvarchar(max)")
|
||||||
.HasComment("标准枚举");
|
.HasComment("邮件配置的多个标准");
|
||||||
|
|
||||||
b.Property<Guid?>("DeleteUserId")
|
b.Property<Guid?>("DeleteUserId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
@ -17961,7 +17961,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
||||||
.WithMany("TrialUserList")
|
.WithMany("TrialUserRoleList")
|
||||||
.HasForeignKey("TrialId")
|
.HasForeignKey("TrialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
@ -18714,7 +18714,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("TrialStateChangeList");
|
b.Navigation("TrialStateChangeList");
|
||||||
|
|
||||||
b.Navigation("TrialUserList");
|
b.Navigation("TrialUserRoleList");
|
||||||
|
|
||||||
b.Navigation("UserFeedBackList");
|
b.Navigation("UserFeedBackList");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue