按业务批量审核

usertest
嵇文龙 6 months ago
parent f459ad554e
commit df8f99f016

@ -25,7 +25,7 @@ namespace DS.WMS.Core.Fee.Interface
Task<DataResult<List<FeeAuditBusiness>>> GetBizListAsync(PageRequest request);
/// <summary>
/// 批量审批
/// 按费用批量审批
/// </summary>
/// <param name="yesOrNo">审批结果</param>
/// <param name="remark">备注</param>
@ -33,6 +33,13 @@ namespace DS.WMS.Core.Fee.Interface
/// <returns></returns>
Task<DataResult> AuditAsync(int yesOrNo, string remark, params long[] idArray);
/// <summary>
/// 按业务批量审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult> AuditAsync(FeeBizAuditRequest request);
/// <summary>
/// 本票审核(一键审核当前登录用户的所有待审核项)
/// </summary>
@ -42,7 +49,7 @@ namespace DS.WMS.Core.Fee.Interface
Task<DataResult> AuditAsync(int yesOrNo, string remark);
/// <summary>
/// 整单费用状态审核
/// 整审核
/// </summary>
/// <param name="request"></param>
Task<DataResult> AuditBusinessAsync(FeeBizAuditRequest request);

@ -294,6 +294,9 @@ namespace DS.WMS.Core.Fee.Method
var model = await TenantDb.Queryable<FeeApplication>().Where(x => x.Id == application.Id).Select(
x => new { x.Status, x.Currency }).FirstAsync();
if (model == null)
return DataResult.Failed("未能获取申请单信息");
if (model.Status == ApplicationStatus.AuditSubmittd || model.Status == ApplicationStatus.AuditPassed)
return DataResult.Failed("只能修改状态为:未提交/审核驳回的申请单");
@ -580,7 +583,7 @@ namespace DS.WMS.Core.Fee.Method
if (list2.Count > 0)
{
string msg = string.Join("; ", list2.Select(x => $"{x.ApplicationNO}"));
return DataResult.Failed($"以下{msg} 未在审批状态中,无需撤销");
return DataResult.Failed($"以下申请单{msg} 未在审批状态中,无需撤销");
}
var flows = list.Select(x => new FlowInstance { Id = x.FlowId.Value, FlowStatus = (int)FlowStatusEnum.Draft, MakerList = string.Empty }).ToList();

@ -311,7 +311,7 @@ namespace DS.WMS.Core.Fee.Method
}
/// <summary>
/// 按费用批量审
/// 按费用批量审
/// </summary>
/// <param name="yesOrNo">审批结果1=通过2=驳回</param>
/// <param name="remark">备注</param>
@ -391,7 +391,27 @@ namespace DS.WMS.Core.Fee.Method
}
/// <summary>
/// 按业务批量审批
/// 按业务批量审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> AuditAsync(FeeBizAuditRequest request)
{
var list1 = request.Items.Select(x => x.Id).ToList();
var list2 = request.Items.Select(x => x.BusinessType).Distinct().ToList();
var recordIds = await Db.Queryable<FeeRecord>().Where(x =>
list1.Contains(x.BusinessId) && list2.Contains(x.BusinessType))
.Select(x => x.Id).ToArrayAsync();
//没有待审批的列表直接返回不再执行后续查询
if (recordIds.Length == 0)
return DataResult.Failed("当前暂无待审批的费用");
return await AuditAsync(request.Result, request.Remark, recordIds);
}
/// <summary>
/// 整单审核
/// </summary>
/// <param name="request">审批请求</param>
/// <returns></returns>

@ -41,7 +41,7 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 批量费用审核
/// 费用审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
@ -54,6 +54,20 @@ namespace DS.WMS.FeeApi.Controllers
return await _auditService.AuditAsync(request.Result, request.Remark, request.Ids);
}
/// <summary>
/// 按业务审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("AuditByBiz")]
public async Task<DataResult> AuditAsync(FeeBizAuditRequest request)
{
if (request == null || (request.Result != 1 && request.Result != 2) || request.Items == null || request.Items.Count == 0)
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return await _auditService.AuditAsync(request);
}
/// <summary>
/// 本票审核(一键审核当前登录用户的所有待审核项)
/// </summary>
@ -70,11 +84,11 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 整单费用状态审核
/// 整审核
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("AuditBusiness")]
[HttpPost, Route("BusinessAudit")]
public async Task<DataResult> AuditBusinessAsync(FeeBizAuditRequest request)
{
if (request == null || (request.Result != 1 && request.Result != 2) || request.Items == null || request.Items.Count == 0)

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-06-13T02:46:52.6971321Z||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<History>True|2024-06-13T08:03:39.8475642Z||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
Loading…
Cancel
Save