往来单位提交审核bug修复

usertest
嵇文龙 3 months ago
parent 1a8392b5e6
commit e7412091cc

@ -42,14 +42,14 @@ public class ClientInfoService : ServiceBase, IClientInfoService
/// <returns></returns>
public async Task<DataResult> SubmitAuditAsync(IdModel idModel)
{
if (await TenantDb.Queryable<InfoClient>().AnyAsync(x => idModel.Ids.Contains(x.Id) && x.AuditStatus == AuditStatusEnum.Auditing))
return DataResult.FailedWithDesc(MultiLanguageConst.ItemsAreAuditing);
var queryable = TenantDb.Queryable<InfoClientContact>().Where(x => idModel.Ids.Contains(x.ClientId));
if (await queryable.AnyAsync(x => (SqlFunc.IsNullOrEmpty(x.Tel) && SqlFunc.IsNullOrEmpty(x.Mobile)) || (SqlFunc.IsNullOrEmpty(x.Email) && SqlFunc.IsNullOrEmpty(x.QQ))))
return DataResult.FailedWithDesc(MultiLanguageConst.ClientInfoIncomplete);
if (await TenantDb.Queryable<InfoClient>().AnyAsync(x => idModel.Ids.Contains(x.Id) && x.AuditStatus == AuditStatusEnum.Auditing))
return DataResult.FailedWithDesc(MultiLanguageConst.ItemsAreAuditing);
var template = FindTemplateAsync(AuditType.InfoClient);
var template = await FindTemplateAsync(AuditType.InfoClient);
if (template == null)
return DataResult.FailedWithDesc(MultiLanguageConst.TemplateNotFound);
@ -145,9 +145,9 @@ public class ClientInfoService : ServiceBase, IClientInfoService
if (!result.Succeeded)
return result;
await TenantDb.Updateable<InfoClient>().Where(x => idModel.Ids.Contains(x.Id))
int rows = await TenantDb.Updateable<InfoClient>().Where(x => idModel.Ids.Contains(x.Id))
.SetColumns(x => x.AuditStatus == AuditStatusEnum.NoAudit).ExecuteCommandAsync();
return DataResult.Success;
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(MultiLanguageConst.Operation_Failed);
}
/// <summary>

Loading…
Cancel
Save