From 947096a26274f3992b3ef830039af84822e3c9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= Date: Wed, 29 Apr 2026 15:50:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=9D=E8=AF=81=E9=87=91=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=BC=93=E5=AD=98=E8=87=AA=E5=8A=A8=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarginModule/ClientMarginConfigService.cs | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/YLErpDAL/Modules/MarginModule/ClientMarginConfigService.cs b/YLErpDAL/Modules/MarginModule/ClientMarginConfigService.cs index b1c4efe1..370e1b51 100644 --- a/YLErpDAL/Modules/MarginModule/ClientMarginConfigService.cs +++ b/YLErpDAL/Modules/MarginModule/ClientMarginConfigService.cs @@ -1,4 +1,7 @@ +using Microsoft.Extensions.DependencyInjection; using System.Data; +using YieldChain.Commons; +using YLErp.Cache; using YLErp.Model; namespace YLErp.Modules.MarginModule @@ -58,7 +61,7 @@ namespace YLErp.Modules.MarginModule var query = from config in DbContext.clientMarginConfig select new ClientMarginConfigDto { - EncryptId=config.EncryptId, + EncryptId = config.EncryptId, id = config.id, client_id = config.client_id, client_name = config.client_name, @@ -78,15 +81,15 @@ namespace YLErp.Modules.MarginModule query = query.Where(o => o.value_date == req.ValueDate.Value); } - var configs = query.OrderByDescending(o=>o.id).ToList(); - + var configs = query.OrderByDescending(o => o.id).ToList(); + // 为每个配置加载5条固定期限的详情数据 var fixedTerms = ConsMarginTerm.AllowedTerms.ToArray(); foreach (var config in configs) { var existingDetails = DbContext.clientMarginDetail.Where(d => d.config_id == config.id).ToList(); var detailDtos = new List(); - + for (int i = 0; i < fixedTerms.Length; i++) { var term = fixedTerms[i]; @@ -112,11 +115,11 @@ namespace YLErp.Modules.MarginModule }); } } - + // 直接使用DTO格式返回给前端 config.details = detailDtos; } - + return configs; } @@ -142,6 +145,16 @@ namespace YLErp.Modules.MarginModule DbContext.SaveChanges(); trans.Commit(); + + // 更新保证金率缓存:通用配置变动清除全部,客户配置变动只清除该客户的 + var ylCache = YLServiceLocator.ServiceProvider?.GetService(); + if (ylCache != null) + { + var cachePattern = config.client_id == 0 + ? "Otc:ClientMarginRate:*" + : $"Otc:ClientMarginRate:{config.client_id}:*"; + ylCache.BatchDelete(cachePattern); + } } catch { From 1c1e7daca5b9fa2f13b929e72e23678a9069af25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= Date: Wed, 29 Apr 2026 16:26:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=88=86=E9=9A=94=E7=AC=A6=E4=B8=BA=E6=AD=A3?= =?UTF-8?q?=E6=96=9C=E6=9D=A0=E6=8F=90=E5=8D=87=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DocumentGenerator/TradeSettleBillGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs index fa249dac..c9ef61ca 100644 --- a/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs +++ b/Plugins/YLErp.Plugins.GuoLian/DocumentGenerator/TradeSettleBillGenerator.cs @@ -19,7 +19,7 @@ namespace YLErp.Plugins.GuoLian.DocumentGenerator protected override string GetTemplateFilePath() { - var templatePath = Path.Combine(GlobalConfig.PluginFolder, "App_Docs\\settlement_template\\settle_01.docx"); + var templatePath = Path.Combine(GlobalConfig.PluginFolder, "App_Docs/settlement_template/settle_01.docx"); return templatePath; }