Merge remote-tracking branch 'origin/master'

master
yixian 4 years ago
commit f83495ab86

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>2.3.57</version>
<version>2.3.58</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -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"))) {

@ -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<JSONObject> 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<JSONObject> settlementLogDetailList = new ArrayList<>();
try {
parmerters.put("logo", logo.getInputStream());
parmerters.put("org_logo", securepay_logo.getInputStream());
if (!clientOrderList.isEmpty()) {
List<Integer> 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);
}

@ -114,7 +114,7 @@ royalpay:
appkey: 43390d81e20c5191c278fbf4cd275be2
server:
port: 5000
port: 5555
settle:
abafile:

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Loading…
Cancel
Save