|
|
@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.swing.plaf.basic.BasicScrollPaneUI;
|
|
|
|
import javax.swing.plaf.basic.BasicScrollPaneUI;
|
|
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
@ -499,9 +500,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount");
|
|
|
|
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
|
|
|
|
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 = tmpClearingAmount.multiply(params.getBigDecimal("surcharge_rate")).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
//增加货币判断
|
|
|
|
//增加货币判断
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
total = total.add(tmpClearingAmount);
|
|
|
|
total = total.add(tmpClearingAmount);
|
|
|
@ -542,9 +543,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
channel = "cb_bankpay";
|
|
|
|
channel = "cb_bankpay";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount");
|
|
|
|
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
|
|
|
|
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 = tmpClearingAmount.multiply(params.getBigDecimal("surcharge_rate")).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
//增加货币判断
|
|
|
|
//增加货币判断
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
BigDecimal parent_surage = tmpClearingAmount.multiply(parentOrgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
BigDecimal parent_surage = tmpClearingAmount.multiply(parentOrgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP);
|
|
|
@ -594,14 +595,21 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
Date dateto = new Date();
|
|
|
|
Date dateto = new Date();
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
String channel = oneChannel.getKey();
|
|
|
|
String channel = oneChannel.getKey();
|
|
|
|
|
|
|
|
String rateChannel = oneChannel.getKey();
|
|
|
|
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase()) || "lakalapay".equals(oneChannel.getKey().toLowerCase())) {
|
|
|
|
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase()) || "lakalapay".equals(oneChannel.getKey().toLowerCase())) {
|
|
|
|
channel = "cb_bankpay";
|
|
|
|
channel = "cb_bankpay";
|
|
|
|
|
|
|
|
rateChannel = "CB_BankPay";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject clientRate = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
clientRate = merchantInfoProvider.clientCurrentRate(clientId, oneChannel.getValue().get(0).getDate("transaction_time"),
|
|
|
|
|
|
|
|
rateChannel);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount");
|
|
|
|
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
|
|
|
|
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 = tmpClearingAmount.multiply(params.getBigDecimal("surcharge_rate")).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
//增加货币判断
|
|
|
|
//增加货币判断
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
if (total.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
if (total.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
@ -630,7 +638,11 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
|
|
|
|
|
|
|
json.put("record_id", recordId);
|
|
|
|
json.put("record_id", recordId);
|
|
|
|
json.put("client_id", clientId);
|
|
|
|
json.put("client_id", clientId);
|
|
|
|
json.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
|
|
|
|
if (clientRate != null) {
|
|
|
|
|
|
|
|
json.put("client_rate", clientRate.getBigDecimal("rate_value"));
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
json.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
|
|
|
|
|
|
|
|
}
|
|
|
|
json.put("gross_amount", total);
|
|
|
|
json.put("gross_amount", total);
|
|
|
|
json.put("total_charge", total_surage);
|
|
|
|
json.put("total_charge", total_surage);
|
|
|
|
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
|
|
|
|
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
|
|
|
|