Merge branch 'hotfix20180102settlereportyearselect' into develop

master
yixian 7 years ago
commit 13e8a44b80

@ -388,7 +388,7 @@ public class RetailAppServiceImp implements RetailAppService {
query.setGateway_app("11"); query.setGateway_app("11");
String clientType = device.getString("client_type"); String clientType = device.getString("client_type");
DeviceRegister register = deviceSupport.findRegister(clientType); DeviceRegister register = deviceSupport.findRegister(clientType);
Assert.notNull(register); Assert.notNull(register,"Device is not registered");
int client_id = device.getIntValue("client_id"); int client_id = device.getIntValue("client_id");
JSONObject client = clientManager.getClientInfo(client_id); JSONObject client = clientManager.getClientInfo(client_id);
String timezone = client.getString("timezone"); String timezone = client.getString("timezone");
@ -779,7 +779,7 @@ public class RetailAppServiceImp implements RetailAppService {
Date now = new Date(); Date now = new Date();
JSONObject res = merchantInfoProvider.clientCurrentRate(clientId, now, "Wechat"); JSONObject res = merchantInfoProvider.clientCurrentRate(clientId, now, "Wechat");
JSONObject client = clientManager.getClientInfo(clientId); JSONObject client = clientManager.getClientInfo(clientId);
Assert.notNull(client); Assert.notNull(client,"Client is null");
JSONObject[] channels = new JSONObject[3]; JSONObject[] channels = new JSONObject[3];
@ -804,7 +804,7 @@ public class RetailAppServiceImp implements RetailAppService {
Date now = new Date(); Date now = new Date();
JSONObject res = merchantInfoProvider.clientCurrentRate(clientId, now, "Wechat"); JSONObject res = merchantInfoProvider.clientCurrentRate(clientId, now, "Wechat");
JSONObject client = clientManager.getClientInfo(clientId); JSONObject client = clientManager.getClientInfo(clientId);
Assert.notNull(client); Assert.notNull(client,"Client is null");
ArrayList<JSONObject> channels = new ArrayList<>(); ArrayList<JSONObject> channels = new ArrayList<>();
if (client.getBigDecimal("customer_surcharge_rate") != null) { if (client.getBigDecimal("customer_surcharge_rate") != null) {
@ -1095,7 +1095,7 @@ public class RetailAppServiceImp implements RetailAppService {
if (params.getString("type").equals("Merchant")) { if (params.getString("type").equals("Merchant")) {
for (String partner_code : codes) { for (String partner_code : codes) {
JSONObject client = clientManager.getClientInfoByMoniker(partner_code); JSONObject client = clientManager.getClientInfoByMoniker(partner_code);
Assert.notNull(client); Assert.notNull(client,"Client is null");
List<JSONObject> tokens = clientDeviceTokenMapper.listTokensByClient_id(client.getInteger("client_id")); List<JSONObject> tokens = clientDeviceTokenMapper.listTokensByClient_id(client.getInteger("client_id"));
if (null != tokens && tokens.size() > 0) { if (null != tokens && tokens.size() > 0) {
for (final JSONObject devToken : tokens) { for (final JSONObject devToken : tokens) {

@ -1,7 +1,7 @@
/** /**
* Created by yixian on 2017-05-03. * Created by yixian on 2017-05-03.
*/ */
define(['angular', 'decimal','uiRouter','./report/analysis-report'], function (angular,Decimal) { define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) {
'use strict'; 'use strict';
var app = angular.module('settleReportApp', ['ui.router']); var app = angular.module('settleReportApp', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
@ -13,6 +13,7 @@ define(['angular', 'decimal','uiRouter','./report/analysis-report'], function (a
}]); }]);
app.controller('settleFinancialReportCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) { app.controller('settleFinancialReportCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) {
$scope.params = {year: new Date().getFullYear()}; $scope.params = {year: new Date().getFullYear()};
$scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()];
$scope.initMonth = function (year) { $scope.initMonth = function (year) {
$scope.months = []; $scope.months = [];
for (var i = 1; i < 13; i++) { for (var i = 1; i < 13; i++) {
@ -38,16 +39,16 @@ define(['angular', 'decimal','uiRouter','./report/analysis-report'], function (a
settlements: resp.data settlements: resp.data
}; };
$scope.analysis = { $scope.analysis = {
gross_amount:0, gross_amount: 0,
wechat_settlement:0, wechat_settlement: 0,
net_amount:0, net_amount: 0,
royalpay_charge:0 royalpay_charge: 0
}; };
angular.forEach($scope.report.settlements,function (settle) { angular.forEach($scope.report.settlements, function (settle) {
$scope.analysis.gross_amount = Decimal.add(settle.gross_amount,$scope.analysis.gross_amount).toFixed(2); $scope.analysis.gross_amount = Decimal.add(settle.gross_amount, $scope.analysis.gross_amount).toFixed(2);
$scope.analysis.wechat_settlement = Decimal.add(settle.wechat_settlement,$scope.analysis.wechat_settlement).toFixed(2); $scope.analysis.wechat_settlement = Decimal.add(settle.wechat_settlement, $scope.analysis.wechat_settlement).toFixed(2);
$scope.analysis.net_amount = Decimal.add(settle.net_amount,$scope.analysis.net_amount).toFixed(2); $scope.analysis.net_amount = Decimal.add(settle.net_amount, $scope.analysis.net_amount).toFixed(2);
$scope.analysis.royalpay_charge = Decimal.add(settle.royalpay_charge,$scope.analysis.royalpay_charge).toFixed(2); $scope.analysis.royalpay_charge = Decimal.add(settle.royalpay_charge, $scope.analysis.royalpay_charge).toFixed(2);
}); });
}) })
}; };

@ -1,7 +1,14 @@
<section class="content"> <section class="content">
<div class="box box-default"> <div class="box box-default">
<div class="box-header" ng-bind="params.year"></div> <div class="box-header">
<div uib-dropdown>
<button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="params.year=year" ng-bind="year"></a></li>
</ul>
</div>
</div>
<div class="box-body"> <div class="box-body">
<div class="row"> <div class="row">
<div class="col-xs-3" ng-repeat="mon in months"> <div class="col-xs-3" ng-repeat="mon in months">

Loading…
Cancel
Save