From 2025e6e66b2409a24fde893aa65d01e1f249e13a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Wed, 6 Nov 2024 10:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B9=E7=94=A8=E5=AE=A1=E6=A0=B8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AE=8C=E6=95=B4=E6=80=A7=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 2 ++ .../DS.WMS.Core/Fee/Method/FeeAuditService.cs | 7 +++---- .../DS.WMS.Core/Fee/Method/FeeRecordService.cs | 18 ++++++++++++++++-- .../Method/ApplicationSettlementService.cs | 8 +++----- .../Settlement/Method/FreeSettlementService.cs | 7 ++++--- .../Settlement/Method/SettlementService`1.cs | 1 - .../PublishProfiles/FolderProfile1.pubxml.user | 2 +- 7 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 1b281a40..ed4a01da 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -637,6 +637,8 @@ public static class MultiLanguageConst public const string NoFeeName = "NoFeeName"; [Description("无法执行操作,当前订单的整票费用审核状态为:{0}")] public const string BillFeeStatusError = "BillRecvStatusError"; + [Description("提交费用中包含信息不完整的项,请检查费用对象/金额/汇率等字段")] + public const string FeeInfoIncomplete = "Fee_Info_Incomplete"; #endregion #region 申请相关 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 77269f36..63c76cee 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs @@ -77,15 +77,14 @@ namespace DS.WMS.Core.Fee.Method ids2 = flows.Where(x => x.AuditType == TaskBaseTypeEnum.BILL_RECV_AUDIT || x.AuditType == TaskBaseTypeEnum.BILL_PAY_AUDIT).Select(x => x.BusinessId).ToArray(); } - var queryList = CreateQuery(ids1, ids2); - + var query = CreateQuery(ids1, ids2); if (!request.QueryCondition.IsNullOrEmpty()) { var whereList = request.GetConditionalModels(Db); - queryList = queryList.Where(whereList); + query = query.Where(whereList); } - var result = await queryList.Select().ToQueryPageAsync(request.PageCondition); + var result = await query.Select().ToQueryPageAsync(request.PageCondition); if (result.Data.Count > 0) { //关联用户名称 diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs index 298af6f7..7c9e3ff5 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeRecordService.cs @@ -1,4 +1,5 @@ -using System.Text; +using System.Linq; +using System.Text; using DS.Module.Core; using DS.Module.Core.Extensions; using DS.WMS.Core.Fee.Dtos; @@ -487,7 +488,13 @@ namespace DS.WMS.Core.Fee.Method FeeName = x.FeeName, FeeStatus = x.FeeStatus, BusinessId = x.BusinessId, - BusinessType = x.BusinessType + BusinessType = x.BusinessType, + CustomerId = x.CustomerId, + CustomerName = x.CustomerName, + Unit = x.Unit, + TaxUnitPrice = x.TaxUnitPrice, + Amount = x.Amount, + ExchangeRate = x.ExchangeRate }).ToListAsync(); if (fees.IsNullOrEmpty()) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeRecordNotExist)); @@ -504,6 +511,9 @@ namespace DS.WMS.Core.Fee.Method if (fees.Any(x => x.FeeStatus == FeeStatus.PartialSettlement || x.FeeStatus == FeeStatus.SettlementCompleted)) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeRecordIsSettled)); + if (fees.Any(x => x.CustomerId == 0 || string.IsNullOrEmpty(x.CustomerName) || x.TaxUnitPrice == 0 || x.Amount == 0 || x.ExchangeRate == null)) + return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeInfoIncomplete)); + DataResult result = DataResult.Success; await TenantDb.Ado.BeginTranAsync(); try @@ -919,6 +929,10 @@ namespace DS.WMS.Core.Fee.Method if (await flowService.IsRunning(taskType, type, bid)) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeRecordIsAuditing)); + if (await TenantDb.Queryable().AnyAsync(x => x.BusinessId == bid && x.BusinessType == type && + (x.CustomerId == 0 || string.IsNullOrEmpty(x.CustomerName) || x.TaxUnitPrice == 0 || x.Amount == 0 || x.ExchangeRate == null))) + return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeInfoIncomplete)); + DataResult result; if (useTransaction) await TenantDb.Ado.BeginTranAsync(); diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs index 28c03ef7..1aacc89f 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs @@ -13,7 +13,6 @@ using DS.WMS.Core.Settlement.Entity; using DS.WMS.Core.Settlement.Interface; using DS.WMS.Core.Sys.Entity; using SqlSugar; -using static iText.StyledXmlParser.Jsoup.Select.Evaluator; namespace DS.WMS.Core.Settlement.Method { @@ -50,7 +49,7 @@ namespace DS.WMS.Core.Settlement.Method CustomerBankName = x.CustomerBank.BankName, //未开票 UnInvoiceList = SqlFunc.Subqueryable().InnerJoin((d, f) => d.ApplicationId == x.Id && d.RecordId == f.Id) - .GroupBy((d, f) => f.Currency).ToList((d, f) => new CurrencyAmount { Currency = f.Currency, Amount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount }), + .GroupBy((d, f) => f.Currency).ToList((d, f) => new CurrencyAmount { Currency = f.Currency, Amount = SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount) }), }, true); var whereList = request.GetConditionalModels(Db); @@ -167,7 +166,7 @@ namespace DS.WMS.Core.Settlement.Method /// public async Task>> GetSettlementDetailsAsync(long[] ids) { - var details = await TenantDb.Queryable().Where(d => ids.Contains(d.Id) && d.Category == DetailCategory.PaidApplicationSettlement) + var details = await TenantDb.Queryable().Where(d => ids.Contains(d.Id)) .LeftJoin((d, f) => d.RecordId == f.Id) .LeftJoin((d, f, b) => f.BusinessId == b.BusinessId && f.BusinessType == b.BusinessType) .LeftJoin((d, f, b, p) => d.ApplicationId == p.Id) @@ -268,7 +267,7 @@ namespace DS.WMS.Core.Settlement.Method /// public async Task>> GetApplicationDetailsAsync(long id) { - var details = await TenantDb.Queryable().Where(d => d.ApplicationId == id && d.Category == DetailCategory.PaidApplication && (d.ApplyAmount - d.ProcessedAmount) != 0) + var details = await TenantDb.Queryable().Where(d => d.ApplicationId == id && (d.ApplyAmount - d.ProcessedAmount) != 0) .LeftJoin((d, f) => d.RecordId == f.Id) .Select((d, f) => new PaymentApplicationDetailDto { @@ -497,7 +496,6 @@ namespace DS.WMS.Core.Settlement.Method return await base.PostSaveAsync(settlement); } - protected override DataResult PreDelete(List settlements) { if (settlements.Any(x => x.IsLocked)) diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs index 1c9acc5f..505db6f7 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs @@ -246,7 +246,7 @@ namespace DS.WMS.Core.Settlement.Method model.SettlementDetails = await CreateApplicationDetailQuery((d, f, s) => d.ApplicationId == id) .Select(x => new SettlementDetailDto { - + }, true).ToListAsync(); } @@ -352,7 +352,7 @@ namespace DS.WMS.Core.Settlement.Method //获取剩余待结算金额 var ids = settlement.Details.Select(x => x.RecordId); - var fees = await TenantDb.Queryable().Where(x => ids.Contains(x.Id) && x.FeeStatus == FeeStatus.AuditPassed) + var fees = await TenantDb.Queryable().Where(x => ids.Contains(x.Id)) .Select(x => new { x.Id, @@ -382,7 +382,8 @@ namespace DS.WMS.Core.Settlement.Method continue; } - detail.Category = DetailCategory.PaidApplicationSettlement; + detail.Category = settlement.BillType == SettlementBillType.Payment ? + DetailCategory.PaidFreeSettlement : DetailCategory.ChargeFreeSettlement; } return sb.Length > 0 ? DataResult.Failed(sb.ToString()) : DataResult.Success; diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Method/SettlementService`1.cs b/ds-wms-service/DS.WMS.Core/Settlement/Method/SettlementService`1.cs index 10d5d29e..9eed37b2 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/SettlementService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/SettlementService`1.cs @@ -323,7 +323,6 @@ namespace DS.WMS.Core.Settlement.Method if (settlement.Details.Exists(x => x.OriginalCurrency.IsNullOrEmpty())) return DataResult.FailedWithDesc(nameof(MultiLanguageConst.OriginalCurrencyCanNotNull)); - //settlement.Amount = settlement.Details.Sum(x => x.ApplyAmount); result = await PreSaveAsync(settlement); if (!result.Succeeded) return DataResult.Failed(result.Message, result.MultiCode); 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 595b1a5f..0957f56c 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-11-05T11:07:36.6125691Z||;True|2024-11-05T18:46:33.8702047+08:00||;True|2024-11-05T18:42:41.4519018+08:00||;True|2024-11-05T18:16:03.1698058+08:00||;True|2024-11-05T11:48:07.5089999+08:00||;True|2024-11-04T17:39:07.1315345+08:00||;True|2024-11-04T17:32:28.9239052+08:00||;True|2024-11-04T15:49:58.6422421+08:00||;True|2024-11-04T15:39:25.1892907+08:00||;True|2024-11-04T15:21:49.7395112+08:00||;True|2024-11-04T11:26:53.4821041+08:00||;True|2024-11-04T11:19:48.8467193+08:00||;True|2024-11-04T11:01:39.9398452+08:00||;True|2024-11-04T10:30:55.0743204+08:00||;True|2024-11-02T21:17:44.8575190+08:00||;True|2024-11-02T20:54:29.9931812+08:00||;True|2024-11-02T20:39:20.4100370+08:00||;True|2024-11-02T18:33:41.0724285+08:00||;True|2024-11-02T18:21:55.8561639+08:00||;True|2024-11-02T17:36:24.3401782+08:00||;True|2024-11-02T16:38:03.0054105+08:00||;True|2024-11-02T16:26:26.1698304+08:00||;True|2024-11-02T16:15:20.2872358+08:00||;True|2024-11-02T15:19:14.9663838+08:00||;True|2024-11-02T14:39:47.8808708+08:00||;False|2024-11-02T14:22:04.2841792+08:00||;True|2024-11-02T11:50:48.2452805+08:00||;True|2024-10-29T18:52:12.7978878+08:00||;True|2024-10-29T10:27:49.1623527+08:00||;True|2024-10-25T15:09:27.7029075+08:00||;True|2024-10-25T10:29:26.9218878+08:00||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||; + True|2024-11-06T01:40:38.5643842Z||;True|2024-11-05T19:07:36.6125691+08:00||;True|2024-11-05T18:46:33.8702047+08:00||;True|2024-11-05T18:42:41.4519018+08:00||;True|2024-11-05T18:16:03.1698058+08:00||;True|2024-11-05T11:48:07.5089999+08:00||;True|2024-11-04T17:39:07.1315345+08:00||;True|2024-11-04T17:32:28.9239052+08:00||;True|2024-11-04T15:49:58.6422421+08:00||;True|2024-11-04T15:39:25.1892907+08:00||;True|2024-11-04T15:21:49.7395112+08:00||;True|2024-11-04T11:26:53.4821041+08:00||;True|2024-11-04T11:19:48.8467193+08:00||;True|2024-11-04T11:01:39.9398452+08:00||;True|2024-11-04T10:30:55.0743204+08:00||;True|2024-11-02T21:17:44.8575190+08:00||;True|2024-11-02T20:54:29.9931812+08:00||;True|2024-11-02T20:39:20.4100370+08:00||;True|2024-11-02T18:33:41.0724285+08:00||;True|2024-11-02T18:21:55.8561639+08:00||;True|2024-11-02T17:36:24.3401782+08:00||;True|2024-11-02T16:38:03.0054105+08:00||;True|2024-11-02T16:26:26.1698304+08:00||;True|2024-11-02T16:15:20.2872358+08:00||;True|2024-11-02T15:19:14.9663838+08:00||;True|2024-11-02T14:39:47.8808708+08:00||;False|2024-11-02T14:22:04.2841792+08:00||;True|2024-11-02T11:50:48.2452805+08:00||;True|2024-10-29T18:52:12.7978878+08:00||;True|2024-10-29T10:27:49.1623527+08:00||;True|2024-10-25T15:09:27.7029075+08:00||;True|2024-10-25T10:29:26.9218878+08:00||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||; \ No newline at end of file