|
@ -647,7 +647,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform |
|
|
* */ |
|
|
* */ |
|
|
@Override |
|
|
@Override |
|
|
public void exportInvoiceInfinity(String shippingInformationCode, HttpServletResponse response) { |
|
|
public void exportInvoiceInfinity(String shippingInformationCode, HttpServletResponse response) { |
|
|
String fileName = "销售出货发票1.xlsx"; |
|
|
String fileName = "销售出货发票infinity.xlsx"; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); |
|
|
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); |
|
@ -688,7 +688,17 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform |
|
|
exportShippingInvoiceDtos.add(exportShippingInvoiceDto); |
|
|
exportShippingInvoiceDtos.add(exportShippingInvoiceDto); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal total = BigDecimal.ZERO; |
|
|
|
|
|
String commonCurrency = sysSalesOrderVo.getCommonCurrency(); |
|
|
|
|
|
if (StringUtils.isNotEmpty(commonCurrency)){ |
|
|
|
|
|
// 使用 Optional 来安全处理可能为 null 的情况,并使用 reduce 方法来合计 BigDecimal 值
|
|
|
|
|
|
total = salesShippingInformationDetails.stream() |
|
|
|
|
|
.map(detail -> CURRENCY_RMB.equals(commonCurrency) |
|
|
|
|
|
? detail.getAllNoTaxRmb() // 如果是人民币,获取人民币字段
|
|
|
|
|
|
: detail.getAllNoTaxDollar()) // 否则,获取美元字段
|
|
|
|
|
|
.filter(Objects::nonNull) // 过滤掉可能存在的 null 值
|
|
|
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add); // 合计 BigDecimal 值
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
@ -700,6 +710,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform |
|
|
map.put("orderDate",salesShippingInformation.getOrderDate()); |
|
|
map.put("orderDate",salesShippingInformation.getOrderDate()); |
|
|
map.put("originCountry",salesShippingInformation.getOriginCountry()); |
|
|
map.put("originCountry",salesShippingInformation.getOriginCountry()); |
|
|
map.put("tradeTerms",salesShippingInformation.getTradeTerms()); |
|
|
map.put("tradeTerms",salesShippingInformation.getTradeTerms()); |
|
|
|
|
|
map.put("total",total); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build(); |
|
|
ExcelWriter workBook = EasyExcel.write(response.getOutputStream()).withTemplate(fileAbsolutePath).build(); |
|
@ -721,7 +732,7 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform |
|
|
* */ |
|
|
* */ |
|
|
@Override |
|
|
@Override |
|
|
public void exportInvoiceVantritek(String shippingInformationCode, HttpServletResponse response) { |
|
|
public void exportInvoiceVantritek(String shippingInformationCode, HttpServletResponse response) { |
|
|
String fileName = "销售出货发票2.xlsx"; |
|
|
String fileName = "销售出货发票vantritek.xlsx"; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); |
|
|
String fileAbsolutePath = FileDownloadUtils.getFileAbsolutePath(fileName); |
|
@ -763,8 +774,6 @@ public class SalesShippingInformationServiceImpl implements ISalesShippingInform |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
map.put("customerContact",salesShippingInformation.getCustomerContact()); |
|
|
map.put("customerContact",salesShippingInformation.getCustomerContact()); |
|
|
map.put("customerContactAddress",salesShippingInformation.getCustomerContactAddress()); |
|
|
map.put("customerContactAddress",salesShippingInformation.getCustomerContactAddress()); |
|
|