update 2.2.32

master
luoyang 5 years ago
parent 42c30ce9af
commit 86751b2c94

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.1.40</version> <version>2.1.41</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.2.33</version> <version>2.2.34</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

@ -138,6 +138,8 @@ public class TradeLogServiceImpl implements TradeLogService {
private org.springframework.core.io.Resource incremental_trans_flow; private org.springframework.core.io.Resource incremental_trans_flow;
@Value("classpath:/jasper/partner_upay_invoice_gst.jasper") @Value("classpath:/jasper/partner_upay_invoice_gst.jasper")
private org.springframework.core.io.Resource upay_trans_flow; private org.springframework.core.io.Resource upay_trans_flow;
@Value("classpath:/jasper/incremental_partner_upay_invoice_gst.jasper")
private org.springframework.core.io.Resource incremental_upay_trans_flow;
@Value("classpath:/jasper/royalpay_logo.png") @Value("classpath:/jasper/royalpay_logo.png")
private org.springframework.core.io.Resource logo; private org.springframework.core.io.Resource logo;
@Value("classpath:/jasper/trans_excel.jasper") @Value("classpath:/jasper/trans_excel.jasper")
@ -822,20 +824,23 @@ public class TradeLogServiceImpl implements TradeLogService {
parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO));
parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO));
parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2,RoundingMode.HALF_UP)); parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2,RoundingMode.HALF_UP));
parmerters.put("total_transaction_fee", analysis.getBigDecimal("total_transaction_fee").add(analysis.getBigDecimal("total_transaction_fee_tax")).setScale(2,RoundingMode.HALF_UP)); BigDecimal totalTransactionFee = analysis.getBigDecimal("total_transaction_fee").add(analysis.getBigDecimal("total_transaction_fee_tax")).setScale(2, RoundingMode.HALF_UP);
parmerters.put("total_royalpay_fee", analysis.getBigDecimal("total_surcharge").subtract(parmerters.getBigDecimal("total_transaction_fee")).setScale(2,RoundingMode.HALF_UP)); BigDecimal totalRoyalpayFee = analysis.getBigDecimal("total_surcharge")
.subtract(analysis.getBigDecimal("total_transaction_fee"))
.subtract(analysis.getBigDecimal("total_transaction_fee_tax"))
.subtract(analysis.getBigDecimal("total_incremental_surcharge"))
.subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2, RoundingMode.HALF_UP);
parmerters.put("total_transaction_fee", totalTransactionFee);
parmerters.put("total_royalpay_fee", totalRoyalpayFee);
parmerters.put("total_card_fee", totalRoyalpayFee.add(totalTransactionFee));
parmerters.put("total_incremental_fee", parmerters.getBigDecimal("incremental_fee").add(parmerters.getBigDecimal("incremental_gst")));
dataList.parallelStream().forEach(item -> { dataList.parallelStream().forEach(item -> {
BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO;
BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO;
BigDecimal royalpaySurhcarge = item.containsKey("royal_surcharge") ? item.getBigDecimal("royal_surcharge") : BigDecimal.ZERO;
BigDecimal surhcargeBack = item.containsKey("surcharge_cashback") ? item.getBigDecimal("surcharge_cashback") : BigDecimal.ZERO;
BigDecimal channelSurcharge = item.containsKey("channel_surcharge") ? item.getBigDecimal("channel_surcharge") : BigDecimal.ZERO;
BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP);
BigDecimal transactionFee = item.getBigDecimal("transaction_fee"); BigDecimal transactionFee = item.getBigDecimal("transaction_fee");
BigDecimal transactionFeeTax = item.getBigDecimal("transaction_fee").divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); BigDecimal transactionFeeTax = item.getBigDecimal("transaction_fee").divide(new BigDecimal(10), 2, RoundingMode.HALF_UP);
BigDecimal royalpayTax = taxAmount.subtract(incrementalTax).subtract(transactionFeeTax); BigDecimal realRoyalpayCharge = item.getBigDecimal("total_surcharge").add(taxAmount).subtract(transactionFee).subtract(transactionFeeTax).subtract(incrementalSurcharge).subtract(incrementalTax);
BigDecimal realRoyalpayCharge = item.getBigDecimal("total_surcharge").add(taxAmount).subtract(transactionFee).subtract(transactionFeeTax);
item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP));
item.put("total_surcharge_intax", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP)); item.put("total_surcharge_intax", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP));
item.put("transaction_fee_intax", transactionFee.add(transactionFeeTax).setScale(2,RoundingMode.HALF_UP)); item.put("transaction_fee_intax", transactionFee.add(transactionFeeTax).setScale(2,RoundingMode.HALF_UP));
@ -850,9 +855,8 @@ public class TradeLogServiceImpl implements TradeLogService {
String fileName = client.getString("client_moniker") + "_Card_Payment_" + parmerters.getString("dateRange").replaceAll("/", ""); String fileName = client.getString("client_moniker") + "_Card_Payment_" + parmerters.getString("dateRange").replaceAll("/", "");
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf");
OutputStream outs = response.getOutputStream(); OutputStream outs = response.getOutputStream();
// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城");
// InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream(); InputStream jasper = clientIncrement == null ? upay_trans_flow.getInputStream() : incremental_upay_trans_flow.getInputStream();
InputStream jasper = upay_trans_flow.getInputStream();
byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource);
outs.write(bytes, 0, bytes.length); outs.write(bytes, 0, bytes.length);
outs.flush(); outs.flush();

@ -390,7 +390,7 @@
<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button" <ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="single-button"
style="min-width: 80px"> style="min-width: 80px">
<li><a target="_blank" ng-href="{{export('pdf')}}">Cross-border Payment PDF</a></li> <li><a target="_blank" ng-href="{{export('pdf')}}">Cross-border Payment PDF</a></li>
<!-- <li><a target="_blank" ng-href="{{export('upay-pdf')}}">Card Payment PDF</a></li>--> <li><a target="_blank" ng-href="{{export('upay-pdf')}}">Card Payment PDF</a></li>
<li><a target="_blank" ng-href="{{export('excel')}}">EXCEL</a></li> <li><a target="_blank" ng-href="{{export('excel')}}">EXCEL</a></li>
<li><a target="_blank" <li><a target="_blank"
ng-href="{{export('excel_detail')}}">EXCEL(Detail)</a></li> ng-href="{{export('excel_detail')}}">EXCEL(Detail)</a></li>

Loading…
Cancel
Save