From 86e6fd73afc50d2781cb858956e868401cfb221d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=A6=E9=BA=9F=20=E7=8E=8B?= <2452821485@qq.com> Date: Thu, 24 Apr 2025 17:46:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=8A=9F=E8=83=BD=E4=BB=A5=E7=A1=AE=E5=AE=9A=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E4=B9=A6=E7=94=9F=E6=88=90=E6=B5=81=E7=A8=8B=E5=87=BA?= =?UTF-8?q?=E9=94=99=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Plugins/TradeDocGenerator/BaseDocumentGenerator_Batch.cs | 3 ++- .../TradeModule/DealModule/TradeContractGenerateService.cs | 3 +++ .../DocGenerateModule/ConfirmationGenerateContext.cs | 2 ++ .../DocGenerateModule/ConfirmationGenerateService.cs | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Framework/YLErp.Core/Plugins/TradeDocGenerator/BaseDocumentGenerator_Batch.cs b/Framework/YLErp.Core/Plugins/TradeDocGenerator/BaseDocumentGenerator_Batch.cs index 913af16d..ee8ea3bc 100644 --- a/Framework/YLErp.Core/Plugins/TradeDocGenerator/BaseDocumentGenerator_Batch.cs +++ b/Framework/YLErp.Core/Plugins/TradeDocGenerator/BaseDocumentGenerator_Batch.cs @@ -156,6 +156,7 @@ namespace YLErp.Plugins.TradeDocGenerator case ".doc": case ".docx": //outPutFilePath = outPutFilePath.Replace(".pdf", $".docx"); + LogFactory.GetLogger().Info($"生成确认书文件:{outPutFilePath}"); GenerateWordDocFile(templateFullPath, _viewData, outPutFilePath); break; default: @@ -165,7 +166,7 @@ namespace YLErp.Plugins.TradeDocGenerator //更新操作时间 var now = DateTime.Now; File.SetLastAccessTime(outPutFilePath, now); - + LogFactory.GetLogger().Info($"生成确认书保存Contract"); confirmDocs = Context.SaveContractDocuments(outPutFileName, contractNo, true); if (PS.GetErpConfig().IsAutoSealAndUploadFiles && PS.GetErpConfig().IsAutoSealAfterGeneratedBook) diff --git a/YLErpDAL/Modules/TradeModule/DealModule/TradeContractGenerateService.cs b/YLErpDAL/Modules/TradeModule/DealModule/TradeContractGenerateService.cs index 86d7f721..0393f7f0 100644 --- a/YLErpDAL/Modules/TradeModule/DealModule/TradeContractGenerateService.cs +++ b/YLErpDAL/Modules/TradeModule/DealModule/TradeContractGenerateService.cs @@ -212,6 +212,7 @@ namespace YLErp.Modules.TradeModule.DealModule List file = new List(); if (PS.Config.Company == CompanyEnum.浙商) { + LogFactory.GetLogger("生成确认书").Error("浙商生成确认书"); var TradeQuery = new TradeDalService(this).GetTradeOrEodTradeOfTidASid(tradeIds, SystemValueDate).Where(c => (c.TradeType != "结构化交易" || c.IsGroup == 1) && tradeIds.Contains(c.id)); if (TradeQuery.Any()) { @@ -237,6 +238,7 @@ namespace YLErp.Modules.TradeModule.DealModule if (query.Any()) { // 使用现有的 groupGenerateHandle 方法来处理每组交易 + groupGenerateHandle(query.Select(l => l.id).Distinct().ToList(), docType, startDate, endDate, results, error, file); } } @@ -244,6 +246,7 @@ namespace YLErp.Modules.TradeModule.DealModule } if (results.Count == 0) { + LogFactory.GetLogger("生成确认书").Error("浙商生成确认书" + tradeIds.Count()); results = new ConfirmationGenerateService(this).Generate(tradeIds, docType); } errors = results.Where(n => !string.IsNullOrWhiteSpace(n.ErrorMessage)).Select(n => n.ErrorMessage).ToList(); diff --git a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs index c24287e3..6eb5d1f2 100644 --- a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs +++ b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateContext.cs @@ -304,10 +304,12 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule //WordHelper.GenerateFromTemplate(templatePath, modelDic, outputFilePath); var varDic = new JsonVarDic(modelDic); var _outputFilePath = outputFilePath.Replace(".pdf", ".docx"); + LogFactory.GetLogger("Word生成").Info($"生成Word文档:{_outputFilePath}"); OfficeFileConverter.ConvertByUsingDocTemplate(templatePath, _outputFilePath, varDic, false); var toPDF = outputFilePath.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase); if (genPdf && toPDF) { + LogFactory.GetLogger("Word生成").Info($"转换Word文档为PDF:{_outputFilePath}"); ConvertToPdfHelper.ConvertPDFByApi(HttpUtility.UrlEncode(_outputFilePath), HttpUtility.UrlEncode(outputFilePath)); } } diff --git a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateService.cs b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateService.cs index 21b88550..004669e8 100644 --- a/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateService.cs +++ b/YLErpDAL/Modules/TradeModule/DocGenerateModule/ConfirmationGenerateService.cs @@ -162,10 +162,13 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule var tradeContractGroupTradeIds = tradeDic.Values.Select(x => x.trade.id).ToList(); //var childs = DbContext.trade.Where(x => tradeContractGroupTradeIds.Contains(x.ParentTradeId ?? 0)); var childs = service.GetStructTradeFromTradeOrEodTrade(tradeContractGroupTradeIds, SystemValueDate, true); + LogFactory.GetLogger("交易确认书").Info("交易确认书1:" + string.Join(",", tradeContractGroupTradeIds)); if (PS.Config.Company == Configuration.CompanyEnum.浙商) { + LogFactory.GetLogger("交易确认书").Info("交易确认书浙商"); if (generatorV2 != null) { + LogFactory.GetLogger("交易确认书").Info("交易确认书插件"); var result = GenerateSingleV2(generatorV2, null, docType , allTradeList); resultList.Add(result); } @@ -238,6 +241,7 @@ namespace YLErp.Modules.TradeModule.DocGenerateModule trades, ContractTypeEnum.Trade, OptUser, null, null); generator.Initialize(docType, context); + LogFactory.GetLogger("交易确认书").Info("交易确认书init"); return generator.GenerateDocument(); } catch (Exception ex)