From 6f65cfd464486ce53a297537596c6a97e6284952 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Jun 2019 10:17:23 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E9=9D=9E=E4=B8=BB=E6=B5=81=E6=B8=A0?= =?UTF-8?q?=E9=81=93=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/CustomersAnalysisService.java | 2 + .../impls/CustomersAnalysisServiceImp.java | 19 ++ .../CustomerAndOrdersStatisticsMapper.java | 4 + .../web/CustomersAnalysisController.java | 15 ++ .../CustomerAndOrdersStatisticsMapper.xml | 39 ++++ src/main/ui/manage.html | 5 + .../cbbank_channel_trans_analysis.html | 201 ++++++++++++++++++ .../transaction/analysis-transaction.js | 73 +++++++ .../ui/static/menu/templates/main_menu.html | 10 + 9 files changed, 368 insertions(+) create mode 100644 src/main/ui/static/analysis/templates/cbbank_channel_trans_analysis.html diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java index 71f667ef9..38ab29857 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/CustomersAnalysisService.java @@ -13,6 +13,8 @@ public interface CustomersAnalysisService { JSONObject getChannelAmountAnalysis(JSONObject params); + JSONObject getCBBankChannelAmountAnalysis(JSONObject params); + JSONObject getCustomersRanking(JSONObject params, int page, int limit); JSONObject getCustomersTotal(JSONObject params); diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java index 6f35bd105..805e0fa52 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/CustomersAnalysisServiceImp.java @@ -28,6 +28,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -73,6 +74,24 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService { return customerAndOrdersStatisticsMapper.getChannelCommonCount(params); } + @Override + public JSONObject getCBBankChannelAmountAnalysis(JSONObject params) { + JSONObject result = new JSONObject(); + List channels = new ArrayList<>(); + if (params.get("channel") == null) { + channels.add("Bestpay"); + channels.add("Yeepay"); + channels.add("Rpay"); + channels.add("hf"); + channels.add("jd"); + channels.add("LakalaPay"); + params.put("channels", channels); + } + result.put("channels", customerAndOrdersStatisticsMapper.getCBBankChannelAmount(params)); + result.put("counts", customerAndOrdersStatisticsMapper.getCBBankChannelCommonCount(params)); + return result; + } + @Override public JSONObject getCustomersRanking(JSONObject params, int page, int limit) { PageList logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString("amount.desc"))); 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 e651fb951..73af49846 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 @@ -50,6 +50,10 @@ public interface CustomerAndOrdersStatisticsMapper { JSONObject getChannelCommonCount(JSONObject params); + List getCBBankChannelAmount(JSONObject params); + + JSONObject getCBBankChannelCommonCount(JSONObject params); + JSONObject getCommonCount(JSONObject params); @CountRef(".countAreaMerchantTradeAnalysis") diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java index 9349bd9c9..221fd493a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/CustomersAnalysisController.java @@ -74,6 +74,21 @@ public class CustomersAnalysisController { return customersAnalysisService.getChannelAmountAnalysis(params); } + @ManagerMapping("/sys/cbbank_channel") + public JSONObject getCBBankChannelAnalysis(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + JSONObject params = analysis.toParams(null); + if (manager.getInteger("org_id") != null) { + params.put("org_id", manager.getIntValue("org_id")); + } + if (analysis.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { + params.put("bd_group", manager.getString("manager_id")); + if (analysis.getGroup_bd()>0){ + params.put("bd_group_bd",analysis.getGroup_bd()); + } + } + return customersAnalysisService.getCBBankChannelAmountAnalysis(params); + } + @ManagerMapping(value = "/ranking/{openid_type}",role = ManagerRole.DEVELOPER) public JSONObject getCustomersRanking(@PathVariable int openid_type, AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { JSONObject params = analysis.toParams(null); 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 8f2a04ad9..ca9b3d988 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 @@ -364,6 +364,45 @@ + + + + + + ~ +
+ +
+ + +
+ Yesterday +
+ + + +
+ This Year +
+ + + + + + + + + +
+
CBBank 各平台交易总额 +
+ + + +
+
+
+
+
+
+
Bestpay
+
+
+ +
+ +
+
+
+
+
JD Pay
+
+
+ +
+ +
+
+
+
+
HF Pay
+
+
+ +
+
+
+
+
+ +
+
+
RPay+
+
+
+ +
+
+
+
+
+
Yeepay
+
+
+ +
+
+
+
+
+
LakalaPay
+
+
+ +
+
+
+
+
+
+
+
+
CBBank Channel logs
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Channel Name交易商户数付款金额退款金额净交易额总手续费成本手续费平台手续费
+
+
+
+ + + + diff --git a/src/main/ui/static/analysis/transaction/analysis-transaction.js b/src/main/ui/static/analysis/transaction/analysis-transaction.js index 7e4caa701..739a83e05 100644 --- a/src/main/ui/static/analysis/transaction/analysis-transaction.js +++ b/src/main/ui/static/analysis/transaction/analysis-transaction.js @@ -18,6 +18,10 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul url: '/amountRangeAnalysis', templateUrl: '/static/analysis/templates/transaction_amount_Analysis.html', controller: 'transactionAmountCtrl' + }).state('cbbank_channel_trans_analysis', { + url: '/cbbanktrans_analysis', + templateUrl: '/static/analysis/templates/cbbank_channel_trans_analysis.html', + controller: 'cbbankTransAnalysisCtrl' }) }]); @@ -364,5 +368,74 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul }]); + app.controller('cbbankTransAnalysisCtrl', ['$scope', '$http', '$filter', '$timeout', 'commonDialog', 'chartParser', + function ($scope, $http, $filter, $timeout, commonDialog, chartParser) { + $scope.params = {}; + $scope.today = new Date(new Date().getTime() - 24*60*60*1000); + + $scope.chooseToday = function () { + $scope.params.begin = $scope.params.end = new Date(); + $scope.doAnalysis(1); + }; + $scope.chooseYesterday = function () { + var yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + $scope.params.begin = $scope.params.end = yesterday; + $scope.doAnalysis(1); + }; + $scope.chooseLast7Days = function () { + $scope.params.end = new Date(new Date().getTime() - 24*60*60*1000); + var day = new Date(); + day.setDate(day.getDate() - 8); + $scope.params.begin = day; + $scope.doAnalysis(1); + }; + $scope.thisMonth = function () { + $scope.params.end = new Date(new Date().getTime() - 24*60*60*1000); + var monthBegin = new Date(); + monthBegin.setDate(1); + $scope.params.begin = monthBegin; + $scope.doAnalysis(1); + }; + $scope.lastMonth = function () { + var monthFinish = new Date(); + monthFinish.setDate(0); + $scope.params.end = monthFinish; + var monthBegin = new Date(); + monthBegin.setDate(0); + monthBegin.setDate(1); + $scope.params.begin = monthBegin; + $scope.doAnalysis(1); + }; + $scope.thisYear = function () { + var yearFinish = new Date(new Date().getTime() - 24*60*60*1000); + $scope.params.end = yearFinish; + var currentYearFirstDate = new Date(new Date().getFullYear(), 0, 1); + $scope.params.begin = currentYearFirstDate; + $scope.doAnalysis(1); + }; + $scope.doAnalysis = function () { + if ($scope.params.channel == 'All') { + $scope.params.channel = null; + } + var params = angular.copy($scope.params); + if (params.begin) { + params.begin = $filter('date')(params.begin, 'yyyyMMdd'); + } else { + params.begin = $filter('date')(new Date(), 'yyyyMMdd'); + } + if (params.end) { + params.end = $filter('date')(params.end, 'yyyyMMdd'); + } else { + params.end = $filter('date')(new Date(), 'yyyyMMdd'); + } + + $http.get('/analysis/customers/sys/cbbank_channel', {params: params}).then(function (resp) { + $scope.ChannelAmount = resp.data.channels; + $scope.totalChannel = resp.data.counts; + }); + }; + $scope.chooseLast7Days(); + }]); return app; }); \ No newline at end of file diff --git a/src/main/ui/static/menu/templates/main_menu.html b/src/main/ui/static/menu/templates/main_menu.html index 28f4006c0..abf5be44b 100644 --- a/src/main/ui/static/menu/templates/main_menu.html +++ b/src/main/ui/static/menu/templates/main_menu.html @@ -182,6 +182,16 @@ +