修正消息返回提示

usertest
嵇文龙 3 months ago
parent 1ae10692a6
commit 4bba3d1b95

@ -515,14 +515,14 @@ namespace DS.WMS.Core.Fee.Method
}).ToListAsync();
if (fees.Count == 0)
return DataResult.Failed(MultiLanguageConst.EmptyData);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
if (fees.Exists(x => !AuditStatusArray.Contains(x.FeeStatus)))
return DataResult.Failed(MultiLanguageConst.NotInAudit);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
//未在审批状态中
if (!await flowService.Exists(ids: idArray))
return DataResult.Failed(MultiLanguageConst.NotInAudit);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
List<Tuple<TaskBaseTypeEnum, long>> taskTypes = [];
foreach (var fee in fees)
@ -596,7 +596,7 @@ namespace DS.WMS.Core.Fee.Method
var recordIds = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).ToArrayAsync();
//没有待审批的列表直接返回不再执行后续查询
if (recordIds.Length == 0)
return DataResult.Failed(MultiLanguageConst.NoAuditItems);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
return await AuditAsync(yesOrNo, remark, recordIds);
}
@ -621,7 +621,7 @@ namespace DS.WMS.Core.Fee.Method
//取所选业务与过滤条件所产生的交集
var intersects = request.Items.Intersect(bizList, BizItem.DefaultComparer).ToList();
if (intersects.Count == 0)
return DataResult.Failed(MultiLanguageConst.NoAuditItems);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
var list1 = intersects.Select(x => x.Id).ToList();
var list2 = intersects.Select(x => x.BusinessType).Distinct().ToList();
@ -631,7 +631,7 @@ namespace DS.WMS.Core.Fee.Method
//没有待审批的列表直接返回不再执行后续查询
if (recordIds.Length == 0)
return DataResult.Failed(MultiLanguageConst.NoAuditItems);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
return await AuditAsync(request.Result, request.Remark, recordIds);
}
@ -658,10 +658,10 @@ namespace DS.WMS.Core.Fee.Method
}).ToListAsync();
if (bizList.Count == 0)
return DataResult.Failed(MultiLanguageConst.EmptyData);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
if (bizList.Any(x => x.BillAuditStatus != BillAuditStatus.AuditSubmitted))
return DataResult.Failed(MultiLanguageConst.BusinessAuditStatusError);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.BusinessAuditStatusError));
if (hasAuthorized)
{
@ -680,7 +680,7 @@ namespace DS.WMS.Core.Fee.Method
{
var flows = await flowService.GetInstanceByBSIdAsync(taskType, gp.Key, ids);
if (flows.Count == 0)
return DataResult.Failed(MultiLanguageConst.FlowNotFound);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FlowNotFound));
if (flows.Any(x => !x.MakerList.Contains(User.UserId)))
continue;

@ -140,11 +140,11 @@ namespace DS.WMS.Core.Fee.Method
ArgumentNullException.ThrowIfNull(items, nameof(items));
if (items.GroupBy(x => new { x.BusinessId, x.BusinessType }).Count() > 1)
return DataResult.Failed(MultiLanguageConst.FeeBusinessIdOnlyOne);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeBusinessIdOnlyOne));
var first = items.Select(x => new { x.BusinessType, x.BusinessId }).FirstOrDefault();
if (await IsFeeLockedAsync(first.BusinessId, first.BusinessType))
return DataResult.Failed(MultiLanguageConst.FeeLocked);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeLocked));
var order = await TenantDb.Queryable<SeaExport>().Where(x => x.Id == first.BusinessId).Select(x => new
{
@ -154,7 +154,7 @@ namespace DS.WMS.Core.Fee.Method
x.CBM //尺码
}).FirstAsync();
if (order == null)
return DataResult.Failed(MultiLanguageConst.EmptyData);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
//获取订单箱型箱量
string bsNo = first.BusinessId.ToString();
@ -769,7 +769,7 @@ namespace DS.WMS.Core.Fee.Method
{
//未在审批状态中
if (!await flowService.Exists(ids: idArray))
return DataResult.Failed(MultiLanguageConst.NotInAudit);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
foreach (var g in groups)
{

@ -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())

Loading…
Cancel
Save