diff --git a/pom.xml b/pom.xml
index 0d662731f..ae1dcea8e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
4.0.0
manage
- 2.3.57
+ 2.3.58
UTF-8
2.4.0
diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java
index 0f4af53bc..73a23b485 100644
--- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java
+++ b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java
@@ -595,7 +595,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
if(StringUtils.equals(channel.toLowerCase() + "_rate_value","rpaypmt_card_rate_value")){
//rpaypmt_domestic_card
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
- BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
+ BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
+ .subtract(params.getBigDecimal("surcharge_cashback"))
+ .subtract(params.getBigDecimal("transaction_fee"));
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
@@ -637,7 +639,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
}else{
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
- BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
+ BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
+ .subtract(params.getBigDecimal("surcharge_cashback"))
+ .subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java
index e21d847ea..41c285409 100644
--- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java
+++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java
@@ -153,6 +153,10 @@ public class TradeLogServiceImpl implements TradeLogService {
private org.springframework.core.io.Resource austrac_report;
@Value("classpath:/jasper/partner_settlement_detail.jasper")
private org.springframework.core.io.Resource partner_settlement_flow;
+ @Value("classpath:/jasper/securepay_logo.png")
+ private org.springframework.core.io.Resource securepay_logo;
+ @Value("classpath:/jasper/securepay_settlement_detail.jasper")
+ private org.springframework.core.io.Resource securepay_settlement_flow;
@Override
public JSONObject listPartnerTradeLogs(JSONObject manager, JSONObject account, String shortId, TradeLogQuery query, String timezone) throws Exception {
@@ -1981,7 +1985,7 @@ public class TradeLogServiceImpl implements TradeLogService {
clientManager.queryModifyClientIds(client.getIntValue("client_id"), params);
List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
JSONObject parmerters = new JSONObject();
- parmerters.put("dateRange", "(Statement Period " + begin + "~"
+ parmerters.put("dateRange", "(Period " + begin + "~"
+ end + ")");
parmerters.put("clientName", client.getString("company_name"));
parmerters.put("clientAddress", client.getString("address"));
@@ -1989,43 +1993,45 @@ public class TradeLogServiceImpl implements TradeLogService {
List settlementLogDetailList = new ArrayList<>();
try {
parmerters.put("logo", logo.getInputStream());
+ parmerters.put("org_logo", securepay_logo.getInputStream());
if (!clientOrderList.isEmpty()) {
List clientOrders = new ArrayList<>(clientOrderList.size());
clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order")));
settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders);
TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Collections.singletonList("transaction_time"));
settlementLogDetailList.parallelStream().forEach(item -> {
- scaleDecimalVal(item, "display_amount", item.getString("transaction_currency"));
String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency();
scaleDecimalVal(item, "clearing_amount", platformCurrency);
scaleDecimalVal(item, "settle_amount", platformCurrency);
scaleDecimalVal(item, "total_surcharge", platformCurrency);
scaleDecimalVal(item, "transaction_amount", platformCurrency);
- item.put("exchange_rate", item.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN));
+ item.put("exchange_rate", item.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).stripTrailingZeros());
item.put("gateway", item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType());
- item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").toPlainString() + "%");
+ item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").stripTrailingZeros().toPlainString() + "%");
});
}
if (clientOrderList.size() <= 0) {
JSONObject mockJson = new JSONObject();
mockJson.put("order_id", "-");
+ mockJson.put("client_order_id", "-");
mockJson.put("transaction_time", "-");
mockJson.put("channel", "-");
mockJson.put("gateway", "-");
mockJson.put("exchange_rate", BigDecimal.ZERO);
mockJson.put("transaction_type", "-");
mockJson.put("transaction_currency", "-");
- mockJson.put("display_amount", BigDecimal.ZERO);
mockJson.put("settle_amount", BigDecimal.ZERO);
mockJson.put("remark", "");
mockJson.put("transaction_amount", BigDecimal.ZERO);
mockJson.put("total_surcharge", BigDecimal.ZERO);
mockJson.put("clearing_amount", BigDecimal.ZERO);
+ mockJson.put("transaction_fee", BigDecimal.ZERO);
+ mockJson.put("tax_amount", BigDecimal.ZERO);
mockJson.put("rate", BigDecimal.ZERO);
settlementLogDetailList.add(mockJson);
}
JRDataSource jrDataSource = new JRBeanCollectionDataSource(settlementLogDetailList);
- return JasperRunManager.runReportToPdf(partner_settlement_flow.getInputStream(), parmerters, jrDataSource);
+ return JasperRunManager.runReportToPdf(securepay_settlement_flow.getInputStream(), parmerters, jrDataSource);
} catch (Exception e) {
throw new ServerErrorException(e);
}
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 904c4779b..958b177d8 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -114,7 +114,7 @@ royalpay:
appkey: 43390d81e20c5191c278fbf4cd275be2
server:
- port: 5000
+ port: 5555
settle:
abafile:
diff --git a/src/main/resources/jasper/securepay_logo.png b/src/main/resources/jasper/securepay_logo.png
new file mode 100644
index 000000000..86f3892b9
Binary files /dev/null and b/src/main/resources/jasper/securepay_logo.png differ
diff --git a/src/main/resources/jasper/securepay_settlement_detail.jasper b/src/main/resources/jasper/securepay_settlement_detail.jasper
new file mode 100644
index 000000000..81d8c724f
Binary files /dev/null and b/src/main/resources/jasper/securepay_settlement_detail.jasper differ