|
|
|
@ -542,6 +542,16 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
queryBody.put("NSRSBH", companyservice.getSellertax()); |
|
|
|
|
queryBody.put("DDQQLSH", originBillInfo.getSystemOrderno()); |
|
|
|
|
|
|
|
|
|
// todo 潍焦获取服务信息
|
|
|
|
|
List<CompanyserviceProp> companyservicePropList = companyservicePropMapper.selectCompanyservicePropByCompanyid(companyservice.getCompanyid()); |
|
|
|
|
if (CollectionUtils.isNotEmpty(companyservicePropList) && companyservicePropList.size() > 0) { |
|
|
|
|
for (CompanyserviceProp companyserviceProp : companyservicePropList) { |
|
|
|
|
if ("weijiao_invoice_key".equals(companyserviceProp.getKey())) { |
|
|
|
|
queryBody.put("BSWJ", "0"); |
|
|
|
|
queryBody.put("WJLX", "ALL"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debugLog("断点4", uuid, timestamp); |
|
|
|
@ -706,7 +716,22 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
|
|
|
|
|
//配置文件存储类型0为数据库存储
|
|
|
|
|
if (Constants.STRING_0.equals(type)) { |
|
|
|
|
|
|
|
|
|
// todo 潍焦单独处理
|
|
|
|
|
boolean flag = false; |
|
|
|
|
if (CollectionUtils.isNotEmpty(companyservicePropList) && companyservicePropList.size() > 0) { |
|
|
|
|
for (CompanyserviceProp companyserviceProp : companyservicePropList) { |
|
|
|
|
if ("weijiao_invoice_key".equals(companyserviceProp.getKey())) { |
|
|
|
|
flag = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (flag){ |
|
|
|
|
saveFileUseDbWeijiao(invoice, fileId, fileName, companyservice, ddfpxx,ddfpzxx); |
|
|
|
|
}else { |
|
|
|
|
saveFileUseDb(invoice, fileId, fileName, companyservice, ddfpxx); |
|
|
|
|
} |
|
|
|
|
//配置文件存储类型1为oss存储
|
|
|
|
|
} else if (Constants.STRING_1.equals(type)) { |
|
|
|
|
saveFileUseOss(defaultStorage, invoice, ddfpxx); |
|
|
|
@ -934,6 +959,78 @@ public class ElephantInvoiceApiV6ServiceImpl implements IInvoiceApiService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveFileUseDbWeijiao(Invoice invoice, String fileId, String fileName, Companyservice companyservice, DDFPXX ddfpxx, DDFPZXX ddfpzxx) { |
|
|
|
|
InvoiceFile invoiceFile = new InvoiceFile(); |
|
|
|
|
List<FILEITEMLIST> fileitemlist = ddfpzxx.getFILEITEMLIST(); |
|
|
|
|
String pdfFileId = ""; |
|
|
|
|
String xmlFileId = ""; |
|
|
|
|
for (FILEITEMLIST fileitem : fileitemlist) { |
|
|
|
|
if ("PDF".equals(fileitem.getWJLX())) { |
|
|
|
|
pdfFileId = fileId + "pdf"; |
|
|
|
|
invoiceFile.setFphm(ddfpxx.getFPHM() + "pdf"); |
|
|
|
|
List<InvoiceFile> invoiceFileList = invoiceFileMapper.selectInvoiceFileList(invoiceFile); |
|
|
|
|
if (invoiceFileList != null && invoiceFileList.size() > 0) { |
|
|
|
|
invoiceFile = invoiceFileList.get(0); |
|
|
|
|
invoiceFile.setFileContent(fileitem.getFILECONTENT()); |
|
|
|
|
invoiceFile.setFileName(fileName); |
|
|
|
|
invoiceFile.setCreateTime(new Date()); |
|
|
|
|
invoiceFile.setIdentity(companyservice.getIdentity()); |
|
|
|
|
invoiceFile.setTax(companyservice.getSellertax()); |
|
|
|
|
pdfFileId = invoiceFile.getFileId(); |
|
|
|
|
invoiceFileMapper.updateInvoiceFile(invoiceFile); |
|
|
|
|
} else { |
|
|
|
|
invoiceFile.setId(pdfFileId); |
|
|
|
|
invoiceFile.setFileContent(fileitem.getFILECONTENT()); |
|
|
|
|
invoiceFile.setFileId(pdfFileId); |
|
|
|
|
invoiceFile.setFileName(fileName); |
|
|
|
|
invoiceFile.setCreateTime(new Date()); |
|
|
|
|
invoiceFile.setIdentity(companyservice.getIdentity()); |
|
|
|
|
invoiceFile.setTax(companyservice.getSellertax()); |
|
|
|
|
invoiceFileMapper.insertInvoiceFile(invoiceFile); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("XML".equals(fileitem.getWJLX())) { |
|
|
|
|
xmlFileId = fileId + "xml"; |
|
|
|
|
invoiceFile.setFphm(ddfpxx.getFPHM() + "xml"); |
|
|
|
|
List<InvoiceFile> invoiceFileList = invoiceFileMapper.selectInvoiceFileList(invoiceFile); |
|
|
|
|
if (invoiceFileList != null && invoiceFileList.size() > 0) { |
|
|
|
|
invoiceFile = invoiceFileList.get(0); |
|
|
|
|
invoiceFile.setFileContent(fileitem.getFILECONTENT()); |
|
|
|
|
invoiceFile.setFileName(fileName); |
|
|
|
|
invoiceFile.setCreateTime(new Date()); |
|
|
|
|
invoiceFile.setIdentity(companyservice.getIdentity()); |
|
|
|
|
invoiceFile.setTax(companyservice.getSellertax()); |
|
|
|
|
xmlFileId = invoiceFile.getFileId(); |
|
|
|
|
invoiceFileMapper.updateInvoiceFile(invoiceFile); |
|
|
|
|
} else { |
|
|
|
|
invoiceFile.setId(xmlFileId); |
|
|
|
|
invoiceFile.setFileContent(fileitem.getFILECONTENT()); |
|
|
|
|
invoiceFile.setFileId(xmlFileId); |
|
|
|
|
invoiceFile.setFileName(fileName); |
|
|
|
|
invoiceFile.setCreateTime(new Date()); |
|
|
|
|
invoiceFile.setIdentity(companyservice.getIdentity()); |
|
|
|
|
invoiceFile.setTax(companyservice.getSellertax()); |
|
|
|
|
invoiceFileMapper.insertInvoiceFile(invoiceFile); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2023/11/16 kk:上传OSS转下载地址关闭,改为直接返回大象的文件流
|
|
|
|
|
invoice.setInvoicePdfUrl(ELE_File_URL + pdfFileId + ";" + "http://127.0.0.1:8081/invoice/xmlFileUrl/" + xmlFileId); |
|
|
|
|
ICompanyservicePropService companyserviceProp = SpringUtils.getBean(ICompanyservicePropService.class); |
|
|
|
|
CompanyserviceProp secretIdProp = companyserviceProp.selectPropByKey(companyservice.getCompanyid(), "elephant_invoice_file_dc"); |
|
|
|
|
if (secretIdProp != null) { |
|
|
|
|
invoice.setInvoicePdfUrl(secretIdProp.getValue() + fileId); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveFileUseDb(Invoice invoice, String fileId, String fileName, Companyservice companyservice, DDFPXX ddfpxx) { |
|
|
|
|
InvoiceFile invoiceFile = new InvoiceFile(); |
|
|
|
|
invoiceFile.setFphm(ddfpxx.getFPHM()); |
|
|
|
|