修改邮件配置为适配多标准
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
918728a42e
commit
3ed74a578e
|
@ -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,13 @@ 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; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,13 +82,31 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
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 && 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>()
|
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 Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public CriterionType? CriterionTypeEnum { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public List<UserTypeEnum> ToUserTypeList { get; set; }
|
public List<UserTypeEnum> ToUserTypeList { get; set; }
|
||||||
public List<UserTypeEnum> CopyUserTypeList { get; set; }
|
public List<UserTypeEnum> CopyUserTypeList { get; set; }
|
||||||
|
|
||||||
|
@ -197,6 +194,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public int? EmailDelaySeconds { get; set; }
|
public int? EmailDelaySeconds { get; set; }
|
||||||
|
|
||||||
|
[Comment("邮件配置的多个标准")]
|
||||||
|
public List<CriterionType>? CriterionTypeList { 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,12 @@ 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 CriterionType? CriterionTypeEnum { get; set; }
|
||||||
|
|
||||||
|
[Comment("邮件配置的多个标准")]
|
||||||
|
public List<CriterionType>? CriterionTypeList { get; set; }
|
||||||
}
|
}
|
||||||
[Comment("后台 - 邮件配置用户类型表(需要同步)")]
|
[Comment("后台 - 邮件配置用户类型表(需要同步)")]
|
||||||
[Table("EmailNoticeUserType")]
|
[Table("EmailNoticeUserType")]
|
||||||
|
|
|
@ -42,8 +42,6 @@ public class TrialEmailNoticeConfig : BaseFullDeleteAuditEntity
|
||||||
|
|
||||||
public string Code { get; set; } = null!;
|
public string Code { get; set; } = null!;
|
||||||
|
|
||||||
public CriterionType? CriterionTypeEnum { get; set; }
|
|
||||||
|
|
||||||
public string Description { get; set; } = null!;
|
public string Description { get; set; } = null!;
|
||||||
|
|
||||||
public string EmailCron { get; set; } = null!;
|
public string EmailCron { get; set; } = null!;
|
||||||
|
@ -86,6 +84,14 @@ public class TrialEmailNoticeConfig : BaseFullDeleteAuditEntity
|
||||||
[Comment("邮件延时秒数,比如一个事件触发,延迟多少s后才发邮件")]
|
[Comment("邮件延时秒数,比如一个事件触发,延迟多少s后才发邮件")]
|
||||||
public int? EmailDelaySeconds { get; set; } = null!;
|
public int? EmailDelaySeconds { get; set; } = null!;
|
||||||
|
|
||||||
|
|
||||||
|
[Comment("后续删除,需要维护数据")]
|
||||||
|
|
||||||
|
public CriterionType? CriterionTypeEnum { get; set; }
|
||||||
|
|
||||||
|
[Comment("邮件配置的多个标准")]
|
||||||
|
public List<CriterionType>? CriterionTypeList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Comment("项目 - 项目邮件用户黑名单")]
|
[Comment("项目 - 项目邮件用户黑名单")]
|
||||||
|
|
19765
IRaCIS.Core.Infra.EFCore/Migrations/20250618084831_emailAddFiled.Designer.cs
generated
Normal file
19765
IRaCIS.Core.Infra.EFCore/Migrations/20250618084831_emailAddFiled.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,82 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class emailAddFiled : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "CriterionTypeEnum",
|
||||||
|
table: "TrialEmailNoticeConfig",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "后续删除,需要维护数据",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CriterionTypeList",
|
||||||
|
table: "TrialEmailNoticeConfig",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "邮件配置的多个标准");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "CriterionTypeEnum",
|
||||||
|
table: "EmailNoticeConfig",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "标准枚举--后续废弃,这里可以选择多个标准",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true,
|
||||||
|
oldComment: "标准枚举");
|
||||||
|
|
||||||
|
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: "TrialEmailNoticeConfig");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CriterionTypeList",
|
||||||
|
table: "EmailNoticeConfig");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "CriterionTypeEnum",
|
||||||
|
table: "TrialEmailNoticeConfig",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true,
|
||||||
|
oldComment: "后续删除,需要维护数据");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "CriterionTypeEnum",
|
||||||
|
table: "EmailNoticeConfig",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "标准枚举",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true,
|
||||||
|
oldComment: "标准枚举--后续废弃,这里可以选择多个标准");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2049,7 +2049,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Property<int?>("CriterionTypeEnum")
|
b.Property<int?>("CriterionTypeEnum")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasComment("标准枚举");
|
.HasComment("标准枚举--后续废弃,这里可以选择多个标准");
|
||||||
|
|
||||||
|
b.Property<string>("CriterionTypeList")
|
||||||
|
.HasColumnType("nvarchar(max)")
|
||||||
|
.HasComment("邮件配置的多个标准");
|
||||||
|
|
||||||
b.Property<Guid?>("DeleteUserId")
|
b.Property<Guid?>("DeleteUserId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
@ -11923,7 +11927,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<int?>("CriterionTypeEnum")
|
b.Property<int?>("CriterionTypeEnum")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int")
|
||||||
|
.HasComment("后续删除,需要维护数据");
|
||||||
|
|
||||||
|
b.Property<string>("CriterionTypeList")
|
||||||
|
.HasColumnType("nvarchar(max)")
|
||||||
|
.HasComment("邮件配置的多个标准");
|
||||||
|
|
||||||
b.Property<Guid?>("DeleteUserId")
|
b.Property<Guid?>("DeleteUserId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
Loading…
Reference in New Issue