This commit is contained in:
2023-05-31 10:19:05 +08:00
parent 1b65a7a9e5
commit 9c621c75cd
238 changed files with 9905 additions and 4034 deletions

View File

@@ -95,7 +95,7 @@ public class MessageAccountService : IDynamicApiController, ITransient
[HttpPost("")]
public async Task Create([FromBody] MessageAccountListOutput input)
{
if (await _repository.IsAnyAsync(x => (x.EnCode == input.enCode) && x.DeleteMark == null))
if (await _repository.IsAnyAsync(x => (x.EnCode == input.enCode) && x.Type == input.type && x.DeleteMark == null))
throw Oops.Oh(ErrorCode.COM1004);
var entity = input.Adapt<MessageAccountEntity>();
var isOk = await _repository.AsInsertable(entity).IgnoreColumns(ignoreNullColumn: true).CallEntityMethod(m => m.Creator()).ExecuteCommandAsync();
@@ -112,7 +112,7 @@ public class MessageAccountService : IDynamicApiController, ITransient
[HttpPut("{id}")]
public async Task Update(string id, [FromBody] MessageAccountListOutput input)
{
if (await _repository.IsAnyAsync(x => x.Id != id && (x.EnCode == input.enCode) && x.DeleteMark == null))
if (await _repository.IsAnyAsync(x => x.Id != id && (x.EnCode == input.enCode) && x.Type == input.type && x.DeleteMark == null))
throw Oops.Oh(ErrorCode.COM1004);
if ((await _repository.AsSugarClient().Queryable<MessageSendTemplateEntity>().AnyAsync(x => x.AccountConfigId == id && x.DeleteMark == null)) && input.enabledMark == 0)
throw Oops.Oh(ErrorCode.D7013);
@@ -153,6 +153,8 @@ public class MessageAccountService : IDynamicApiController, ITransient
entity.FullName = string.Format("{0}副本{1}", entity.FullName, random);
entity.EnCode = string.Format("{0}{1}", entity.EnCode, random);
entity.EnabledMark = 0;
entity.LastModifyTime = null;
entity.LastModifyUserId = null;
if (entity.Type == "7")
{
entity.AppKey = string.Format("{0}{1}", entity.AppKey, random);