From 255a8d14f4130dcf0ce05dd4995db63434730cf3 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 30 May 2025 17:35:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0xml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-ht.yml | 2 ++ .../invoice/service/impl/InvoiceServiceImpl.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index afbc5086..f1199cb5 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -48,6 +48,8 @@ invoice_pdf: #税务ofd附件下载存放路径 invoice_ofd: url: D:\yongansystem\invoice\ofd\ +invoice_xml: + url: D:\yongansystem\invoice\xml\ zx: # 生产用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgOHOzaKWBWOAbslvtYtS8tcQiJ9W9DT2cGQM3KSgXpfygCgYIKoEcz1UBgi2hRANCAAQNPct0MHOuDrVJBIy0RI7JKx9/PTlFHZlkIJr0EqpC+b/+N+z3JKbCMZ/wcP1V36Q+DlfDJCY9Ai/Uk2PZ9ZaF diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index f83258a9..4d91ad4f 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -75,6 +75,8 @@ public class InvoiceServiceImpl extends BaseService imple private String invoicePdfUrl; @Value("${invoice_ofd.url:}") private String invoiceOfdUrl; + @Value("${invoice_xml.url:}") + private String invoiceXmlUrl; @Override public JsonResultEntity queryArchives(JSONObject json) { @@ -232,6 +234,18 @@ public class InvoiceServiceImpl extends BaseService imple ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject); logger.info("========ofd文件上传OA完成========"); } + //获取xml文件到本地 并为xml取名,否则会报无法访问错误 + logger.info("========开始将xml文件保存到本地========"); + String xmlFileName = generateFileName(xmlUrl, "XML"); + String xmlSavePath = invoiceXmlUrl + xmlFileName; + downloadPdf(xmlUrl, xmlSavePath); + logger.info("========pdf文件保存到本地完成========"); + File fileXml = new File(xmlSavePath); + if(null !=fileXml){ + logger.info("========开始将xml文件上传OA========"); + ManyfileUpload(fileXml, entity, sub_reference, att_reference, jsonObject); + logger.info("========xml文件上传OA完成========"); + } saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), true, "QueryInvoiceResultPluginInitializer"); } }