一键审核

usertest
嵇文龙 3 months ago
parent 43117d94d4
commit a99f99135c

@ -4,7 +4,7 @@ using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Fee.Dtos
{
/// <summary>
/// 审请求基类
/// 审请求基类
/// </summary>
public class AuditRequestBase
{
@ -20,7 +20,18 @@ namespace DS.WMS.Core.Fee.Dtos
}
/// <summary>
/// 按业务类型一致的审批请求
/// 按查询条件审核
/// </summary>
public class AuditConditionRequest: AuditRequestBase
{
/// <summary>
/// 查询条件,可空
/// </summary>
public string? QueryString { get; set; }
}
/// <summary>
/// 按业务类型一致的审核请求
/// </summary>
public class AuditRequest : AuditRequestBase
{
@ -36,7 +47,7 @@ namespace DS.WMS.Core.Fee.Dtos
}
/// <summary>
/// 不同业务类型的审请求
/// 不同业务类型的审请求
/// </summary>
public class BizAuditRequest : AuditRequestBase
{

@ -57,12 +57,11 @@ namespace DS.WMS.Core.Fee.Interface
Task<DataResult> AuditAsync(BizAuditRequest request);
/// <summary>
/// 本票审核(一键审核当前登录用户的所有待审核项
/// 一键审核当前登录用户的所有待审核项
/// </summary>
/// <param name="yesOrNo">审批结果1=通过2=驳回</param>
/// <param name="remark">备注</param>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult> AuditAsync(int yesOrNo, string remark);
Task<DataResult> AuditAsync(AuditConditionRequest request);
/// <summary>
/// 整票审核

@ -589,19 +589,25 @@ namespace DS.WMS.Core.Fee.Method
}
/// <summary>
/// 本票审核(一键审核当前登录用户的所有待审核项
///一键审核当前登录用户的所有待审核项
/// </summary>
/// <param name="yesOrNo">审批结果1=通过2=驳回</param>
/// <param name="remark">备注</param>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> AuditAsync(int yesOrNo, string remark)
public async Task<DataResult> AuditAsync(AuditConditionRequest request)
{
var recordIds = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).ToArrayAsync();
var ids = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).ToArrayAsync();
//没有待审批的列表直接返回不再执行后续查询
if (recordIds.Length == 0)
if (ids.Length == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NoAuditItems));
return await AuditAsync(yesOrNo, remark, recordIds);
List<IConditionalModel> whereList = [];
if (!string.IsNullOrEmpty(request.QueryString))
whereList = Db.Utilities.JsonToConditionalModels(request.QueryString);
ids = await TenantDb.Queryable<FeeRecord>().Where(x => ids.Contains(x.Id)).Where(whereList)
.Select(x => x.Id).ToArrayAsync();
return await AuditAsync(request.Result, request.Remark, ids);
}
/// <summary>

@ -51,7 +51,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request">查询条件</param>
/// <returns></returns>
[HttpPost, Route("GetStat")]
public async Task<DataResult<FeeAuditStatistics>> GetStatAsync(FeeStatisticsRequestV2 request)
public async Task<DataResult<FeeAuditStatistics>> GetStatAsync(FeeStatisticsRequestV2 request)
{
return await _auditService.GetStatAsync(request.Id, request.BusinessType, request.FeeId);
}
@ -96,18 +96,17 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 本票审核(一键审核当前登录用户的所有待审核项
/// 一键审核当前登录用户的所有待审核项
/// </summary>
/// <param name="status">审批结果: 1=通过 2=驳回</param>
/// <param name="remark">审批备注</param>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("OneClickAudit")]
public async Task<DataResult> OneClickAuditAsync(int status, string remark)
public async Task<DataResult> OneClickAuditAsync(AuditConditionRequest request)
{
if (status != 1 && status != 2)
if (request.Result != 1 && request.Result != 2)
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return await _auditService.AuditAsync(status, remark);
return await _auditService.AuditAsync(request);
}
/// <summary>

Loading…
Cancel
Save