From 4499d9dca7f73e8fb47fe0eba6a4bc2a3df97e78 Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Thu, 20 Jan 2022 09:01:44 +0800 Subject: [PATCH] =?UTF-8?q?r+service=20=E6=B5=81=E6=B0=B4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/tradelog/core/TradeLogService.java | 2 ++ .../core/impls/TradeLogServiceImpl.java | 17 +++++++++++++++++ .../tradelog/web/ManageTradelogController.java | 6 ++++++ .../static/payment/tradelog/tradelog-manage.js | 3 +++ 4 files changed, 28 insertions(+) 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 2476fa1c2..ac4e6caae 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 @@ -21,6 +21,8 @@ public interface TradeLogService { JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, JSONObject manager); + JSONObject incrementalAnalysisOrders(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 c5bfc7afb..7bd44636f 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 @@ -277,6 +277,23 @@ public class TradeLogServiceImpl implements TradeLogService { }; }); JSONObject result = PageListUtils.buildPageListResult(logs); +// JSONObject analysis = orderMapper.analysisOrders(params); +// result.put("analysis", analysis); + return result; + } + @Override + public JSONObject incrementalAnalysisOrders(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")); + } + orgManager.checkOrgIds(manager, params); + if (query.getGatewayChild() != null) { + params.put("trade_type", new ArrayList() {{ + add(query.getGatewayChild()); + }}); + } + JSONObject result = new JSONObject(); JSONObject analysis = orderMapper.analysisOrders(params); result.put("analysis", analysis); return result; 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 a54a2360d..7d5e62e95 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 @@ -41,6 +41,12 @@ public class ManageTradelogController { public JSONObject listAllIncrementalTradeLogs(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { return tradeLogService.listAllIncrementalTradeLogs(query, manager); } + @RequestMapping(value = "/incremental/analysis", method = RequestMethod.GET) + @ReadOnlyConnection + @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) + public JSONObject incrementalAnalysisOrders(TradeLogQuery query, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return tradeLogService.incrementalAnalysisOrders(query, manager); + } @ManagerMapping(value = "/{tradeId}/refunds", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF, ManagerRole.SERVANT, ManagerRole.DIRECTOR}) @ReadOnlyConnection diff --git a/src/main/ui/static/payment/tradelog/tradelog-manage.js b/src/main/ui/static/payment/tradelog/tradelog-manage.js index 9c24f0342..95eac1c53 100644 --- a/src/main/ui/static/payment/tradelog/tradelog-manage.js +++ b/src/main/ui/static/payment/tradelog/tradelog-manage.js @@ -436,6 +436,9 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $http.get('/sys/trade_logs/incremental', {params: params}).then(function (resp) { $scope.tradeLogs = resp.data.data; $scope.pagination = resp.data.pagination; + + }); + $http.get('/sys/trade_logs/incremental/analysis', {params: params}).then(function (resp) { $scope.analysis = resp.data.analysis; $scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee)); });