From 4264a2bb75c992dec8cc0a21ecee6cfaedb0129d Mon Sep 17 00:00:00 2001 From: yangkai Date: Tue, 15 Jan 2019 20:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=80=9A=E9=81=93=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E5=95=86=E6=88=B7=E6=95=B0=E8=B7=9F=E5=BC=80=E9=80=9A=E8=AF=A5?= =?UTF-8?q?=E6=B8=A0=E9=81=93=E5=95=86=E6=88=B7=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impls/ChannelsAnalysisServiceImpl.java | 16 +++++- .../CustomerAndOrdersStatisticsMapper.java | 2 + .../CustomerAndOrdersStatisticsMapper.xml | 50 ++++++++++++++++++- .../analysis/templates/channels_analysis.html | 4 ++ 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java index 0ab5fa1ae..98477eb2d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/ChannelsAnalysisServiceImpl.java @@ -20,9 +20,9 @@ public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService { @Override public List getChannelMount(JSONObject params) { - if (!params.containsKey("client_ids") && !params.containsKey("org_id")){ + /*if (!params.containsKey("client_ids") && !params.containsKey("org_id")){ params.put("client_id",0); - } + }*/ List listChannel = new ArrayList<>(); listChannel.add(putParam(params,"Wechat")); listChannel.add(putParam(params,"Bestpay")); @@ -86,6 +86,18 @@ public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService { obj.put("total",count.getIntValue("total")); obj.put("order",count.getIntValue("orders")); obj.put("channel",name); + obj.put("transaction_partners",count.getIntValue("transaction_partners")); + int enablePartners = 0; + if ("AlipayOnline".equals(name)) { + params.put("gateway_alipay_online", 1); + enablePartners = customerAndOrdersStatisticsMapper.countEnableChannel(params); + params.remove("gateway_alipay_online"); + } else { + params.put("enable_" + name.toLowerCase(), 1); + enablePartners = customerAndOrdersStatisticsMapper.countEnableChannel(params); + params.remove("enable_" + name.toLowerCase()); + } + obj.put("enable_partners", enablePartners); return obj; } } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java index fdb90019a..c05f71b19 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.java @@ -61,4 +61,6 @@ public interface CustomerAndOrdersStatisticsMapper { int countTotalCustomers(JSONObject params); int countTotalOldCustomers(JSONObject params); + + int countEnableChannel(JSONObject params); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml index e5b705835..d207115b5 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/CustomerAndOrdersStatisticsMapper.xml @@ -275,10 +275,12 @@ SELECT ifnull(sum(s.orders),0) orders, ifnull(sum(s.total),0) total, - ifnull(sum(s.single_amount),0) single_amount + ifnull(sum(s.single_amount),0) single_amount, + ifnull(count(distinct s.client_id), 0) transaction_partners FROM statistics_customer_order s LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1 + AND s.client_id != 0 AND s.client_id IN @@ -566,4 +568,50 @@ + diff --git a/src/main/ui/static/analysis/templates/channels_analysis.html b/src/main/ui/static/analysis/templates/channels_analysis.html index db4fa595d..0207fee64 100644 --- a/src/main/ui/static/analysis/templates/channels_analysis.html +++ b/src/main/ui/static/analysis/templates/channels_analysis.html @@ -131,6 +131,8 @@ Channels Total Amount (AUD) Total orders + Transaction Partners + Enable Partners @@ -139,6 +141,8 @@ ng-bind="channels.channel"> + +