|
|
|
@ -59,15 +59,15 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
if (list.Exists(x => x.AuditStatus == AuditStatusEnum.Auditing))
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.ItemsAreAuditing);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(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);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.ClientInfoIncomplete));
|
|
|
|
|
|
|
|
|
|
var template = await FindTemplateAsync(INFO_CLIENT_TASK);
|
|
|
|
|
if (template == null)
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.TemplateNotFound);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TemplateNotFound));
|
|
|
|
|
|
|
|
|
|
if (await taskService.Value.HasAuthorizedAsync())
|
|
|
|
|
{
|
|
|
|
@ -99,7 +99,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
{
|
|
|
|
|
await TenantDb.Ado.RollbackTranAsync();
|
|
|
|
|
await ex.LogAsync(Db);
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.Operation_Failed);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -121,7 +121,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
|
|
|
|
|
var rows = await TenantDb.Updateable<InfoClient>().Where(x => idModel.Ids.Contains(x.Id))
|
|
|
|
|
.SetColumns(x => x.AuditStatus == AuditStatusEnum.Auditing).ExecuteCommandAsync();
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(MultiLanguageConst.Operation_Failed);
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -144,7 +144,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
|
|
|
|
|
var list = await flowService.Value.GetInstanceByBSIdAsync(INFO_CLIENT_TASK, ids: request.Ids);
|
|
|
|
|
if (list.Count != request.Ids.Length)
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.NotInAudit);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
@ -206,7 +206,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
|
|
|
|
|
var list = await flowService.Value.GetInstanceByBSIdAsync(INFO_CLIENT_TASK, ids: idModel.Ids);
|
|
|
|
|
if (list.Count != idModel.Ids.Length)
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.NotInAudit);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
|
|
|
|
|
|
|
|
|
|
result = await flowService.Value.WithdrawAsync(idModel.Ids);
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
@ -214,7 +214,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
|
|
|
|
|
int rows = await TenantDb.Updateable<InfoClient>().Where(x => idModel.Ids.Contains(x.Id))
|
|
|
|
|
.SetColumns(x => x.AuditStatus == AuditStatusEnum.NoAudit).ExecuteCommandAsync();
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(MultiLanguageConst.Operation_Failed);
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -225,7 +225,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
public async Task<DataResult> AuditCallbackAsync(FlowCallback callback)
|
|
|
|
|
{
|
|
|
|
|
if (callback.AuditType != INFO_CLIENT_TASK)
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.NoAuditItems);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
|
|
|
|
|
|
|
|
|
|
InfoClient infoClient = new()
|
|
|
|
|
{
|
|
|
|
@ -243,7 +243,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
x.AuditStatus,
|
|
|
|
|
x.Status
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(MultiLanguageConst.Operation_Failed);
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -311,7 +311,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
|
|
|
|
|
x.AuditStatus
|
|
|
|
|
}).FirstAsync();
|
|
|
|
|
if (model != null && model.AuditStatus == AuditStatusEnum.Auditing)
|
|
|
|
|
return DataResult.FailedWithDesc(MultiLanguageConst.ItemsAreAuditing);
|
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.ItemsAreAuditing));
|
|
|
|
|
|
|
|
|
|
var tag = TenantDb.Queryable<InfoClientTag>().Where(x => x.ClientId == req.Id).First();
|
|
|
|
|
if (TenantDb.Queryable<InfoClient>().Where(x => x.Id != data.Id && (x.ShortName == req.ShortName.Trim() || x.Description == req.Description.Trim() || x.TaxNo == req.TaxNo.Trim())).Any())
|
|
|
|
|