From 3bfb0429a09e36b5d8f39e8b3ecaf3b5c8a1ae9e Mon Sep 17 00:00:00 2001 From: lihao Date: Mon, 26 May 2025 18:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=89=B9=E9=87=8F=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sale/action/InvoiceDownloadAction.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sscivm/src/client/nccloud/web/sscivm/ivsale/sale/action/InvoiceDownloadAction.java b/sscivm/src/client/nccloud/web/sscivm/ivsale/sale/action/InvoiceDownloadAction.java index 9ef8900..4257141 100644 --- a/sscivm/src/client/nccloud/web/sscivm/ivsale/sale/action/InvoiceDownloadAction.java +++ b/sscivm/src/client/nccloud/web/sscivm/ivsale/sale/action/InvoiceDownloadAction.java @@ -122,7 +122,8 @@ public class InvoiceDownloadAction implements ICommonAction { String ofdData = (String) infoMap.get("taxofd"); if (MMValueCheck.isEmpty(pdfData) && MMValueCheck.isEmpty(xmlData) && MMValueCheck.isEmpty(ofdData)) { - throw new Exception("未查询到发票信息"); +// throw new Exception("未查询到发票信息"); + continue; } String ctcode = ""; @@ -135,13 +136,17 @@ public class InvoiceDownloadAction implements ICommonAction { "AND bd.pk_defdoc = '" + ivApplicationHeadVO.getDef2().toString() + "' "; // List> operationresult = (List>) getQueryService().executeQuery(operationSql, new ArrayListProcessor()); Map valList = (Map) getQueryService().executeQuery(operationSql, new MapProcessor()); - ctcode = (String) valList.get("name"); + if(valList == null){ + ctcode = ivApplicationHeadVO.getDef2(); // 合同号 + } + } + if(!ctcode.equals("") && !ctcode.equals("/") ){ + ctcode=ctcode+"_"; } - // 添加 PDF if (!MMValueCheck.isEmpty(pdfData)) { byte[] pdfBytes = DatatypeConverter.parseBase64Binary(pdfData); - zipStream.putNextEntry(new ZipEntry(ctcode + "_" + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".pdf")); + zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".pdf")); zipStream.write(pdfBytes); zipStream.closeEntry(); } @@ -149,7 +154,7 @@ public class InvoiceDownloadAction implements ICommonAction { // 添加 XML if (!MMValueCheck.isEmpty(xmlData)) { byte[] xmlBytes = DatatypeConverter.parseBase64Binary(xmlData); - zipStream.putNextEntry(new ZipEntry(ctcode + "_" + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".xml")); + zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".xml")); zipStream.write(xmlBytes); zipStream.closeEntry(); } @@ -157,11 +162,11 @@ public class InvoiceDownloadAction implements ICommonAction { // 添加 OFD if (!MMValueCheck.isEmpty(ofdData)) { byte[] ofdBytes = DatatypeConverter.parseBase64Binary(ofdData); - zipStream.putNextEntry(new ZipEntry(ctcode + "_" + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".ofd")); + zipStream.putNextEntry(new ZipEntry(ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()) + ".ofd")); zipStream.write(ofdBytes); zipStream.closeEntry(); } - zipName=ctcode + "_" + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()); + zipName=ctcode + headVO.getGmfmc() + "_" + headVO.getFphm() + "_" + String.valueOf(headVO.getJshj().toDouble()); } else { throw new Exception("获取发票信息失败"); }