diff --git a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs index be849c48..0b0d9179 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs @@ -42,14 +42,14 @@ public class ClientInfoService : ServiceBase, IClientInfoService /// public async Task SubmitAuditAsync(IdModel idModel) { + if (await TenantDb.Queryable().AnyAsync(x => idModel.Ids.Contains(x.Id) && x.AuditStatus == AuditStatusEnum.Auditing)) + return DataResult.FailedWithDesc(MultiLanguageConst.ItemsAreAuditing); + var queryable = TenantDb.Queryable().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().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().Where(x => idModel.Ids.Contains(x.Id)) + int rows = await TenantDb.Updateable().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); } ///