diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs index 4696ae4c..713fbf46 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs @@ -64,6 +64,7 @@ namespace DS.WMS.Core.Application.Method var list = await TenantDb.Queryable() .Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) && f.FeeStatus == FeeStatus.AuditPassed) + .Where(inquiry.GetConditionalModels(Db)) .Select(f => new { f.BusinessId, diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs index f46f37af..0ef3bbc4 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/PaymentApplicationService.cs @@ -322,6 +322,7 @@ namespace DS.WMS.Core.Application.Method CustomerAccount = b.Account, SettlementTypeId = a.SettlementTypeId, SettlementTypeName = c.StlName, + CreateByName = a.CreateUserName }, true).FirstAsync(); var result = DataResult.Success(dto); @@ -377,7 +378,9 @@ namespace DS.WMS.Core.Application.Method x.Vessel, x.Voyno, x.Carrier, - x.Forwarder + x.Forwarder, + x.Sale, + x.SaleDeptName, }).ToListAsync(); foreach (var item in g) { @@ -395,6 +398,8 @@ namespace DS.WMS.Core.Application.Method item.Voyage = biz.Voyno; item.Carrier = biz.Carrier; item.Forwarder = biz.Forwarder; + item.SaleName = biz.Sale; + item.SaleDeptName = biz.SaleDeptName; } } break; diff --git a/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs b/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs index 6a93eab4..c6a70b34 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Interface/IFreeSettlementService.cs @@ -42,8 +42,8 @@ namespace DS.WMS.Core.Settlement.Interface /// /// 根据业务编号及类型获取该票业务的币别 /// - /// 业务ID与业务类型 + /// 业务ID与业务类型 /// - Task>> GetCurrenciesAsync(List items); + Task>> GetCurrenciesAsync(DetailInquiry inquiry); } } 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 5e4705ae..44f3e9ce 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/ApplicationSettlementService.cs @@ -39,7 +39,7 @@ namespace DS.WMS.Core.Settlement.Method var query = TenantDb.Queryable().WhereIF(!string.IsNullOrEmpty(request.OtherQueryCondition?.Number), x => SqlFunc.Subqueryable().InnerJoin((d, f) => d.RecordId == f.Id && f.BusinessType == BusinessType.OceanShippingExport) .InnerJoin((d, f, s) => f.BusinessId == s.Id).Where((d, f, s) => - s.CustomerNo.Contains(request.OtherQueryCondition.Number) || s.BookingNo.Contains(request.OtherQueryCondition.Number) || + s.CustomerNo.Contains(request.OtherQueryCondition.Number) || s.BookingNo.Contains(request.OtherQueryCondition.Number) || s.MBLNO.Contains(request.OtherQueryCondition.Number) || s.CustomerNum.Contains(request.OtherQueryCondition.Number)).Any()) .Select(x => new ApplicationSettlementDto { @@ -472,40 +472,42 @@ namespace DS.WMS.Core.Settlement.Method protected override async Task PostSaveAsync(ApplicationSettlement settlement) { //回写付费申请的状态 - var ids = settlement.Details.Select(x => x.DetailId); - var appIds = await TenantDb.Queryable().Where(x => ids.Contains(x.Id) && (x.Category == DetailCategory.PaidApplication || x.Category == DetailCategory.ChargeApplication)) - .Select(x => x.ApplicationId).ToListAsync(); + if (settlement.BillType == SettlementBillType.Payment) + { + var ids = settlement.Details.Select(x => x.DetailId); + var appIds = await TenantDb.Queryable().Where(x => ids.Contains(x.Id) && x.Category == DetailCategory.PaidApplication) + .Select(x => x.ApplicationId).ToListAsync(); + + var details = await TenantDb.Queryable().Where(x => appIds.Contains(x.ApplicationId) && x.Category == DetailCategory.PaidApplication) + .GroupBy(x => x.ApplicationId).Select(x => new + { + x.ApplicationId, + Count = SqlFunc.AggregateCount(x.Id), + ProcessedCount = SqlFunc.Subqueryable().Where(y => appIds.Contains(y.ApplicationId) && + y.Category == DetailCategory.PaidApplication && y.OriginalAmount - y.OriginalProcessedAmount == 0).Count() + }).ToListAsync(); - var details = await TenantDb.Queryable().Where(x => appIds.Contains(x.ApplicationId) && - (x.Category == DetailCategory.PaidApplication || x.Category == DetailCategory.ChargeApplication)) - .GroupBy(x => x.ApplicationId).Select(x => new + List applications = []; + foreach (var item in details) { - x.ApplicationId, - Count = SqlFunc.AggregateCount(x.Id), - ProcessedCount = SqlFunc.Subqueryable().Where(y => appIds.Contains(y.ApplicationId) && - (y.Category == DetailCategory.PaidApplication || y.Category == DetailCategory.ChargeApplication) && - y.OriginalAmount - y.OriginalProcessedAmount == 0).Count() - }).ToListAsync(); + if (item.Count == 0 || item.ProcessedCount == 0) + continue; - List applications = []; - foreach (var item in details) - { - if (item.Count == 0 || item.ProcessedCount == 0) - continue; + var entity = new PaymentApplication { Id = item.ApplicationId }; + if (item.Count == item.ProcessedCount) + { + entity.Status = PaymentApplicationStatus.SettlementCompleted; + } + else if (item.ProcessedCount != 0) + { + entity.Status = PaymentApplicationStatus.PartialSettlement; + } - var entity = new PaymentApplication { Id = item.ApplicationId }; - if (item.Count == item.ProcessedCount) - { - entity.Status = PaymentApplicationStatus.SettlementCompleted; - } - else if (item.ProcessedCount != 0) - { - entity.Status = PaymentApplicationStatus.PartialSettlement; + applications.Add(entity); } - - applications.Add(entity); + await TenantDb.Updateable(applications).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); } - await TenantDb.Updateable(applications).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); + return await base.PostSaveAsync(settlement); } 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 9eb07a32..ef848912 100644 --- a/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs +++ b/ds-wms-service/DS.WMS.Core/Settlement/Method/FreeSettlementService.cs @@ -7,7 +7,6 @@ using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Invoice.Dtos; -using DS.WMS.Core.Invoice.Entity; using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Settlement.Dtos; using DS.WMS.Core.Settlement.Entity; @@ -53,7 +52,7 @@ namespace DS.WMS.Core.Settlement.Method ETD = x.ETD, CustomNo = x.CustomNo, BookingNo = x.BookingNo, - + Sale = x.Sale, AccountDate = x.AccountDate, Operator = x.Operator, @@ -187,7 +186,7 @@ namespace DS.WMS.Core.Settlement.Method FeeId = f.FeeId, FeeName = f.FeeName, FeeType = f.FeeType, - TotalAmount = f.Amount, + Amount = f.Amount, Currency = f.Currency, OriginalRate = f.ExchangeRate, RestAmount = f.Amount - f.SettlementAmount, @@ -209,17 +208,18 @@ namespace DS.WMS.Core.Settlement.Method /// /// 根据业务编号及类型获取该票业务的币别 /// - /// 业务ID与业务类型 + /// 业务ID与业务类型 /// - public async Task>> GetCurrenciesAsync(List items) + public async Task>> GetCurrenciesAsync(DetailInquiry inquiry) { - var bizIds = items.Select(x => x.Id).Distinct(); - var types = items.Select(x => x.BusinessType).Distinct(); - var cIds = items.Select(x => x.CustomerId).Distinct(); + var bizIds = inquiry.Items.Select(x => x.Id).Distinct(); + var types = inquiry.Items.Select(x => x.BusinessType).Distinct(); + var cIds = inquiry.Items.Select(x => x.CustomerId).Distinct(); var list = await TenantDb.Queryable() .Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) && (f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement)) + .Where(inquiry.GetConditionalModels(Db)) .Select(f => new { f.BusinessId, @@ -229,7 +229,7 @@ namespace DS.WMS.Core.Settlement.Method f.ExchangeRate }).ToListAsync(); - foreach (var item in items) + foreach (var item in inquiry.Items) { item.ExchangeRates = list.Where(x => x.BusinessId == item.Id && x.BusinessType == item.BusinessType && x.CustomerId == item.CustomerId) .GroupBy(x => x.Currency).Select(x => new CurrencyExchangeRate @@ -239,7 +239,7 @@ namespace DS.WMS.Core.Settlement.Method }).ToList(); } - return DataResult>.Success(items); + return DataResult>.Success(inquiry.Items); } /// diff --git a/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs b/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs index 45c6ec03..20c86c4e 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs +++ b/ds-wms-service/DS.WMS.FeeApi/Controllers/PaymentFreeSettlementController.cs @@ -85,12 +85,12 @@ namespace DS.WMS.FeeApi.Controllers /// /// 根据业务编号及类型获取该票业务的币别 /// - /// 业务ID与业务类型 + /// 业务ID与业务类型 /// [HttpPost, Route("GetCurrencies")] - public async Task>> GetCurrenciesAsync([FromBody] List items) + public async Task>> GetCurrenciesAsync([FromBody] DetailInquiry inquiry) { - return await _service.GetCurrenciesAsync(items); + return await _service.GetCurrenciesAsync(inquiry); } /// 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 78cdcc90..591690ee 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-07T04:59:48.6109206Z||;True|2024-11-07T12:54:40.2627978+08:00||;True|2024-11-07T12:37:29.8611351+08:00||;True|2024-11-06T19:01:27.9483417+08:00||;True|2024-11-06T18:55:18.2364740+08:00||;True|2024-11-06T17:27:38.2731683+08:00||;True|2024-11-06T16:15:44.1540206+08:00||;True|2024-11-06T12:00:32.4812370+08:00||;True|2024-11-06T11:20:40.3736064+08:00||;True|2024-11-06T10:10:34.5300344+08:00||;True|2024-11-06T09:40:38.5643842+08:00||;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||; + True|2024-11-07T06:22:20.9464030Z||;True|2024-11-07T12:59:48.6109206+08:00||;True|2024-11-07T12:54:40.2627978+08:00||;True|2024-11-07T12:37:29.8611351+08:00||;True|2024-11-06T19:01:27.9483417+08:00||;True|2024-11-06T18:55:18.2364740+08:00||;True|2024-11-06T17:27:38.2731683+08:00||;True|2024-11-06T16:15:44.1540206+08:00||;True|2024-11-06T12:00:32.4812370+08:00||;True|2024-11-06T11:20:40.3736064+08:00||;True|2024-11-06T10:10:34.5300344+08:00||;True|2024-11-06T09:40:38.5643842+08:00||;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||; \ No newline at end of file