Merge remote-tracking branch 'origin/master'

master
yixian 6 years ago
commit 763a2a9e93

@ -28,6 +28,8 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -79,6 +81,7 @@ public class BDPrizeServiceImpl implements BDPrizeService {
private static BigDecimal percent = new BigDecimal(100); private static BigDecimal percent = new BigDecimal(100);
private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"}; private static String[] channels = new String[]{"Wechat", "Alipay", "Bestpay", "jd", "AlipayOnline","hf"};
private static Logger logger = LoggerFactory.getLogger(BDPrizeServiceImpl.class);
@Override @Override
public void generateRecord(String month) { public void generateRecord(String month) {
@ -121,14 +124,16 @@ public class BDPrizeServiceImpl implements BDPrizeService {
List<JSONObject> trades = transactionMapper.listTransactionsForBDPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, channel); List<JSONObject> trades = transactionMapper.listTransactionsForBDPrize(now.get(Calendar.YEAR), now.get(Calendar.MONTH) + 1, channel);
List<Integer> clientsWithBDAway = clientBDMapper.clientsWithBDAway(); List<Integer> clientsWithBDAway = clientBDMapper.clientsWithBDAway();
List<JSONObject> rateConfig = getRateConfig(); List<JSONObject> rateConfig = getRateConfig();
BDPrizeCalculator calculator = new BDPrizeCalculatorDefaultImpl(trades, now.getTime()).clientBDMapper(clientBDMapper) BDPrizeCalculator calculator = new BDPrizeCalculatorDefaultImpl(trades, now.getTime()).clientBDMapper(clientBDMapper).transactionMapper(transactionMapper)
.clientsWithBDAwayDeterminor(new DefaultClientWithBDAwayDeterminor(clientsWithBDAway)).rateConfig(rateConfig); .clientsWithBDAwayDeterminor(new DefaultClientWithBDAwayDeterminor(clientsWithBDAway)).rateConfig(rateConfig);
calculator.calculate(); calculator.calculate();
List<JSONObject> report = calculator.getReport(); List<JSONObject> report = calculator.getReport(now.get(Calendar.YEAR),now.get(Calendar.MONTH) + 1);
logger.info("======calculator.report=========="+channel+"===="+report.toString());
for (JSONObject log : report) { for (JSONObject log : report) {
log.put("record_id", record.getString("record_id")); log.put("record_id", record.getString("record_id"));
log.put("channel", channel); log.put("channel", channel);
log.remove("prize_log_id"); log.remove("prize_log_id");
logger.info("=========financialBDPrizeLogMapper.save======="+log.toString());
financialBDPrizeLogMapper.save(log); financialBDPrizeLogMapper.save(log);
List<JSONObject> details = (List<JSONObject>) log.get("details"); List<JSONObject> details = (List<JSONObject>) log.get("details");
for (JSONObject detail : details) { for (JSONObject detail : details) {

@ -11,5 +11,5 @@ public interface BDPrizeCalculator {
void calculate(); void calculate();
List<JSONObject> getReport(); List<JSONObject> getReport(int year,int month);
} }

@ -9,16 +9,20 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import au.com.royalpay.payment.manage.bdprize.support.BDPrizeCalculator; import au.com.royalpay.payment.manage.bdprize.support.BDPrizeCalculator;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Created by yixian on 2017-02-08. * Created by yixian on 2017-02-08.
*/ */
public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator { public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
private static Logger logger = LoggerFactory.getLogger(BDPrizeCalculator.class);
private final List<JSONObject> tradeLogs; private final List<JSONObject> tradeLogs;
private final Date month; private final Date month;
private ClientBDMapper clientBDMapper; private ClientBDMapper clientBDMapper;
@ -27,6 +31,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
private Map<String, JSONObject> bdMap = new HashMap<>(); private Map<String, JSONObject> bdMap = new HashMap<>();
private Map<Integer, Map<Integer, List<JSONObject>>> rateConfigMap = new HashMap<>(); private Map<Integer, Map<Integer, List<JSONObject>>> rateConfigMap = new HashMap<>();
private Map<String, BigDecimal> bdTotalMap = new HashMap<>(); private Map<String, BigDecimal> bdTotalMap = new HashMap<>();
private TransactionMapper transactionMapper;
public BDPrizeCalculatorDefaultImpl(List<JSONObject> tradeLogs, Date month) { public BDPrizeCalculatorDefaultImpl(List<JSONObject> tradeLogs, Date month) {
this.tradeLogs = tradeLogs; this.tradeLogs = tradeLogs;
@ -38,6 +43,11 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
return this; return this;
} }
public BDPrizeCalculatorDefaultImpl transactionMapper(TransactionMapper transactionMapper) {
this.transactionMapper = transactionMapper;
return this;
}
public BDPrizeCalculatorDefaultImpl clientsWithBDAwayDeterminor(DefaultClientWithBDAwayDeterminor clientWithBDAwayDeterminor) { public BDPrizeCalculatorDefaultImpl clientsWithBDAwayDeterminor(DefaultClientWithBDAwayDeterminor clientWithBDAwayDeterminor) {
this.clientsWithBDAwayDeterminor = clientWithBDAwayDeterminor; this.clientsWithBDAwayDeterminor = clientWithBDAwayDeterminor;
return this; return this;
@ -47,15 +57,15 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
for (JSONObject rateCfgItem : rateConfig) { for (JSONObject rateCfgItem : rateConfig) {
int level = rateCfgItem.getIntValue("bd_level"); int level = rateCfgItem.getIntValue("bd_level");
int kpiRange = rateCfgItem.getIntValue("kpi_range"); int kpiRange = rateCfgItem.getIntValue("kpi_range");
Map<Integer, List<JSONObject>> rates = rateConfigMap.get(level); Map<Integer, List<JSONObject>> levelRates = rateConfigMap.get(level);
if (rates == null) { if (levelRates == null) {
rates = new HashMap<>(); levelRates = new HashMap<>();
rateConfigMap.put(level, rates); rateConfigMap.put(level, levelRates);
} }
List<JSONObject> rate = rates.get(kpiRange); List<JSONObject> rate = levelRates.get(kpiRange);
if (rate == null) { if (rate == null) {
rate = new ArrayList<>(); rate = new ArrayList<>();
rates.put(kpiRange, rate); levelRates.put(kpiRange, rate);
} }
rate.add(rateCfgItem); rate.add(rateCfgItem);
} }
@ -73,7 +83,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
} }
@Override @Override
public List<JSONObject> getReport() { public List<JSONObject> getReport(int year,int month1) {
List<JSONObject> report = new ArrayList<>(); List<JSONObject> report = new ArrayList<>();
for (Map.Entry<String, Map<String, JSONObject>> resultItem : results.entrySet()) { for (Map.Entry<String, Map<String, JSONObject>> resultItem : results.entrySet()) {
JSONObject log = new JSONObject(); JSONObject log = new JSONObject();
@ -86,15 +96,8 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
log.put("total_amount", 0); log.put("total_amount", 0);
log.put("total_prize", 0); log.put("total_prize", 0);
log.put("total_donation", 0); log.put("total_donation", 0);
BigDecimal totalAmount = log.getBigDecimal("total_amount"); BigDecimal totalAmount = transactionMapper.TotalAmountForBDPrize(year,month1,bd.getString("bd_id"));
List<JSONObject> details = new ArrayList<>(); List<JSONObject> details = new ArrayList<>();
for (Map.Entry<String, JSONObject> detail : resultItem.getValue().entrySet()) {
JSONObject detailItem = detail.getValue();
BigDecimal totalTransaction = detailItem.getBigDecimal("total_transaction");
BigDecimal coefficient = detailItem.getBigDecimal("coefficient");
BigDecimal realTransaction = totalTransaction.multiply(coefficient).setScale(2,BigDecimal.ROUND_DOWN);
totalAmount = totalAmount.add(realTransaction);
}
for (Map.Entry<String, JSONObject> detail : resultItem.getValue().entrySet()) { for (Map.Entry<String, JSONObject> detail : resultItem.getValue().entrySet()) {
JSONObject detailItem = detail.getValue(); JSONObject detailItem = detail.getValue();
int clientId = detailItem.getIntValue("client_id"); int clientId = detailItem.getIntValue("client_id");
@ -102,6 +105,7 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
BigDecimal totalTransaction = detailItem.getBigDecimal("total_transaction"); BigDecimal totalTransaction = detailItem.getBigDecimal("total_transaction");
BigDecimal coefficient = detailItem.getBigDecimal("coefficient"); BigDecimal coefficient = detailItem.getBigDecimal("coefficient");
int prizeLevel = getKpiPrizeLevel(totalAmount,log.getBigDecimal("kpi_amount")); int prizeLevel = getKpiPrizeLevel(totalAmount,log.getBigDecimal("kpi_amount"));
logger.debug("-------->bd kpi level:"+bd.getString("bd_name")+"---level:"+prizeLevel+",kpi:"+log.getBigDecimal("kpi_amount")+",trans:"+totalAmount+",client_id:"+clientId);
BigDecimal bdRate = getNewRate(bdLevel, prizeLevel, detailItem.getIntValue("client_source"), detailItem.getBigDecimal("rate_value")); BigDecimal bdRate = getNewRate(bdLevel, prizeLevel, detailItem.getIntValue("client_source"), detailItem.getBigDecimal("rate_value"));
BigDecimal prizeValue = totalTransaction.multiply(coefficient).multiply(bdRate).divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_DOWN); BigDecimal prizeValue = totalTransaction.multiply(coefficient).multiply(bdRate).divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_DOWN);
BigDecimal donation = BigDecimal.ZERO; BigDecimal donation = BigDecimal.ZERO;
@ -222,8 +226,8 @@ public class BDPrizeCalculatorDefaultImpl implements BDPrizeCalculator {
private BigDecimal getNewRate(int bdLevel, int kpiRange, int clientSource, BigDecimal clientRate) { private BigDecimal getNewRate(int bdLevel, int kpiRange, int clientSource, BigDecimal clientRate) {
BigDecimal prizeRate = BigDecimal.ZERO; BigDecimal prizeRate = BigDecimal.ZERO;
Map<Integer, List<JSONObject>> rates = rateConfigMap.get(bdLevel); Map<Integer, List<JSONObject>> levelRates = rateConfigMap.get(bdLevel);
List<JSONObject> rate = rates.get(kpiRange); List<JSONObject> rate = levelRates.get(kpiRange);
for (JSONObject rateCfg : rate) { for (JSONObject rateCfg : rate) {
if (rateCfg.getBigDecimal("rate_from").compareTo(clientRate) <= 0 && rateCfg.getBigDecimal("rate_to").compareTo(clientRate) >= 0) { if (rateCfg.getBigDecimal("rate_from").compareTo(clientRate) <= 0 && rateCfg.getBigDecimal("rate_to").compareTo(clientRate) >= 0) {
prizeRate= rateCfg.getBigDecimal("prize_rate"); prizeRate= rateCfg.getBigDecimal("prize_rate");

@ -32,10 +32,10 @@ public class EncourageMoneyController {
public JSONObject takeEncourageMoney(@PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser, public JSONObject takeEncourageMoney(@PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser,
@ModelAttribute(CommonConsts.ALIUSER) JSONObject aliuser) { @ModelAttribute(CommonConsts.ALIUSER) JSONObject aliuser) {
String user_id = ""; String user_id = "";
logger.info("problem order id:"+orderId+"--wxUser:"+wxUser+"--aliuser:"+aliuser);
if (wxUser == null) { if (wxUser == null) {
user_id = aliuser.getString("user_id"); user_id = aliuser.getString("user_id");
} else { } else {
logger.info("====wxUser==" + wxUser.toJSONString());
user_id = wxUser.getString("openid"); user_id = wxUser.getString("openid");
} }
if (StringUtils.isEmpty(user_id)) { if (StringUtils.isEmpty(user_id)) {
@ -81,4 +81,13 @@ public class EncourageMoneyController {
public ModelAndView merchantsPage() { public ModelAndView merchantsPage() {
return new ModelAndView("activity/encourage_money/merchants"); return new ModelAndView("activity/encourage_money/merchants");
} }
public static void main(String[] args) {
JSONObject asd = null;
JSONObject qwe = null;
System.out.println(asd);
System.out.println(qwe);
}
} }

@ -0,0 +1,9 @@
package au.com.royalpay.payment.manage.dev.core;
/**
* @author kira
* @date 2018/8/2
*/
public interface ManualService {
void clientPostpone();
}

@ -0,0 +1,95 @@
package au.com.royalpay.payment.manage.dev.core.impl;
import au.com.royalpay.payment.manage.dev.core.ManualService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
import au.com.royalpay.payment.manage.task.PostponeClientTask;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
/**
* @author kira
* @date 2018/8/2
*/
@Service
public class ManualServiceimpl implements ManualService {
Logger logger = LoggerFactory.getLogger(PostponeClientTask.class);
@Resource
private ClientRateMapper clientRateMapper;
@Resource
private ClientAccountMapper clientAccountMapper;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Resource
private ClientModifySupport clientModifySupport;
@Override
public void clientPostpone() {
logger.info("start doing client postpone");
synchronizedScheduler.executeProcess("manage_task:postPoneClient", 120_000, () -> {
Date now = new Date();
Date tomorrow = DateUtils.addDays(now, 1);
Date yearTomorrow = DateUtils.addYears(tomorrow, 1);
String expireDate = DateFormatUtils.format(yearTomorrow, "yyyy-MM-dd");
List<JSONObject> expiryClient = clientRateMapper.getAllExpiry(now);
if (CollectionUtils.isEmpty(expiryClient)) {
return;
}
Map<Integer, JSONObject> expiryClients = new HashMap<>();
expiryClient.forEach(p -> {
expiryClients.put(p.getInteger("client_id"), p);
});
expiryClients.values().forEach(p -> {
int client_id = p.getIntValue("client_id");
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id);
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null);
JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", p.getIntValue("client_id"));
int cleanDays = 1;
if (wechatRate.getInteger("clean_days") != null) {
cleanDays = wechatRate.getIntValue("clean_days");
} else {
cleanDays = wechatRate.getIntValue("c_clean_days");
}
int finalCleanDays = cleanDays;
clientRates.forEach(o -> {
JSONObject record = clientRateMapper.latestExpiryConfig(client_id, o.getString("rate_name"));
record.remove("client_rate_id");
record.put("active_time", now);
record.put("manager_id", 0);
record.put("expiry_time", yearTomorrow);
record.put("create_time", now);
record.put("update_time", now);
record.put("clean_days", finalCleanDays);
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
});
if(p.getBooleanValue("tax_in_surcharge")){
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null,p.getString("client_moniker"),"tax_in_surcharge",false));
}
});
});
logger.info("end doing client postpone");
}
}

@ -0,0 +1,26 @@
package au.com.royalpay.payment.manage.dev.web;
import au.com.royalpay.payment.manage.dev.core.ManualService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* Created by yixian on 2017-01-25.
*/
@RestController
@ManagerMapping(role = ManagerRole.DEVELOPER,value = "/dev/manual")
public class ManualController {
@Resource
private ManualService manualService;
@RequestMapping(method = RequestMethod.GET,value = "/client/postpone")
public void clientPostpone(){
manualService.clientPostpone();
}
}

@ -93,6 +93,8 @@ public interface TransactionMapper {
List<JSONObject> listTransactionsForBDPrize(@Param("year") int year, @Param("month") int month, @Param("channel") String channel); List<JSONObject> listTransactionsForBDPrize(@Param("year") int year, @Param("month") int month, @Param("channel") String channel);
BigDecimal TotalAmountForBDPrize(@Param("year") int year, @Param("month") int month, @Param("bd_id") String bd_id);
BigDecimal TotalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group); BigDecimal TotalAmountForBDLeaderPrize(@Param("year") int year, @Param("month") int month, @Param("bd_group") String bd_group);
BigDecimal TotalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month); BigDecimal TotalAmountForSydneyGMPrize(@Param("year") int year, @Param("month") int month);

@ -22,6 +22,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@ -111,6 +112,9 @@ public class PostponeClientTask {
JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id"));
try { try {
if(StringUtils.isEmpty(account.getString("wechat_openid"))){
return;
}
MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid")); MpWechatApi api = mpWechatApiProvider.getApiFromOpenId(account.getString("wechat_openid"));
if (api != null) { if (api != null) {
String templateId = api.getTemplateId("client-postpone"); String templateId = api.getTemplateId("client-postpone");

@ -502,23 +502,32 @@
ORDER BY trade_date ASC, o.client_id ASC ORDER BY trade_date ASC, o.client_id ASC
</select> </select>
<select id="TotalAmountForBDPrize" resultType="java.math.BigDecimal">
<![CDATA[
select sum(if(temp.transaction_type='Credit',temp.clearing_amount*d.proportion,-temp.clearing_amount*d.proportion))
total FROM
(SELECT l.client_id,l.clearing_amount,l.refund_id,l.transaction_type,o.create_time FROM pmt_transactions l
INNER JOIN pmt_orders o
ON o.order_id = l.order_id
and year(o.create_time) = #{year} AND month(o.create_time) = #{month}
where (l.transaction_type='Credit' or l.refund_id is not null)
) temp
INNER JOIN sys_client_bd d ON temp.client_id = d.client_id AND d.start_date <= temp.create_time and
d.is_valid = '1'
AND (d.end_date is null or d.end_date > temp.create_time)
and d.bd_id=#{bd_id}
]]>
</select>
<select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal">
SELECT SELECT
ifnull(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)),0) ifnull(sum(t.total),0)
total total
FROM pmt_transactions t FROM statistics_customer_order t
INNER JOIN pmt_orders o ON o.order_id = t.order_id INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1 WHERE year(t.date) = #{year} AND month(t.date) = #{month}
WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month} and t.client_id!=0
AND(
t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
)
AND(
o. STATUS =5
OR o. STATUS =6
OR o. STATUS =7
)
and t.client_id in and t.client_id in
(SELECT b.client_id FROM sys_client_bd b (SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -528,21 +537,12 @@
<select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
SELECT SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) ifnull(sum(t.total),0)
total total
FROM pmt_transactions t FROM statistics_customer_order t
INNER JOIN pmt_orders o ON o.order_id = t.order_id INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1 WHERE year(t.date) = #{year} AND month(t.date) = #{month}
WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month} and t.client_id!=0
AND(
t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
)
AND(
o. STATUS =5
OR o. STATUS =6
OR o. STATUS =7
)
and t.client_id in and t.client_id in
(SELECT b.client_id FROM sys_client_bd b (SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id

@ -120,7 +120,7 @@
<p class="form-control-static" ng-bind="order.customer_payment_amount|currency:order.currency+' '"></p> <p class="form-control-static" ng-bind="order.customer_payment_amount|currency:order.currency+' '"></p>
</div> </div>
</div> </div>
<div class="form-group" ng-if="order.status>=5"> <div class="form-group" ng-if="order.status>=5 && order.channel!='hf'">
<label class="control-label col-xs-3">Exchange Rate</label> <label class="control-label col-xs-3">Exchange Rate</label>
<div class="col-xs-9"> <div class="col-xs-9">
<p class="form-control-static" ng-bind="order.exchange_rate"></p> <p class="form-control-static" ng-bind="order.exchange_rate"></p>

@ -80,6 +80,19 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-4" ng-if="detail.AlipayOnlineDetail">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="AliOnline" src="/static/images/alipay_online.png">
</div>
<div class="info-box-content">
<h5>Transaction: ${{detail.AlipayOnlineDetail.total_amount}}</h5>
<h5>Commission: ${{detail.AlipayOnlineDetail.total_prize}}</h5>
<h5>Send: ${{detail.AlipayOnlineDetail.send_prize}}</h5>
<h5>Fund: ${{detail.AlipayOnlineDetail.total_donation}}</h5>
</div>
</div>
</div>
<div class="col-xs-4" ng-if="detail.BestpayDetail"> <div class="col-xs-4" ng-if="detail.BestpayDetail">
<div class="info-box" style="background: lightcyan"> <div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;"> <div class="info-box-icon" style=" background: bottom;">
@ -93,6 +106,32 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-4" ng-if="detail.jdDetail">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="JD" src="/static/images/jd_sign_lg.png">
</div>
<div class="info-box-content">
<h5>Transaction: ${{detail.jdDetail.total_amount}}</h5>
<h5>Commission: ${{detail.jdDetail.total_prize}}</h5>
<h5>Send: ${{detail.jdDetail.send_prize}}</h5>
<h5>Fund: ${{detail.jdDetail.total_donation}}</h5>
</div>
</div>
</div>
<div class="col-xs-4" ng-if="detail.hfDetail">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="HF" src="/static/images/hf_sign_lg.png">
</div>
<div class="info-box-content">
<h5>Transaction: ${{detail.hfDetail.total_amount}}</h5>
<h5>Commission: ${{detail.hfDetail.total_prize}}</h5>
<h5>Send: ${{detail.hfDetail.send_prize}}</h5>
<h5>Fund: ${{detail.hfDetail.total_donation}}</h5>
</div>
</div>
</div>
</div> </div>
<div class="box box-default" ng-if="!detail.no_record"> <div class="box box-default" ng-if="!detail.no_record">
<div class="box-header">Details<span class="text-danger">(Red Client Moniker means received from BD User who left company.)</span></div> <div class="box-header">Details<span class="text-danger">(Red Client Moniker means received from BD User who left company.)</span></div>
@ -131,7 +170,10 @@
<td> <td>
<img ng-if="log.channel=='Alipay'" uib-tooltip="Alipay" src="/static/images/alipay_sign_lg.png"> <img ng-if="log.channel=='Alipay'" uib-tooltip="Alipay" src="/static/images/alipay_sign_lg.png">
<img ng-if="log.channel=='Wechat'" uib-tooltip="Wechat" src="/static/images/wechatpay_sign_lg.png"> <img ng-if="log.channel=='Wechat'" uib-tooltip="Wechat" src="/static/images/wechatpay_sign_lg.png">
<img ng-if="log.channel=='AlipayOnline'" uib-tooltip="Bestpay" src="/static/images/alipay_online.png">
<img ng-if="log.channel=='Bestpay'" uib-tooltip="Bestpay" src="/static/images/bestpay_sign_lg.png"> <img ng-if="log.channel=='Bestpay'" uib-tooltip="Bestpay" src="/static/images/bestpay_sign_lg.png">
<img ng-if="log.channel=='jd'" uib-tooltip="Bestpay" src="/static/images/jd_sign_lg.png">
<img ng-if="log.channel=='hf'" uib-tooltip="Bestpay" src="/static/images/hf_sign_lg.png">
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -59,6 +59,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-4" ng-if="report.AlipayOnlineReport">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="AliOnline" src="/static/images/alipay_online.png">
</div>
<div class="info-box-content">
<h5>BD Total Commission: ${{report.AlipayOnlineReport.total_prize}}</h5>
<h5>BD Total Send: ${{report.AlipayOnlineReport.total_send_prize}}</h5>
<h5>BD Total Fund: ${{report.AlipayOnlineReport.total_donation}}</h5>
</div>
</div>
</div>
<div class="col-xs-4" ng-if="report.BestpayReport"> <div class="col-xs-4" ng-if="report.BestpayReport">
<div class="info-box" style="background: lightcyan"> <div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;"> <div class="info-box-icon" style=" background: bottom;">
@ -71,6 +83,30 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-4" ng-if="report.jdReport">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="JD" src="/static/images/jd_sign_lg.png">
</div>
<div class="info-box-content">
<h5>BD Total Commission: ${{report.jdReport.total_prize}}</h5>
<h5>BD Total Send: ${{report.jdReport.total_send_prize}}</h5>
<h5>BD Total Fund: ${{report.jdReport.total_donation}}</h5>
</div>
</div>
</div>
<div class="col-xs-4" ng-if="report.hfReport">
<div class="info-box" style="background: lightcyan">
<div class="info-box-icon" style=" background: bottom;">
<img uib-tooltip="HF" src="/static/images/hf_sign_lg.png">
</div>
<div class="info-box-content">
<h5>BD Total Commission: ${{report.hfReport.total_prize}}</h5>
<h5>BD Total Send: ${{report.hfReport.total_send_prize}}</h5>
<h5>BD Total Fund: ${{report.hfReport.total_donation}}</h5>
</div>
</div>
</div>
</div> </div>
<div class="box box-default"> <div class="box box-default">
<div class="box-header">BD Commission</div> <div class="box-header">BD Commission</div>

@ -211,7 +211,7 @@
<p ng-if="trade.trans_type=='clearing'"> <p ng-if="trade.trans_type=='clearing'">
- -
</p> </p>
<p ng-if="trade.trans_type !='clearing'"> <p ng-if="trade.trans_type !='clearing' && trade.channel!='hf'">
{{trade.exchange_rate}} {{trade.exchange_rate}}
</p> </p>
</td> </td>

@ -194,7 +194,9 @@
</td> </td>
<td ng-bind="trade.display_amount|currency:trade.currency"></td> <td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td> <td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td ng-bind="trade.exchange_rate"></td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span>
</td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>
<td ng-bind="trade.gateway|tradeGateway"></td> <td ng-bind="trade.gateway|tradeGateway"></td>

@ -98,7 +98,7 @@
</table> </table>
</div> </div>
</div> </div>
<div class="form-group" ng-if="order.status>=5"> <div class="form-group" ng-if="order.status>=5 && order.channel!='hf'">
<label class="control-label col-xs-3">Exchange Rate</label> <label class="control-label col-xs-3">Exchange Rate</label>
<div class="col-xs-9"> <div class="col-xs-9">
<p class="form-control-static" ng-bind="order.exchange_rate"></p> <p class="form-control-static" ng-bind="order.exchange_rate"></p>

@ -332,7 +332,9 @@
<td ng-bind="trade.display_amount|currency:trade.currency"></td> <td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td> <td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td ng-bind="trade.settle_amount|currency:'AUD '"></td> <td ng-bind="trade.settle_amount|currency:'AUD '"></td>
<td ng-bind="trade.exchange_rate"></td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span>
</td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>
<td ng-bind="trade.gateway|tradeGateway"></td> <td ng-bind="trade.gateway|tradeGateway"></td>

@ -360,7 +360,9 @@
</td> </td>
<td ng-bind="trade.display_amount|currency:trade.currency"></td> <td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td ng-bind="trade.clearing_amount|currency:'AUD'"></td> <td ng-bind="trade.clearing_amount|currency:'AUD'"></td>
<td ng-bind="trade.exchange_rate"></td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span>
</td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>
<td ng-bind="trade.gateway|tradeGateway"></td> <td ng-bind="trade.gateway|tradeGateway"></td>

@ -125,7 +125,9 @@
ng-click="showRefundLog(trade.order_id)">(-{{trade.refund_fee}})</a> ng-click="showRefundLog(trade.order_id)">(-{{trade.refund_fee}})</a>
</td> </td>
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td> <td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td ng-bind="trade.exchange_rate"></td> <td>
<span ng-if="trade.channel!='hf'" ng-bind="trade.exchange_rate"></span>
</td>
<td ng-bind="trade.status|tradeStatus"></td> <td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td> <td ng-bind="trade.create_time"></td>
<td ng-bind="trade.gateway|tradeGateway"></td> <td ng-bind="trade.gateway|tradeGateway"></td>

Loading…
Cancel
Save