fix 合伙人提成 减掉surcharge_cashback

master
luoyang 6 years ago
parent 1ad4c6ec52
commit 6db59b59d1

@ -494,12 +494,14 @@ 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 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")); int i = currencyScale(params.getString("clearing_currency"));
total = total.add(tmpClearingAmount);
total = total.add(params.getBigDecimal("clearing_amount")); total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
total_surage = total_surage.add(params.getBigDecimal("total_surcharge")).setScale(i, RoundingMode.HALF_UP); royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).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));
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge)); // net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
} }
@ -535,12 +537,15 @@ 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 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")); 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 parent_surage = tmpClearingAmount.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)); BigDecimal roy_surage = tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP);
total = total.add(params.getBigDecimal("clearing_amount")); total = total.add(tmpClearingAmount);
total_surage = total_surage.add(params.getBigDecimal("total_surcharge")).setScale(i, RoundingMode.HALF_UP); total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(roy_surage); 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(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
@ -569,7 +574,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
List<JSONObject> amountByChannel = new ArrayList<>(); List<JSONObject> amountByChannel = new ArrayList<>();
for (Map.Entry<String, List<JSONObject>> oneChannel : channelMap.entrySet()) { 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 = ""; String recordId = "";
if (type == 1) { if (type == 1) {
recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey()); 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()) { 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")); int i = currencyScale(params.getString("clearing_currency"));
if (total.compareTo(BigDecimal.ZERO)==0 ) { if (total.compareTo(BigDecimal.ZERO)==0 ) {
@ -604,9 +611,9 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
} }
} }
total = total.add(params.getBigDecimal("clearing_amount")); total = total.add(tmpClearingAmount);
total_surage = total_surage.add(params.getBigDecimal("total_surcharge")).setScale(i, RoundingMode.HALF_UP); total_surage = total_surage.add(tmpTotalSurcharge).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)); 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(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge")); net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
} }

@ -4716,7 +4716,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
paymentApi.sendTemplateMessage(msg); paymentApi.sendTemplateMessage(msg);
} catch (WechatException e) { } catch (WechatException e) {
logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e.getMessage()); logger.error("给{}发送微信消息失败,原因:{}", userOpenId, e.getMessage());
publisher.publishEvent(new WechatExceptionEvent(this, e, "测试商户密码修改完成"));
} catch (Exception e) { } catch (Exception e) {
logger.error("给{}发送密码重置消息失败,原因: {}", userOpenId, e.getMessage()); logger.error("给{}发送密码重置消息失败,原因: {}", userOpenId, e.getMessage());
} }

@ -684,13 +684,15 @@
if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount,
if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge, if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge,
if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge,
t.order_id t.order_id,
t.org_rate,
t.surcharge_cashback
from pmt_transactions t from pmt_transactions t
INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1
AND so.type = 0 AND so.type = 0
AND so.citypartner = 1 AND so.commission = 1 AND so.citypartner = 1 AND so.commission = 1
AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month} AND year(t.transaction_time) = #{year} AND month(t.transaction_time) = #{month}
AND t.channel != 'Settlement' AND t.channel != 'System' AND t.channel != 'Settlement' AND t.channel != 'System' AND t.system_generate = 0
ORDER BY t.client_id asc ORDER BY t.client_id asc
]]> ]]>
</select> </select>

Loading…
Cancel
Save