diff --git a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs index 8f6f1a43..af8bb9c8 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeAuditService.cs @@ -25,7 +25,7 @@ namespace DS.WMS.Core.Fee.Interface Task>> GetBizListAsync(PageRequest request); /// - /// 批量审批 + /// 按费用批量审批 /// /// 审批结果 /// 备注 @@ -33,6 +33,13 @@ namespace DS.WMS.Core.Fee.Interface /// Task AuditAsync(int yesOrNo, string remark, params long[] idArray); + /// + /// 按业务批量审核 + /// + /// + /// + Task AuditAsync(FeeBizAuditRequest request); + /// /// 本票审核(一键审核当前登录用户的所有待审核项) /// @@ -42,7 +49,7 @@ namespace DS.WMS.Core.Fee.Interface Task AuditAsync(int yesOrNo, string remark); /// - /// 整单费用状态审核 + /// 整票审核 /// /// Task AuditBusinessAsync(FeeBizAuditRequest request); diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs index 9d5f08cd..da2169e7 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeApplicationService.cs @@ -294,6 +294,9 @@ namespace DS.WMS.Core.Fee.Method var model = await TenantDb.Queryable().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(); diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs index f32c1ef8..4b1b4028 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs @@ -311,7 +311,7 @@ namespace DS.WMS.Core.Fee.Method } /// - /// 按费用批量审批 + /// 按费用批量审核 /// /// 审批结果:1=通过,2=驳回 /// 备注 @@ -391,7 +391,27 @@ namespace DS.WMS.Core.Fee.Method } /// - /// 按业务批量审批 + /// 按业务批量审核 + /// + /// + /// + public async Task 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().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); + } + + /// + /// 整单审核 /// /// 审批请求 /// diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs index bab876b2..beb64001 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/FeeAuditController.cs @@ -41,7 +41,7 @@ namespace DS.WMS.FeeApi.Controllers } /// - /// 批量费用审核 + /// 按费用审核 /// /// /// @@ -54,6 +54,20 @@ namespace DS.WMS.FeeApi.Controllers return await _auditService.AuditAsync(request.Result, request.Remark, request.Ids); } + /// + /// 按业务审核 + /// + /// + /// + [HttpPost, Route("AuditByBiz")] + public async Task 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); + } + /// /// 本票审核(一键审核当前登录用户的所有待审核项) /// @@ -70,11 +84,11 @@ namespace DS.WMS.FeeApi.Controllers } /// - /// 整单费用状态审核 + /// 整票审核 /// /// /// - [HttpPost, Route("AuditBusiness")] + [HttpPost, Route("BusinessAudit")] public async Task AuditBusinessAsync(FeeBizAuditRequest request) { if (request == null || (request.Result != 1 && request.Result != 2) || request.Items == null || request.Items.Count == 0) diff --git a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user index c068e7f3..f0d7a5cf 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. <_PublishTargetUrl>D:\Publish\DS8\FeeApi - 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||; + 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||; \ No newline at end of file