fix 合伙人提成支持CBBankPay

master
luoyang 6 years ago
parent 0f6267d783
commit 8c77b0d769

@ -481,8 +481,16 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
BigDecimal royalpay_surage = BigDecimal.ZERO;
JSONObject json = new JSONObject();
String channel = oneChannel.getKey();
if (orgInfo.get(channel.toLowerCase() + "_rate_value")==null) {
throw new ServerErrorException(orgInfo.get("org_id") + "组织未设置"+ channel + "渠道成本手续费");
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) {
channel = "cbbankpay";
if (orgInfo.get("cbbankpay_rate_value") == null) {
throw new ServerErrorException(orgInfo.getString("name") + "组织下" + "cbbankpay" + "成本手续费未设置");
}
}else {
if (orgInfo.get(channel.toLowerCase() + "_rate_value") == null) {
throw new ServerErrorException(orgInfo.getString("name") + "组织下" + oneChannel.getKey() + "成本手续费未设置");
}
}
for (JSONObject params : oneChannel.getValue()) {
@ -496,7 +504,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
}
BigDecimal org_charge = total_surage.subtract(royalpay_surage);
json.put("channel",channel);
json.put("channel",oneChannel.getKey());
json.put("gross_amount",total);
json.put("total_charge",total_surage);
json.put("net_charge",net_surage);
@ -523,6 +531,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
JSONObject json = new JSONObject();
String channel = oneChannel.getKey();
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) {
channel = "cbbankpay";
}
for (JSONObject params : oneChannel.getValue()) {
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
@ -537,7 +548,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
}
BigDecimal org_charge = total_surage.subtract(royalpay_surage);
json.put("channel",channel);
json.put("channel",oneChannel.getKey());
json.put("gross_amount",total);
json.put("total_charge",total_surage);
json.put("net_charge",net_surage);
@ -574,6 +585,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
Date dateto = new Date();
JSONObject json = new JSONObject();
String channel = oneChannel.getKey();
if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase())) {
channel = "cbbankpay";
}
for (JSONObject params : oneChannel.getValue()) {
//增加货币判断
@ -600,11 +614,11 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
if(channel.toLowerCase().equals("alipay_direct")){
channel = channel.replace("_", "");
}
json.put("channel",channel);
json.put("channel",oneChannel.getKey());
json.put("record_id",recordId);
json.put("client_id",clientId);
json.put("client_rate",rate.getBigDecimal("rate_value").setScale(2,RoundingMode.DOWN));
json.put("client_rate",oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
json.put("gross_amount",total);
json.put("total_charge",total_surage);
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));

@ -686,6 +686,7 @@
<select id="listTransactionForCityPartnerAgentCommissionByDate" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select t.org_id,
t.clearing_currency,
t.client_id,
t.channel,
t.surcharge_rate,

Loading…
Cancel
Save