diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java index 10d3aeea5..141f7ae3e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/SettleTasksService.java @@ -13,4 +13,7 @@ public interface SettleTasksService { List listMerchantsInfo(String mchMonikers); void submitTasks(List tasks); + + List analysisYesterdayTransaction(); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java index 63dc949cc..6541bdbcd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/SettleTaskServiceImpl.java @@ -1,15 +1,20 @@ package au.com.royalpay.payment.manage.management.clearing.core.impl; +import au.com.royalpay.payment.core.PaymentApi; import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksService; import au.com.royalpay.payment.manage.management.clearing.web.ManualSettleTask; +import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.SysSettlePlanMapper; import au.com.royalpay.payment.tools.exceptions.ServerErrorException; import au.com.royalpay.payment.tools.livecheck.AppLiveCheck; +import au.com.royalpay.payment.tools.merchants.beans.BalanceGroup; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.data.redis.core.StringRedisTemplate; @@ -25,8 +30,10 @@ import org.springframework.web.util.UriComponentsBuilder; import java.net.URI; import java.nio.charset.StandardCharsets; +import java.util.Date; import java.util.List; import java.util.Objects; +import java.util.TimeZone; import java.util.stream.Collectors; @Service @@ -34,6 +41,8 @@ public class SettleTaskServiceImpl implements SettleTasksService { private final SysSettlePlanMapper planMapper; private final StringRedisTemplate redisTemplate; private final MerchantInfoProvider mchInfoProvider; + private final PaymentApi paymentApi; + private final TransactionMapper transactionMapper; private final String prefix; private final RestTemplate restTemplate; private final String transactionHost; @@ -41,11 +50,13 @@ public class SettleTaskServiceImpl implements SettleTasksService { private static final String SETTLE_TASK_URI = "/dev/manual/settle_tasks"; public SettleTaskServiceImpl(SysSettlePlanMapper planMapper, StringRedisTemplate redisTemplate, - MerchantInfoProvider mchInfoProvider, @Value("${app.redis.prefix}") String prefix, + MerchantInfoProvider mchInfoProvider, PaymentApi paymentApi, TransactionMapper transactionMapper, @Value("${app.redis.prefix}") String prefix, @Value("${platform.services.transaction:http://127.0.0.1:6012}") String transactionHost, AppLiveCheck appLiveCheck) { this.planMapper = planMapper; this.redisTemplate = redisTemplate; this.mchInfoProvider = mchInfoProvider; + this.paymentApi = paymentApi; + this.transactionMapper = transactionMapper; this.prefix = prefix; this.appLiveCheck = appLiveCheck; this.restTemplate = new RestTemplateBuilder() @@ -108,5 +119,15 @@ public class SettleTaskServiceImpl implements SettleTasksService { } } + @Override + public List analysisYesterdayTransaction() { + Date from = DateTime.now().withMillisOfDay(0).withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone("Asia/Shanghai"))) + .minusDays(1).toDate(); + Date to = new DateTime(from).plusDays(1).toDate(); + List channels = paymentApi.channelsInGroup(BalanceGroup.NORMAL_CROSS_BORDER); + channels.remove("System"); + return transactionMapper.analysisByChannels(from, to, channels); + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java index 8b0d6e390..d2e1d3986 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/web/SettleTasksController.java @@ -14,14 +14,19 @@ import java.util.List; @RestController @ManagerMapping(value = "/sys/settle_tasks", role = {ManagerRole.FINANCIAL_STAFF, ManagerRole.DEVELOPER}) public class SettleTasksController { - private SettleTasksService svc; - private PriorityListManager priorityListManager; + private final SettleTasksService svc; + private final PriorityListManager priorityListManager; public SettleTasksController(SettleTasksService svc, PriorityListManager priorityListManager) { this.svc = svc; this.priorityListManager = priorityListManager; } + @GetMapping("/yesterday_trans_analysis") + public List getYesterdayTransAnalysis() { + return svc.analysisYesterdayTransaction(); + } + @GetMapping("/plans") public List listPlans() { return svc.listPlans(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index 682fc0ccb..ee28809df 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -166,4 +166,5 @@ public interface TransactionMapper { */ List getSettleDataDailyReport(@Param("beginTime") Date beginTime,@Param("endTime")Date endTime); + List analysisByChannels(@Param("from") Date from, @Param("to") Date to, @Param("channels") List channels); } 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 95bf441ee..c31aa1eae 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 @@ -5062,7 +5062,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - clientModifySupport.processClientConfigModify(new ClientMinSettleModify(manager, clientMoniker, minSettle)); + clientModifySupport.processClientModify(new ClientMinSettleModify(manager, clientMoniker, minSettle)); } @Override 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 25c0d5a12..242c3f775 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 @@ -562,9 +562,9 @@ SELECT t.client_id,DATE(t.transaction_time) clearing_time, ifnull(cd.report_date,date(t.transaction_time)) report_date, - SUM(cd.tax_amount) /2 as tax_amount, + SUM(cd.tax_amount) /2 as tax_amount, SUM(cd.total_charge)/2 as total_charge, - 1 as merge_settle, + 1 as merge_settle, cd.tax_amount, @@ -591,7 +591,7 @@ - and (sc.client_id=#{client_id} or sc.parent_client_id =#{client_id}) + and (sc.client_id=#{client_id} or sc.parent_client_id =#{client_id}) and cd.report_date >= DATE_FORMAT(#{from},'%Y-%m-%d') and cd.report_date < DATE_FORMAT(#{to},'%Y-%m-%d') @@ -1479,4 +1479,15 @@ AND channel != 'Settlement' GROUP BY channel + diff --git a/src/main/ui/static/analysis/settle_tasks.js b/src/main/ui/static/analysis/settle_tasks.js index 5c5e81693..7ba893bc5 100644 --- a/src/main/ui/static/analysis/settle_tasks.js +++ b/src/main/ui/static/analysis/settle_tasks.js @@ -28,6 +28,20 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) { $scope.redirectToSettleLogs = function () { $state.go('clearingLogs.settlementDetail', {date: $filter('date')(new Date(), 'yyyy-MM-dd')}) } + $scope.displayYesterdayTransaction = function () { + $uibModal.open({ + templateUrl: '/static/analysis/templates/yesterday_trans_report.html', + controller: ['$scope', 'data', function (scope, data) { + scope.data = data.data + }], + resolve: { + 'data': ['$http', function (http) { + return http.get('/sys/settle_tasks/yesterday_trans_analysis') + }] + }, + size: 'lg' + }) + }; $scope.checkProgressStatus = function () { let defer = $q.defer(); $http.get('/sys/settle_tasks/current_progress').then(function (res) { diff --git a/src/main/ui/static/analysis/templates/settle_tasks_index.html b/src/main/ui/static/analysis/templates/settle_tasks_index.html index a916900a3..209e928a9 100644 --- a/src/main/ui/static/analysis/templates/settle_tasks_index.html +++ b/src/main/ui/static/analysis/templates/settle_tasks_index.html @@ -25,6 +25,9 @@ Priority List +
diff --git a/src/main/ui/static/analysis/templates/yesterday_trans_report.html b/src/main/ui/static/analysis/templates/yesterday_trans_report.html new file mode 100644 index 000000000..82697ceec --- /dev/null +++ b/src/main/ui/static/analysis/templates/yesterday_trans_report.html @@ -0,0 +1,24 @@ + + + \ No newline at end of file diff --git a/src/main/ui/static/boot/managerMainAppv2.js b/src/main/ui/static/boot/managerMainAppv2.js index 620650343..43702c9d0 100644 --- a/src/main/ui/static/boot/managerMainAppv2.js +++ b/src/main/ui/static/boot/managerMainAppv2.js @@ -6,57 +6,58 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo var app = angular.module('managerMainAppv2', ['ngSanitize', 'ngAnimate', 'ngMessages', 'ui.router', 'ui.bootstrap', 'ngFileUpload']); app.config(['$urlRouterProvider', '$httpProvider', function ($urlRouterProvider, $httpProvider) { - window.getRoleMenulist = function (role) { + window.getRoleMenulist = function (role) { var roleMenu = []; - if ((role & 1) >0){ - roleMenu.push({'value':'administrator','module':'系统配置'}); + if ((role & 1) > 0) { + roleMenu.push({'value': 'administrator', 'module': '系统配置'}); } - if ((role & 2) >0){ - roleMenu.push({'value':'compliance','module':'合规中心'}); + if ((role & 2) > 0) { + roleMenu.push({'value': 'compliance', 'module': '合规中心'}); } - if ((role & 4) >0){ - roleMenu.push({'value':'bduser','module':"销售中心"}); + if ((role & 4) > 0) { + roleMenu.push({'value': 'bduser', 'module': "销售中心"}); } - if ((role & 8) >0){ - roleMenu.push({'value':'accountant','module':"财务中心"}); + if ((role & 8) > 0) { + roleMenu.push({'value': 'accountant', 'module': "财务中心"}); } - if ((role & 64) >0){ - roleMenu.push({'value':'director','module':"领导决策"}); + if ((role & 64) > 0) { + roleMenu.push({'value': 'director', 'module': "领导决策"}); } - if ((role & 128) >0){ - roleMenu.push({'value':'sitemanager','module':"营销中心"}); + if ((role & 128) > 0) { + roleMenu.push({'value': 'sitemanager', 'module': "营销中心"}); } - if ((role & 256) >0){ - roleMenu.push({'value':'developer','module':"开发中心"}); + if ((role & 256) > 0) { + roleMenu.push({'value': 'developer', 'module': "开发中心"}); } - if ((role & 1024) >0){ - roleMenu.push({'value':'riskmanager','module':"风控中心"}); + if ((role & 1024) > 0) { + roleMenu.push({'value': 'riskmanager', 'module': "风控中心"}); } - if ((role & 2048) >0){ - roleMenu.push({'value':'guest','module':"访客中心"}); + if ((role & 2048) > 0) { + roleMenu.push({'value': 'guest', 'module': "访客中心"}); } - if ((role & 4096) >0){ - roleMenu.push({'value':'orgmanager','module':"代理商中心"}); + if ((role & 4096) > 0) { + roleMenu.push({'value': 'orgmanager', 'module': "代理商中心"}); } - if ((role & 8192) >0){ - roleMenu.push({'value':'salesmanager','module':"销管中心"}); + if ((role & 8192) > 0) { + roleMenu.push({'value': 'salesmanager', 'module': "销管中心"}); } return roleMenu; }; - if (getRoleMenulist(window.currentUser.role).length>1) { - sessionStorage.setItem('roleNum','N'); + if (getRoleMenulist(window.currentUser.role).length > 1) { + sessionStorage.setItem('roleNum', 'N'); $urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/home'); - }else { - sessionStorage.setItem('roleNum','1'); - sessionStorage.setItem('role',getRoleMenulist(window.currentUser.role)[0].value); + } else { + sessionStorage.setItem('roleNum', '1'); + var roleTemplValue = "guest"; + if (getRoleMenulist(window.currentUser.role)[0]) { + roleTemplValue = getRoleMenulist(window.currentUser.role)[0].value; + } + sessionStorage.setItem('role', roleTemplValue); $urlRouterProvider.otherwise(((window.currentUser.role & parseInt('100000', 2)) > 0) ? '/managers' : '/menu'); } - - - if (!$httpProvider.defaults.headers.get) { $httpProvider.defaults.headers.get = {}; } @@ -64,45 +65,45 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo $httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache'; $httpProvider.defaults.headers.get['Pragma'] = 'no-cache'; }]); - app.controller('managerIndexCtrl', ['$scope', '$state','$rootScope', '$http', '$log', '$timeout', '$interval', '$uibModal', '$filter', 'myLoginLogView', 'commonDialog', - function ($scope, $state,$rootScope, $http, $log, $timeout, $interval, $uibModal, $filter, myLoginLogView, commonDialog) { + app.controller('managerIndexCtrl', ['$scope', '$state', '$rootScope', '$http', '$log', '$timeout', '$interval', '$uibModal', '$filter', 'myLoginLogView', 'commonDialog', + function ($scope, $state, $rootScope, $http, $log, $timeout, $interval, $uibModal, $filter, myLoginLogView, commonDialog) { $scope.rolelist = window.getRoleMenulist(window.currentUser.role); $scope.roleNow = getroleNow(); $scope.roleName = sessionStorage.getItem('role'); $scope.changeRole = function (index) { - sessionStorage.setItem('role',index); + sessionStorage.setItem('role', index); $scope.roleNow = getroleNow(); - $state.go('listMenu',null,{ - reload:true + $state.go('listMenu', null, { + reload: true }); }; - if (sessionStorage.getItem('roleNum') =='N'){ - if (window.location.hash == "" || window.location.hash == "#/home") { - $scope.headerDisplay = false; - $scope.copyright = false; - }else { - $scope.headerDisplay = true; - $scope.copyright = true; - } - - }else { + if (sessionStorage.getItem('roleNum') == 'N') { + if (window.location.hash == "" || window.location.hash == "#/home") { + $scope.headerDisplay = false; + $scope.copyright = false; + } else { $scope.headerDisplay = true; $scope.copyright = true; } - $scope.headerCopyDisplay = function () { - if (sessionStorage.getItem('role')=='guest'){ + } else { + $scope.headerDisplay = true; + $scope.copyright = true; + } + + $scope.headerCopyDisplay = function () { + if (sessionStorage.getItem('role') == 'guest') { return; } $state.go('home'); $scope.headerDisplay = false; $scope.copyright = false; }; - $scope.headerShow = function (role) { + $scope.headerShow = function (role) { $scope.headerDisplay = true; $scope.copyright = true; - sessionStorage.setItem('role',role); + sessionStorage.setItem('role', role); $scope.roleNow = getroleNow(); $scope.roleName = sessionStorage.getItem('role'); }; @@ -199,7 +200,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo } }) }; - // $scope.getManagerTodoNotices(); + // $scope.getManagerTodoNotices(); var connected; @@ -313,7 +314,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo } $scope.customerService = function () { $http.put('/sys/openim/check').then(function (resp) { - window.open('/service_client.html?key='+resp.data.appkey+'&p='+resp.data.password+'&uid='+resp.data.user_id,'_blank'); + window.open('/service_client.html?key=' + resp.data.appkey + '&p=' + resp.data.password + '&uid=' + resp.data.user_id, '_blank'); }); } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 321b111db..6ffb38c6e 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2544,6 +2544,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.modifyMinSettle = function () { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/min_settle', {min_settle: $scope.partner.min_settle}).then(function () { commonDialog.alert({title: 'Success', content: '修改起结金额成功', type: 'success'}); + $scope.bankCtrl.modify_min_settle = false; }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html index 88329f4ad..2c87df7c1 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -80,11 +80,18 @@

- {{partner.min_settle||'Not Configure'}} + AU${{partner.min_settle||'Not Configure'}}

- +
AU$
+ +
+ +