diff --git a/pom.xml b/pom.xml index 6e23517f4..0726cc39d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 1.1.5 + 1.1.6 4.0.0 manage - 1.2.82 + 1.2.84 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java index e10baf602..57d95ccaf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java @@ -30,10 +30,14 @@ public interface OrderMapper { PageList listOrders(JSONObject params, PageBounds pagination); + PageList listIncrementalOrders(JSONObject params, PageBounds pagination); + List listOrdersNoPage(JSONObject params); PageList listOrdersByClients(JSONObject params, PageBounds pagination); + PageList listIncrementalOrdersByClients(JSONObject params, PageBounds pagination); + JSONObject analysisOrders(JSONObject params); JSONObject getOrderDetail(@Param("order_id") String orderId); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/SysClientIncrementalMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/SysClientIncrementalMapper.java new file mode 100644 index 000000000..4b1f2990d --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/SysClientIncrementalMapper.java @@ -0,0 +1,25 @@ +package au.com.royalpay.payment.manage.mappers.payment; + +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Created by liuxinxin on 2019-11-12. + */ +@AutoMapper(tablename = "sys_client_incremental", pkName = "incremental_id") +public interface SysClientIncrementalMapper { + + @Select("SELECT incremental_rate_value FROM sys_client_incremental WHERE channel = #{channel} AND client_id = #{client_id} ") + String findByChannelAndClientId(@Param("client_id") String clientId,@Param("channel") String channel); + + @AutoSql(type = SqlType.SELECT) + List find(@Param("client_id") String clientId); + + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java index 78894f1bc..9d16b9fcc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java @@ -40,6 +40,8 @@ public interface ClientFilesMapper { List findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name); + JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId); + void deleteByClientAndFileId(@Param("file_id") String file_id); void deleteAggreeByClientId(@Param("client_id") int file_id); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 10968500a..d8149786a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -242,6 +242,8 @@ public interface ClientManager { JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker); + JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker); + void deleteAuthFiles(String fileId); void deleteAuthFilesByAdmin(String fileId); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 676b9adb7..f6ea8af94 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -3357,6 +3357,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return fileJson; } + @Override + public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject sourceFile = clientFilesMapper.getSourceAgreeFilesByClientId(client.getIntValue("client_id")); + sourceFile.put(sourceFile.getString("file_name"), sourceFile.getString("file_value")); + return sourceFile; + } + @Override public JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -3386,7 +3397,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return fileJson; } - @Override public JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -3418,8 +3428,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } - ; - @Override public void deleteAuthFiles(String fileId) { JSONObject file = clientFilesMapper.findFileById(fileId); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 6e56ad12f..11ff648b1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -538,7 +538,7 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/file/source_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT}) public JSONObject getSourceAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getAuthFiles(manager, clientMoniker); + return clientManager.getSourceAgreeFiles(manager, clientMoniker); } @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index 0f11c4479..7d3458318 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -301,6 +301,12 @@ public class PartnerViewController { return tradeLogService.listPartnerTradeLogs(null, account, account.getString("client_moniker"), query, account.getJSONObject("client").getString("timezone")); } + @PartnerMapping(value = "/incremental_trade_logs", method = RequestMethod.GET) + @ResponseBody + public JSONObject listIncrementalTradeLogs(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, TradeLogQuery query) throws Exception { + return tradeLogService.listPartnerIncrementalTradeLogs(null, account, account.getString("client_moniker"), query, account.getJSONObject("client").getString("timezone")); + } + @PartnerMapping(value = "/trade_logs/{orderId}", method = RequestMethod.GET) @ResponseBody public JSONObject getOrderDetail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String orderId) { diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java index f2c40c9b2..7f11694ef 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java @@ -29,6 +29,7 @@ public class TradeLogQuery { private String datefrom; private String dateto; private int[] gateway; + private String source = "ALL" ; private OrderStatus status = OrderStatus.PAID; private PayChannel channel = PayChannel.ALL; private String[] client_ids; @@ -89,6 +90,8 @@ public class TradeLogQuery { if (client_ids != null) { params.put("client_ids", client_ids); } + + params.put("source", source); params.put("status", status.getStatus()); params.put("channel", channel.getChannels()); @@ -247,4 +250,12 @@ public class TradeLogQuery { public void setorg_id2(String org_id2) { this.org_id2 = org_id2; } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java index 53de695e5..c691ba40f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/TradeLogService.java @@ -14,8 +14,12 @@ import java.util.List; public interface TradeLogService { JSONObject listPartnerTradeLogs(JSONObject manager, JSONObject account, String clientMoniker, TradeLogQuery query, String timezone) throws Exception; + JSONObject listPartnerIncrementalTradeLogs(JSONObject manager, JSONObject account, String clientMoniker, TradeLogQuery query, String timezone) throws Exception; + JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager); + JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager); + List listOrderRefunds(String orderId, String timezone); void getOrderDetail(Model model, String clientMoniker, String orderId, String openid); diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index f728f5350..3fe129fdd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -112,6 +112,8 @@ public class TradeLogServiceImpl implements TradeLogService { @Resource private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; @Resource + private SysClientIncrementalMapper sysClientIncrementalMapper; + @Resource private ClientCustomersMapper clientCustomersMapper; @Resource private ClearingLogMapper clearingLogMapper; @@ -171,6 +173,45 @@ public class TradeLogServiceImpl implements TradeLogService { return result; } + @Override + public JSONObject listPartnerIncrementalTradeLogs(JSONObject manager, JSONObject account, String shortId, TradeLogQuery query, String timezone) throws Exception { + JSONObject client = clientManager.getClientInfoByMoniker(shortId); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + JSONObject params = query.toParams(timezone); + clientManager.validateClients(client.getIntValue("client_id"), params); + params.put("client_id", client.getIntValue("client_id")); + if (manager != null && manager.getInteger("org_id") != null) { + params.put("org_id", manager.getIntValue("org_id")); + } + if(query.getGatewayChild()!=null){ + params.put("trade_type",new ArrayList(){{add(query.getGatewayChild());}}); + } + PageList logs = orderMapper.listIncrementalOrdersByClients(params, + new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); + if (timezone != null) { + TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time"); + } + if (account != null) { + PartnerRole role = PartnerRole.getRole(account.getIntValue("role")); + if (role == PartnerRole.MANAGER || role == PartnerRole.ADMIN) { + for (JSONObject log : logs) { + log.put("audition", !refundAuditionMapper.listAuditingRefundsOfOrder(log.getString("order_id")).isEmpty()); + } + } + } + for (JSONObject log : logs) { + log.put("rate_value",sysClientIncrementalMapper.findByChannelAndClientId(log.getString("client_id"),log.getString("source"))); + } + JSONObject result = PageListUtils.buildPageListResult(logs); + JSONObject analysis = orderMapper.analysisOrders(params); + result.put("analysis", analysis); + return result; + } + + @Override public JSONObject listAllTradeLogs(TradeLogQuery query, JSONObject manager) { JSONObject params = query.toParams(null); @@ -195,6 +236,33 @@ public class TradeLogServiceImpl implements TradeLogService { return result; } + @Override + public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager) { + JSONObject params = query.toParams(null); + if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) { + params.put("bd_user", manager.getString("manager_id")); + } + if (query.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { + params.remove("bd_user"); + params.put("bd_group", manager.getString("manager_id")); + if (query.getGroup_bd() > 0) { + params.put("bd_group_bd", query.getGroup_bd()); + } + } + orgManager.checkOrgIds(manager, params); + if(query.getGatewayChild()!=null){ + params.put("trade_type",new ArrayList(){{add(query.getGatewayChild());}}); + } + PageList logs = orderMapper.listIncrementalOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); + for (JSONObject log : logs) { + log.put("rate_value",sysClientIncrementalMapper.findByChannelAndClientId(log.getString("client_id"),log.getString("source"))); + } + JSONObject result = PageListUtils.buildPageListResult(logs); + JSONObject analysis = orderMapper.analysisOrders(params); + result.put("analysis", analysis); + return result; + } + @Override public List listOrderRefunds(String orderId, String timezone) { diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java index 68337775e..f81569efb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/web/ManageTradelogController.java @@ -34,6 +34,13 @@ public class ManageTradelogController { return tradeLogService.listAllTradeLogs(query, manager); } + @RequestMapping(value = "/incremental",method = RequestMethod.GET) + @ReadOnlyConnection + @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) + public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return tradeLogService.listAllIncrementalTradeLogs(query, manager); + } + @ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) @ReadOnlyConnection @RequirePartner diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index 0105fe750..43ec6db95 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -23,6 +23,7 @@ p.short_name, o.refund_amount refund_fee, o.customer_id, + o.source, sum(t.clearing_amount) clearing_amount, t.refund_id, t.transaction_time, @@ -30,7 +31,11 @@ t.transaction_id, t.exchange_rate, t.clearing_status, - t.settle_amount + t.settle_amount, + t.incremental_surcharge, + t.total_surcharge, + t.tax_amount, + t.surcharge_rate SELECT @@ -42,6 +47,7 @@ o.create_time, o.confirm_time pay_time, o.pre_authorization, + o.source, CASE o.status WHEN 0 THEN 'SUBMITTING' @@ -149,7 +155,148 @@ select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount, oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency, oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail, - oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id + oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id,oo.source + from pmt_orders oo + + + + + AND oo.order_detail LIKE #{name_pattern} + + + AND oo.channel = #{search_text} + + + AND oo.order_id = #{search_text} + + + + AND oo.order_id = #{order_id} + + + AND oo.gateway IN + + #{gateway} + + + + AND oo.create_time >= #{from} + + + AND oo.create_time < #{to} + + + AND oo.transaction_date = DATE(#{date}) + + + AND oo.dev_id = #{dev_id} + + + AND + + oo.status = #{std} + + + + AND + + oo.channel = #{chan} + + + + AND + oo.source = #{source} + + + ) o + INNER JOIN sys_clients p + ON p.client_id = o.client_id + AND p.is_valid = 1 + + AND p.client_id IN + + #{client_id} + + + + AND p.client_id = #{client_id} + + LEFT JOIN pmt_transactions t + ON t.order_id = o.order_id + AND t.refund_id IS NULL + AND t.transaction_type = 'Credit' + + + + + AND ( + p.client_moniker = #{search_text} + OR p.short_name LIKE #{name_pattern} + OR o.order_detail LIKE #{name_pattern} + OR t.system_transaction_id = #{search_text} + OR o.channel = #{search_text} + OR o.order_id = #{search_text} + ) + + + AND p.client_moniker = #{search_text} + + + AND p.short_name LIKE #{name_pattern} + + + AND t.system_transaction_id = #{search_text} + + + + AND p.org_id = #{org_id} + + + AND p.org_id IN + + #{org_id} + + + + + AND p.client_id IN( + SELECT distinct b.client_id + FROM sys_client_bd b + INNER JOIN financial_bd_config c + ON c.manager_id = b.bd_id + WHERE b.is_valid = 1 + AND b.start_date <= now() + AND (b.end_date is null or b.end_date >= now()) + AND (c.bd_group = #{bd_group} or c.manager_id = #{bd_group}) + + AND c.manager_id = #{bd_group_bd} + + ) + + + AND p.client_id in(select distinct d.client_id + from sys_client_bd d + where d.bd_id = #{bd_user} + AND d.is_valid = 1 + AND DATE(d.start_date) <= curdate() + AND (d.end_date IS NULL OR DATE(d.end_date) >= curdate())) + + + GROUP BY o.order_id + + + + + + @@ -396,6 +585,8 @@ count(DISTINCT l.client_id) clients, ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY',l.display_amount,0)),0) display_amount, + ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY',l.incremental_surcharge,0)),0) + incremental_surcharge, ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY' and l.pre_authorization=1,l.display_amount,0)),0) pre_display_amount, ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency='CNY',l.display_amount,0)),0) @@ -475,6 +666,10 @@ o.channel=#{chan} + + and + o.source=#{source} + and p.client_id in (SELECT b.client_id FROM sys_client_bd b INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 99175a97a..b12b9714b 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -96,7 +96,7 @@ + + + + + + + + + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + +
+
+ +
+

+ All | + Wechat Pay | + Alipay | + AlipayOnline + | + BestPay | + JD Pay | + HF Pay | + RPay + | + Yeepay | + LakalaPay +

+
+
+
+ +
+
+
+ +
+ ~ +
+ +
+ +
+ Today +
+
+ Yesterday +
+ + + +
+ +
+
+ +
+

+ All + +

+
+
+ +
+ + + + + + +
+
+
+
+
+ +
+ Transaction Amount + + ( {{analysis.order_count}} Orders ) +
+
+
+
+
+ +
+ Input Amount + + ( {{analysis.pre_display_amount | currency:'pre authorization '}} ) +
+
+
+
+
+ +
+ Input Amount + + + ( {{analysis.pre_display_amount | currency:'pre authorization '}} ) + + + + ( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} ) + +
+
+
+
+
+ +
+ Refund Amount + + + ({{analysis.pre_refund_fee|currency:'pre authorization '}}) + +
+
+
+
+
+ +
+ Merchants + + +
+
+
+
+
+ +
+ Incremental Surcharge + +
+
+
+
+
+
+
+
+

Trade Orders + Pre Authorization: +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PartnerOrder IDAmountInput AmountSystem RateSystem ProfitYangMaTou RateYangMaTou ProfitStatusCreate TimeOperation
+ + {{trade.short_name}}({{trade.client_moniker}}) + + + + + + + + + + + + + + + {{trade.order_id}} + + {{trade.total_amount|currency:trade.currency}} + (-{{trade.refund_fee}}) + {{(trade.surcharge_rate * 100 - trade.rate_value)| number : 2}}%{{(trade.total_surcharge-trade.incremental_surcharge) | number : 2 | currency:trade.currency}}{{trade.source}}:{{(trade.rate_value) | number : 2}}%{{trade.source}}:{{trade.incremental_surcharge | currency:trade.currency}} + + + +
+ +
+
+ +
+
Total Records:{{pagination.totalCount}};Total + Pages:{{pagination.totalPages}} +
+
+
+
+ + + + diff --git a/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html new file mode 100644 index 000000000..ac8b711f6 --- /dev/null +++ b/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html @@ -0,0 +1,387 @@ + +
+

Incremental Orders

+ +
+
+
+

{{order.display_amount|currency:order.currency+' '}} Paid + Success!

+

Pay Time:{{order.pay_time_local}}

+
+
+
+
+
+
+
+
+
+ +
+ + +
+
+ +
+

+ All | + Wechat Pay | + Alipay | + AlipayOnline | + BestPay | + JD Pay | + HF Pay | + RPay+ | + Yeepay | + LakalaPay +

+
+
+
+ +
+
+
+ +
+ ~ +
+ +
+ +
+ Today +
+
+ Yesterday +
+ + + +
+ +
+ +
+
+ +
+

+ All + +

+
+
+
+ +
+

+ All + +

+
+
+ +
+
+
+
+
+
+
+
+
+
+ +
+ Transaction Amount + + ( {{analysis.order_count}} Orders ) +
+
+
+ +
+
+ +
+ Input Amount + + ( {{analysis.pre_display_amount | currency:'pre authorization '}} ) +
+
+
+
+
+ +
+ Input Amount + + + ( {{analysis.pre_display_amount | currency:'pre authorization '}} ) + + + + ( {{analysis.pre_cny_display_amount | currency:'pre authorization '}} ) + +
+
+
+
+
+ +
+ Refund Amount + + + ({{analysis.pre_refund_fee|currency:'pre authorization '}}) + +
+
+
+
+
+ +
+ Incremental Surcharge + + +
+
+
+
+
+
+
+
+

Orders

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Client Order IDOrder IDAmountInput AmountSystem RateSystem ProfitIncremental RateIncremental ProfitStatusCreate TimeOperation
+ + + + + + + BestPay + Alipay + AlipayOnline + + + + + + {{trade.order_id}} + + {{trade.total_amount|currency:trade.currency+' '}} + (-{{trade.refund_fee}}) + {{(trade.surcharge_rate * 100 - trade.rate_value)| number : 2}}%{{(trade.total_surcharge-trade.incremental_surcharge) | number : 2 | currency:trade.currency}}{{trade.source}}:{{(trade.rate_value) | number : 2}}%{{trade.source}}:{{trade.incremental_surcharge | currency:trade.currency}}{{0.00 | currency:trade.currency}} + + + + +
+ +
+ +
+
+
+
+
diff --git a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html index 8b1c3f72b..ad16da97c 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html @@ -109,6 +109,19 @@ ng-model="params.searchText"> +
+ +
+

+ All | + System | + YangMaTou +

+
+
@@ -406,6 +419,8 @@ + + BestPay @@ -416,7 +431,7 @@ - {{trade.order_id}} + {{trade.order_id}} {{trade.total_amount|currency:trade.currency+' '}} diff --git a/src/main/ui/static/payment/tradelog/templates/trade_logs.html b/src/main/ui/static/payment/tradelog/templates/trade_logs.html index 5b33d2b14..77b3ec4f9 100644 --- a/src/main/ui/static/payment/tradelog/templates/trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/trade_logs.html @@ -142,6 +142,19 @@
--> +
+ +
+

+ All | + System | + YangMaTou +

+
+
@@ -449,6 +462,10 @@ + + - {{trade.order_id}} + {{trade.order_id}} {{trade.total_amount|currency:trade.currency}} diff --git a/src/main/ui/static/payment/tradelog/tradelog-manage.js b/src/main/ui/static/payment/tradelog/tradelog-manage.js index 77b5e54e7..7cbde9a45 100644 --- a/src/main/ui/static/payment/tradelog/tradelog-manage.js +++ b/src/main/ui/static/payment/tradelog/tradelog-manage.js @@ -13,11 +13,15 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { url: '/refundReview', templateUrl: '/static/payment/tradelog/templates/refund_review.html', controller: 'refundReviewCtrl' + }).state('incremental_trade', { + url: '/incrementalTrade', + templateUrl: '/static/payment/tradelog/templates/incremental_trade_logs.html', + controller: 'globalIncrementalTradeLogCtrl' }) }]); - app.controller('globalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService', - function ($scope, $http, $filter, commonDialog, refunder, orderService) { - $scope.params = {status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'}; + app.controller('globalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService','$sce', + function ($scope, $http, $filter, commonDialog, refunder, orderService,$sce) { + $scope.params = {source: 'ALL',status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'}; $scope.pagination = {}; $scope.today = new Date(); @@ -127,6 +131,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } $http.get('/sys/trade_logs', {params: params}).then(function (resp) { $scope.tradeLogs = resp.data.data; + $scope.htmlToolst(); $scope.pagination = resp.data.pagination; $scope.analysis = resp.data.analysis; $scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee)); @@ -167,6 +172,30 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.$on('order_refunded', function () { $scope.loadTradeLogs(); }); + + $scope.htmlToolst = function(){ + for(var i=0;i< $scope.tradeLogs.length;i++){ + var tax_amount = $scope.tradeLogs[i].tax_amount; + var total_surcharge= $scope.tradeLogs[i].total_surcharge; + var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge; + var total_amount = $scope.tradeLogs[i].total_amount; + var display_amount = $scope.tradeLogs[i].display_amount; + var source = $scope.tradeLogs[i].source; + var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2); + var tip = '
' + + '
手续费组成
'+'
'+ + '

system:'+ system_surcharge +'

' + + '

'+ source +':'+incremental_surcharge +'

'; + if(total_surcharge < (total_amount-display_amount).toFixed(2)){ + tip = tip +'

tax amount:'+ tax_amount +'

'; + } + tip = tip + '
'; + $scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip); + } + } + + + } ]); app.controller('refundReviewCtrl', ['$rootScope', '$scope', '$http', '$state', '$filter', '$uibModal', 'commonDialog', 'orderService', @@ -295,6 +324,134 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { }); }; }]); + app.controller('globalIncrementalTradeLogCtrl', ['$scope', '$http', '$filter', 'commonDialog', 'refunder', 'orderService','$sce', + function ($scope, $http, $filter, commonDialog, refunder, orderService,$sce) { + $scope.params = {source: 'yangmatou',status: 'PAID',channel:'ALL', textType: 'all', datefrom: new Date(), dateto: new Date(),org_name:'ALL'}; + $scope.pagination = {}; + $scope.today = new Date(); + + if (($scope.currentUser.role & parseInt('1000000000', 2)) > 0 && $scope.currentUser.org_id) { + $http.get('/sys/manager_accounts/group/group_bds').then(function (resp) { + $scope.bd_group_bds = resp.data; + $scope.chooseBD('all'); + }); + } + $scope.chooseBD = function (groupBD) { + $scope.params.onlyGroup=true; + if (groupBD == 'all') { + $scope.isAll = true; + $scope.chooseBDId=''; + delete $scope.params.group_bd; + } else { + $scope.chooseBDId=groupBD; + $scope.params.group_bd = groupBD; + $scope.isAll = false; + } + $scope.loadTradeLogs(); + }; + + $scope.chooseToday = function () { + $scope.params.datefrom = $scope.params.dateto = new Date(); + $scope.loadTradeLogs(1); + }; + $scope.chooseYesterday = function () { + var yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + $scope.params.datefrom = $scope.params.dateto = yesterday; + $scope.loadTradeLogs(1); + }; + $scope.chooseLast7Days = function () { + $scope.params.dateto = new Date(); + var day = new Date(); + day.setDate(day.getDate() - 7); + $scope.params.datefrom = day; + $scope.loadTradeLogs(1); + }; + $scope.thisMonth = function () { + $scope.params.dateto = new Date(); + var monthBegin = new Date(); + monthBegin.setDate(1); + $scope.params.datefrom = monthBegin; + $scope.loadTradeLogs(1); + }; + $scope.lastMonth = function () { + var monthFinish = new Date(); + monthFinish.setDate(0); + $scope.params.dateto = monthFinish; + var monthBegin = new Date(); + monthBegin.setDate(0); + monthBegin.setDate(1); + $scope.params.datefrom = monthBegin; + $scope.loadTradeLogs(1); + }; + if (($scope.currentUser.role & parseInt('1000011', 2)) > 0 && !$scope.currentUser.org_id) { + $scope.org2 = "ALL" + $http.get('/sys/orgs', {params: {}}).then(function (resp) { + $scope.orgs = resp.data; + }); + } + + $scope.loadOrgs = function () { + var params = angular.copy($scope.params); + $http.get('/sys/orgs/orgChild',{params: params}).then(function (resp) { + $scope.orgs_child = resp.data; + }) + }; + if(($scope.currentUser.role & parseInt('1000000000000', 2)) > 0 && ($scope.currentUser.org_id != null)){ + $scope.org2 = "ALL Organizations" + $scope.loadOrgs(); + } + + $scope.loadTradeLogs = function (page) { + var params = angular.copy($scope.params); + if (params.datefrom) { + params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); + } + if (params.dateto) { + params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); + } + params.page = page || $scope.pagination.page || 1; + if(params.gateway){ + if((params.gateway.sort().toString()!=[0,1].toString()) && (params.gateway.sort().toString()!=[5,6].toString())){ + delete params.gatewayChilds; + delete params.gatewayChild; + } + if(params.gatewayChilds){ + var exist = false + params.gatewayChilds.forEach(function (child) { + if(child==params.gatewayChild){ + exist = true + } + }) + if(!exist){ + params.gatewayChild = null + } + }else{ + delete params.gatewayChild; + } + }else{ + delete params.gatewayChilds; + delete params.gatewayChild; + } + $http.get('/sys/trade_logs/incremental', {params: params}).then(function (resp) { + $scope.tradeLogs = resp.data.data; + $scope.pagination = resp.data.pagination; + $scope.analysis = resp.data.analysis; + $scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee)); + }); + }; + + $scope.showTradeDetail = function (order) { + orderService.managerOrderDetail(order) + }; + $scope.loadTradeLogs(1); + + $scope.$on('order_refunded', function () { + $scope.loadTradeLogs(); + }); + + } + ]); return app; }); diff --git a/src/main/ui/static/payment/tradelog/tradelog.js b/src/main/ui/static/payment/tradelog/tradelog.js index 710c2c71a..2fc4d2fd8 100644 --- a/src/main/ui/static/payment/tradelog/tradelog.js +++ b/src/main/ui/static/payment/tradelog/tradelog.js @@ -10,11 +10,15 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { url: '/trade', templateUrl: '/static/payment/tradelog/templates/partner_trade_logs.html', controller: 'tradeLogCtrl' + }).state('incremental_trade', { + url: '/IncrementalTrade', + templateUrl: '/static/payment/tradelog/templates/partner_incremental_trade_logs.html', + controller: 'IncrementalTradeLogCtrl' }) }]); - app.controller('tradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog', - function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog) { - $scope.params = {status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()}; + app.controller('tradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog','$sce', + function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog,$sce) { + $scope.params = {source: 'ALL',status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()}; $scope.pagination = {}; $scope.today = new Date(); $scope.isAll = true; @@ -92,12 +96,49 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } $http.get('/client/partner_info/trade_logs', {params: params}).then(function (resp) { $scope.tradeLogs = resp.data.data; + $scope.htmlToolst(); $scope.pagination = resp.data.pagination; $scope.analysis = resp.data.analysis; $scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee)); }); }; + /*$scope.htmlToolst = function(){ + for(var i=0;i< $scope.tradeLogs.length;i++){ + var tax_amount = $scope.tradeLogs[i].tax_amount; + var total_surcharge= $scope.tradeLogs[i].total_surcharge; + var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge; + var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2); + $scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml('
' + + '
手续费组成
'+'
'+ + '

system:'+ system_surcharge +'

' + + '

yangmatou:'+ incremental_surcharge +'

' + + '

tax amount:'+ tax_amount +'

' + + '
'); + } + };*/ + + $scope.htmlToolst = function(){ + for(var i=0;i< $scope.tradeLogs.length;i++){ + var tax_amount = $scope.tradeLogs[i].tax_amount; + var total_surcharge= $scope.tradeLogs[i].total_surcharge; + var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge; + var total_amount = $scope.tradeLogs[i].total_amount; + var display_amount = $scope.tradeLogs[i].display_amount; + var source = $scope.tradeLogs[i].source; + var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2); + var tip = '
' + + '
手续费组成
'+'
'+ + '

system:'+ system_surcharge +'

' + + '

'+ source +':'+incremental_surcharge +'

'; + if(total_surcharge < (total_amount-display_amount).toFixed(2)){ + tip = tip +'

tax amount:'+ tax_amount +'

'; + } + tip = tip + '
'; + $scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip); + } + } + $scope.gatewaySelected = function (arr) { return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) { return arr.indexOf(gateway) >= 0 @@ -254,5 +295,221 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { } }]); + app.controller('IncrementalTradeLogCtrl', ['$scope', '$http', '$filter', '$timeout', 'partnerRefunder', 'orderService', 'commonDialog', + function ($scope, $http, $filter, $timeout, partnerRefunder, orderService, commonDialog) { + $scope.params = {source: 'yangmatou',status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()}; + $scope.pagination = {}; + $scope.today = new Date(); + $scope.isAll = true; + $scope.isLevel3All = true; + $scope.device_isAll = true; + $scope.dev_params = {client_type:'sunmi',limit:100}; + $scope.clients = [$scope.currentUser.client]; + $scope.showLevel3Clients = false; + + + $scope.chooseToday = function () { + $scope.params.datefrom = $scope.params.dateto = new Date(); + $scope.loadTradeLogs(1); + }; + $scope.chooseYesterday = function () { + var yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + $scope.params.datefrom = $scope.params.dateto = yesterday; + $scope.loadTradeLogs(1); + }; + $scope.chooseLast7Days = function () { + $scope.params.dateto = new Date(); + var day = new Date(); + day.setDate(day.getDate() - 7); + $scope.params.datefrom = day; + $scope.loadTradeLogs(1); + }; + $scope.thisMonth = function () { + $scope.params.dateto = new Date(); + var monthBegin = new Date(); + monthBegin.setDate(1); + $scope.params.datefrom = monthBegin; + $scope.loadTradeLogs(1); + }; + $scope.lastMonth = function () { + var monthFinish = new Date(); + monthFinish.setDate(0); + $scope.params.dateto = monthFinish; + var monthBegin = new Date(); + monthBegin.setDate(0); + monthBegin.setDate(1); + $scope.params.datefrom = monthBegin; + $scope.loadTradeLogs(1); + }; + $scope.loadTradeLogs = function (page) { + var params = angular.copy($scope.params); + if (params.datefrom) { + params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); + } + if (params.dateto) { + params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); + } + params.page = page || $scope.pagination.page || 1; + $http.get('/client/partner_info/incremental_trade_logs', {params: params}).then(function (resp) { + $scope.tradeLogs = resp.data.data; + $scope.pagination = resp.data.pagination; + $scope.analysis = resp.data.analysis; + $scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee)); + }); + }; + + $scope.gatewaySelected = function (arr) { + return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) { + return arr.indexOf(gateway) >= 0 + }).length > 0 + }; + $scope.showTradeDetail = function (order) { + orderService.clientOrderDetail(order) + }; + $scope.showPRefundLog = function (orderId) { + partnerRefunder.prefunded(orderId); + }; + $scope.newPRefund = function (orderId) { + partnerRefunder.prefund(orderId).then(function () { + $scope.loadTradeLogs(); + }); + }; + $scope.releasePreAuth = function (orderId) { + commonDialog.confirm({ + title: 'Pre Authorization Completion', + content: 'This bill will be taken into settlement, or you will be able to make a refund order. Are you sure?' + }).then(function () { + $http.put('/client/partner_info/trade_logs/' + orderId + '/release_preauth').then(function (resp) { + $scope.loadTradeLogs(); + }, function (resp) { + commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'}) + }) + }) + }; + $scope.alerts = []; + $scope.$on('pe_order_paid', function (evt, order) { + $scope.alerts.push(order); + $timeout(function () { + $scope.alerts.splice(0, 1); + }, 10000); + $scope.loadTradeLogs(); + }); + $scope.chooseClient = function (client) { + if (client == 'all') { + $scope.params.client_ids = angular.copy($scope.clientIds); + $scope.isAll = true; + $scope.chooseClientId = ''; + $scope.dev_params.client_ids = angular.copy($scope.clientIds); + $scope.showLevel3Clients = false; + $scope.listDevices(); + } else if (client.level3Clients) { + $scope.chooseClientId = client.client_id; + $scope.showLevel3Clients = true; + $scope.level3Clients = client.level3Clients; + $scope.isAll = false; + $scope.level3ClientIds = []; + $scope.level3ClientIds.push(client.client_id); + client.level3Clients.forEach(function (client) { + $scope.level3ClientIds.push(client.client_id); + }); + $scope.chooseLevel3Client("all"); + return; + } else { + $scope.chooseClientId = client.client_id; + $scope.params.client_ids = [client.client_id]; + $scope.isAll = false; + $scope.dev_params.client_ids = [client.client_id]; + $scope.showLevel3Clients = false; + $scope.listDevices(); + } + $scope.loadTradeLogs(); + }; + + $scope.chooseLevel3Client = function (client) { + if (client == 'all') { + $scope.params.client_ids = angular.copy($scope.level3ClientIds); + $scope.isLevel3All = true; + $scope.chooseLevel3ClientId = ''; + $scope.dev_params.client_ids = angular.copy($scope.level3ClientIds); + $scope.listDevices(); + } else { + $scope.chooseLevel3ClientId = client.client_id; + $scope.params.client_ids = [client.client_id]; + $scope.isLevel3All = false; + $scope.dev_params.client_ids = [client.client_id]; + $scope.listDevices(); + } + $scope.loadTradeLogs(); + }; + + $scope.listDevices = function () { + var params = angular.copy($scope.dev_params) + $http.get('/client/partner_info/devices', {params: params}).then(function (resp) { + $scope.devices = resp.data.data; + }) + }; + $scope.chooseDevices = function (dev_id) { + if(dev_id == 'all'){ + $scope.chooseDevice_id = ''; + $scope.params.dev_id = null; + $scope.device_isAll = true; + $scope.loadTradeLogs(1); + }else { + $scope.chooseDevice_id = dev_id; + $scope.params.dev_id = dev_id; + $scope.device_isAll = false; + $scope.loadTradeLogs(1); + } + }; + $scope.listDevices(); + + if ($scope.currentUser.client.has_children) { + $http.get('/client/partner_info/sub_partners').then(function (resp) { + var clientList = resp.data; + clientList.forEach(function (client) { + $scope.clients.push(client); + }); + $scope.clientIds = []; + $scope.clients.forEach(function (client) { + $scope.clientIds.push(client.client_id); + if (client.level3Clients) { + client.level3Clients.forEach(function (level3Client) { + $scope.clientIds.push(level3Client.client_id); + }); + } + }); + $scope.params.client_ids = angular.copy($scope.clientIds); + + $scope.loadTradeLogs(1); + //console.log($rootScope.currentUser.client.clientList); + }) + }else{ + $scope.loadTradeLogs(1); + } + + $scope.fullReleasePreAuth = function (){ + var params = angular.copy($scope.params); + if (params.datefrom) { + params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); + } + if (params.dateto) { + params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); + } + commonDialog.confirm({ + title: 'All Pre Authorization Completion', + content: 'These pre authorization orders will be taken into settlement, or you will be able to make a refund order. Are you sure?' + }).then(function(){ + $http.put('/client/partner_info/trade_logs/full_release_preauth',params).then(function (resp){ + $scope.loadTradeLogs(1); + alert("Success"); + },function (resp) { + commonDialog.alert({title: 'Error!', content: resp.data.message, type: 'error'}) + }) + }); + } + + }]); + return app; -}); \ No newline at end of file +}); diff --git a/src/main/ui/static/payment/tradelog/transflow.js b/src/main/ui/static/payment/tradelog/transflow.js index 540409d51..0d79ae790 100644 --- a/src/main/ui/static/payment/tradelog/transflow.js +++ b/src/main/ui/static/payment/tradelog/transflow.js @@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { controller: 'balanceListCtrl' }) }]); - app.controller('balanceListCtrl', ['$scope', '$http', '$filter', '$timeout', 'refunder', 'orderService', function ($scope, $http, $filter, $timeout, refunder) { + app.controller('balanceListCtrl', ['$scope', '$http', '$filter', '$timeout', 'refunder', 'orderService','$sce', function ($scope, $http, $filter, $timeout, refunder,orderService,$sce) { $scope.params = {}; $scope.pagination = {}; $scope.params.clearing_status = -1; @@ -91,6 +91,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { params.page = page || $scope.pagination.page || 1; $http.get('/client/trans_flow', {params: params}).then(function (resp) { $scope.tradeLogs = resp.data.data; + $scope.htmlToolst(); $scope.pagination = resp.data.pagination; $scope.analysis = resp.data.analysis; $scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee)); @@ -214,7 +215,29 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { }else { $scope.chooseLast7Days(); } + + $scope.htmlToolst = function(){ + for(var i=0;i< $scope.tradeLogs.length;i++){ + var tax_amount = $scope.tradeLogs[i].tax_amount; + var total_surcharge= $scope.tradeLogs[i].total_surcharge; + var incremental_surcharge = $scope.tradeLogs[i].incremental_surcharge; + var channel_surcharge = $scope.tradeLogs[i].channel_surcharge; + var royal_surcharge = $scope.tradeLogs[i].royal_surcharge; + var system_surcharge = (total_surcharge-incremental_surcharge).toFixed(2); + var channel = $scope.tradeLogs[i].source; + var tip = '
' + + '
手续费组成
'+'
'+ + '

system:'+ system_surcharge +'

' + + '

'+channel+':'+ incremental_surcharge +'

'; + if(total_surcharge <= (royal_surcharge+incremental_surcharge+channel_surcharge+tax_amount)){ + tip = tip +'

tax amount:'+ tax_amount +'

'; + } + tip = tip + '
'; + $scope.tradeLogs[i].htmlTooltip = $sce.trustAsHtml(tip); + } + }; + }]); return app; -}); \ No newline at end of file +});