@@ -96,9 +96,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
|
||||
|
||||
public CriterionType? CriterionTypeEnum { get; set; }
|
||||
|
||||
/// <summary> 业务模块 /// </summary>
|
||||
public int BusinessModuleEnum { get; set; }
|
||||
|
||||
@@ -140,6 +137,13 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public int? EmailDelaySeconds { get; set; }
|
||||
|
||||
|
||||
|
||||
[Comment("邮件配置的多个标准")]
|
||||
public List<CriterionType>? CriterionTypeList { get; set; }
|
||||
|
||||
//public CriterionType? CriterionTypeEnum { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -82,13 +82,31 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
|
||||
{
|
||||
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||
//var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||
//{
|
||||
// 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 && t.CriterionTypeList != null)
|
||||
.WhereIf(addOrEditEmailNoticeConfig.Id != null, t => t.Id != addOrEditEmailNoticeConfig.Id)
|
||||
.SelectMany(t => t.CriterionTypeList).ToList();
|
||||
|
||||
|
||||
if (addOrEditEmailNoticeConfig.CriterionTypeList != null)
|
||||
{
|
||||
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum == addOrEditEmailNoticeConfig.CriterionTypeEnum,
|
||||
foreach (var item in addOrEditEmailNoticeConfig.CriterionTypeList)
|
||||
{
|
||||
if (criterionList.Any(t => t == item))
|
||||
{
|
||||
return ResponseOutput.NotOk(_localizer["EmailNoticeConfig_RepeatEmailScenario"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
||||
|
||||
};
|
||||
|
||||
var verifyExp2 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||
{
|
||||
@@ -132,7 +150,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
|
||||
|
||||
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp1, verifyExp2);
|
||||
await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp2);
|
||||
|
||||
|
||||
}
|
||||
@@ -155,7 +173,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
|
||||
|
||||
entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp1, verifyExp2);
|
||||
entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp2);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -146,9 +146,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public CriterionType? CriterionTypeEnum { get; set; }
|
||||
|
||||
|
||||
public List<UserTypeEnum> ToUserTypeList { get; set; }
|
||||
public List<UserTypeEnum> CopyUserTypeList { get; set; }
|
||||
|
||||
@@ -197,6 +194,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public int? EmailDelaySeconds { get; set; }
|
||||
|
||||
[Comment("邮件配置的多个标准")]
|
||||
public List<CriterionType>? CriterionTypeList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user