|
|
|
@ -494,12 +494,14 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
|
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);
|
|
|
|
|
//增加货币判断
|
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
|
|
|
|
|
|
total = total.add(params.getBigDecimal("clearing_amount"));
|
|
|
|
|
total_surage = total_surage.add(params.getBigDecimal("total_surcharge")).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
royalpay_surage = royalpay_surage.add(params.getBigDecimal("clearing_amount").multiply(orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP));
|
|
|
|
|
total = total.add(tmpClearingAmount);
|
|
|
|
|
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
|
|
|
|
|
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
|
|
|
|
|
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
|
|
|
|
|
}
|
|
|
|
@ -535,12 +537,15 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
channel = "cb_bankpay";
|
|
|
|
|
}
|
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
|
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);
|
|
|
|
|
//增加货币判断
|
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
|
BigDecimal parent_surage = params.getBigDecimal("clearing_amount").multiply(parentOrgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
BigDecimal roy_surage = (params.getBigDecimal("clearing_amount").multiply(orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP));
|
|
|
|
|
total = total.add(params.getBigDecimal("clearing_amount"));
|
|
|
|
|
total_surage = total_surage.add(params.getBigDecimal("total_surcharge")).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);
|
|
|
|
|
BigDecimal roy_surage = tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
total = total.add(tmpClearingAmount);
|
|
|
|
|
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
royalpay_surage = royalpay_surage.add(roy_surage);
|
|
|
|
|
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
|
|
|
|
|
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
|
|
|
|
@ -569,7 +574,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
List<JSONObject> amountByChannel = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<String, List<JSONObject>> oneChannel : channelMap.entrySet()) {
|
|
|
|
|
JSONObject rate = merchantInfoProvider.clientCurrentRate(clientId, oneChannel.getValue().get(0).getDate("transaction_time"),oneChannel.getKey());
|
|
|
|
|
String recordId = "";
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey());
|
|
|
|
@ -590,6 +594,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (JSONObject params : oneChannel.getValue()) {
|
|
|
|
|
BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount").subtract(params.getBigDecimal("surcharge_cashback"));
|
|
|
|
|
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);
|
|
|
|
|
//增加货币判断
|
|
|
|
|
int i = currencyScale(params.getString("clearing_currency"));
|
|
|
|
|
if (total.compareTo(BigDecimal.ZERO)==0 ) {
|
|
|
|
@ -604,9 +611,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
total = total.add(params.getBigDecimal("clearing_amount"));
|
|
|
|
|
total_surage = total_surage.add(params.getBigDecimal("total_surcharge")).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
royalpay_surage = royalpay_surage.add(params.getBigDecimal("clearing_amount").multiply(orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)).setScale(i, RoundingMode.HALF_UP));
|
|
|
|
|
total = total.add(tmpClearingAmount);
|
|
|
|
|
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
|
|
|
|
|
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
|
|
|
|
|
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
|
|
|
|
|
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
|
|
|
|
|
}
|
|
|
|
|