diff --git a/checkstyle/GeekCheckStyle.xml b/checkstyle/GeekCheckStyle.xml
new file mode 100644
index 000000000..f7b6658e7
--- /dev/null
+++ b/checkstyle/GeekCheckStyle.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/checkstyle/checkstyle-8.38-all.jar b/checkstyle/checkstyle-8.38-all.jar
new file mode 100644
index 000000000..52076fe4f
Binary files /dev/null and b/checkstyle/checkstyle-8.38-all.jar differ
diff --git a/checkstyle/pre-commit b/checkstyle/pre-commit
new file mode 100644
index 000000000..274e80d25
--- /dev/null
+++ b/checkstyle/pre-commit
@@ -0,0 +1,62 @@
+#! /bin/bash
+# @author:haloo#
+#@func:pre-commit#
+## cp ./checkstyle/pre-commit ./.git/hooks/
+
+echo 避免NPE是程序员的基本修养
+echo 开始style checking
+
+wd=`pwd`
+echo "当前工作目录:$wd"
+
+# check-style版本号
+check_style_version="checkstyle-8.38-all.jar"
+check_style_xml_name="GeekCheckStyle.xml"
+check_jar_path="$wd/checkstyle/$check_style_version"
+check_xml_path="$wd/checkstyle/$check_style_xml_name"
+
+## 清空temp文件
+
+rm -f temp
+
+is_err=0
+errorCount=0
+warnCount=0
+
+## 查找add到git 缓冲区中,以.java后缀的文件
+for file in `git status --porcelain | sed s/^...// | grep '\.java$'`; do
+ path="$wd/$file"
+ echo "检查文件: $path"
+ re=`java -jar $check_jar_path -c $check_xml_path $path >> temp`
+
+ warn=`cat temp | grep "WARN"`
+ if [[ $warn = *"WARN"* ]];then
+ echo "${warn}"
+ needle="WARN"
+ number_of_occurrences=$(grep -o "$needle" <<< "$warn" | wc -l)
+ ((warnCount = warnCount + number_of_occurrences))
+ is_err=1
+ fi
+
+ err=`cat temp | grep "ERROR"`
+ if [[ $err = *"ERROR"* ]];then
+ echo "${err}"
+ needle="ERROR"
+ number_of_occurrences=$(grep -o "$needle" <<< "$err" | wc -l)
+ ((errorCount = errorCount + number_of_occurrences))
+ is_err=1
+ fi
+done
+
+echo "检查完成,祝你好运"
+
+rm -f temp
+
+if [ $is_err -ne 0 ];then
+ echo "出现了 $errorCount 个error"
+ echo "出现了 $warnCount 个warn"
+ echo "请先符合style才能提交"
+ exit 1
+fi
+echo "No Bug ,It is Good!!"
+exit 0
diff --git a/init.sh b/init.sh
new file mode 100644
index 000000000..42f10fb1c
--- /dev/null
+++ b/init.sh
@@ -0,0 +1,2 @@
+cp checkstyle/pre-commit .git/hooks/
+chmod +x .git/hooks/pre-commit
diff --git a/pom.xml b/pom.xml
index a3ca784e9..6d785065f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,11 +5,11 @@
au.com.royalpay.payment
payment-parent
- 2.2.25
+ 2.2.26
4.0.0
manage
- 2.3.76-SNAPSHOT
+ 2.3.77
UTF-8
2.4.0
diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java
index 86bb7a7fd..6ba0d197d 100644
--- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java
+++ b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/AppQueryBean.java
@@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.appclient.beans;
import au.com.royalpay.payment.core.beans.OrderStatus;
-import au.com.royalpay.payment.core.beans.PayChannel;
+import au.com.royalpay.payment.core.beans.PayChannelSearch;
import au.com.royalpay.payment.tools.defines.TradeType;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
@@ -25,7 +25,7 @@ public class AppQueryBean {
private String[] client_ids;
private String app_client_ids;
private OrderStatus status = OrderStatus.ALL;
- private PayChannel channel = PayChannel.ALL;
+ private PayChannelSearch channel = PayChannelSearch.ALL;
private int[] gateway;
private int clearing_status=-1;
private String gateway_app;
@@ -164,11 +164,11 @@ public class AppQueryBean {
this.app_client_ids = app_client_ids;
}
- public PayChannel getChannel() {
+ public PayChannelSearch getChannel() {
return channel;
}
- public void setChannel(PayChannel channel) {
+ public void setChannel(PayChannelSearch channel) {
this.channel = channel;
}
diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java
index fb3a04fd6..d99e2d39c 100644
--- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java
+++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java
@@ -1,11 +1,8 @@
package au.com.royalpay.payment.manage.dev.core.impl;
-import au.com.royalpay.payment.channels.rpay.runtime.RpayApi;
import au.com.royalpay.payment.manage.dev.core.ManualService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
-import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
-import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.task.PostponeClientTask;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject;
@@ -37,12 +34,6 @@ public class ManualServiceimpl implements ManualService {
private ClientAccountMapper clientAccountMapper;
@Resource
private SynchronizedScheduler synchronizedScheduler;
- @Resource
- private ClientModifySupport clientModifySupport;
- @Resource
- private RpayApi rpayApi;
- @Resource
- private ClientMapper clientMapper;
@Override
public void clientPostpone() {
diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java
index d284d8ff7..936b2f5b6 100644
--- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java
+++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java
@@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.tradelog.beans;
import au.com.royalpay.payment.core.beans.OrderStatus;
-import au.com.royalpay.payment.core.beans.PayChannel;
+import au.com.royalpay.payment.core.beans.PayChannelSearch;
import au.com.royalpay.payment.tools.defines.TradeType;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
@@ -29,7 +29,7 @@ public class TradeLogQuery {
private int[] gateway;
private String source = "ALL" ;
private OrderStatus status = OrderStatus.PAID;
- private PayChannel channel = PayChannel.ALL;
+ private PayChannelSearch channel = PayChannelSearch.ALL;
private String[] client_ids;
private String dev_id;
private int clearing_status;
@@ -225,11 +225,11 @@ public class TradeLogQuery {
return trans_type;
}
- public PayChannel getChannel() {
+ public PayChannelSearch getChannel() {
return channel;
}
- public void setChannel(PayChannel channel) {
+ public void setChannel(PayChannelSearch channel) {
this.channel = channel;
}
diff --git a/src/main/resources/application-officedev.yml b/src/main/resources/application-officedev.yml
index 41b67c62f..f0bab2078 100644
--- a/src/main/resources/application-officedev.yml
+++ b/src/main/resources/application-officedev.yml
@@ -1,20 +1,20 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
- host: 192.168.0.84:3306
+ host: 192.168.0.92:3306
master:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: ${spring.datasource.pwd}
username: ${spring.datasource.user}
- pwd: rpayplus
+ pwd: SuTUUxyvzS0cLETi6Rzm
schema-name: royalpay
slave:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: ${spring.datasource.pwd}
username: ${spring.datasource.user}
- user: root
+ user: rpaydev
redis:
database: 9
host: 192.168.0.84
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 671b83a4c..bf9fc95dd 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -18,8 +18,6 @@ jetty:
multipart:
max-file-size: 10Mb
app:
- active:
- channels: Wechat,Alipay,AlipayOnline,Gmo,UnionPay,AlipayPlus
crossapp:
enable: true
agreetemplate:
diff --git a/src/main/ui/static/analysis/settle_report.js b/src/main/ui/static/analysis/settle_report.js
index b7f907541..5b823ff3c 100644
--- a/src/main/ui/static/analysis/settle_report.js
+++ b/src/main/ui/static/analysis/settle_report.js
@@ -2,57 +2,63 @@
* Created by yixian on 2017-05-03.
*/
define(['angular', 'decimal', 'uiRouter', './report/analysis-report'], function (angular, Decimal) {
- 'use strict';
- var app = angular.module('settleReportApp', ['ui.router']);
- app.config(['$stateProvider', function ($stateProvider) {
- $stateProvider.state('analysis_report.settle_report', {
- url: '/settle_report',
- templateUrl: '/static/analysis/templates/settle_report.html',
- controller: 'settleFinancialReportCtrl'
+ 'use strict'
+ var app = angular.module('settleReportApp', ['ui.router'])
+ app.config([
+ '$stateProvider',
+ function ($stateProvider) {
+ $stateProvider.state('analysis_report.settle_report', {
+ url: '/settle_report',
+ templateUrl: '/static/analysis/templates/settle_report.html',
+ controller: 'settleFinancialReportCtrl',
+ })
+ },
+ ])
+ app.controller('settleFinancialReportCtrl', [
+ '$scope',
+ '$http',
+ '$filter',
+ function ($scope, $http, $filter) {
+ $scope.params = { year: new Date() }
+ $scope.initMonth = function () {
+ const year = $scope.params.year.getFullYear()
+ $scope.months = []
+ for (var i = 1; i < 13; i++) {
+ var mon = '00' + i
+ mon = mon.substr(mon.length - 2, 2)
+ $scope.months.push(year + '-' + mon)
+ }
+ }
+ $scope.initMonth()
+ $scope.hasReport = function (mon) {
+ var end = $filter('date')(new Date(), 'yyyy-MM')
+ return end >= mon
+ }
+ $scope.loadReport = function (mon) {
+ var monItems = mon.split('-')
+ var year = monItems[0]
+ var month = monItems[1]
+ var monStr = year + month
+ $http.get('/sys/financial/settlement/month_reports/' + monStr).then(function (resp) {
+ $scope.report = {
+ month: monStr,
+ settlements: resp.data,
+ }
+ $scope.analysis = {
+ gross_amount: 0,
+ wechat_settlement: 0,
+ net_amount: 0,
+ royalpay_charge: 0,
+ }
+ angular.forEach($scope.report.settlements, function (settle) {
+ $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.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)
+ })
})
- }]);
- app.controller('settleFinancialReportCtrl', ['$scope', '$http', '$filter', function ($scope, $http, $filter) {
- $scope.params = {year: new Date().getFullYear()};
- $scope.availableYears = [new Date().getFullYear() - 1, new Date().getFullYear()];
- $scope.initMonth = function (year) {
- $scope.params.year = year;
- $scope.months = [];
- for (var i = 1; i < 13; i++) {
- var mon = '00' + i;
- mon = mon.substr(mon.length - 2, 2);
- $scope.months.push(year + '-' + mon);
- }
- };
- $scope.initMonth(new Date().getFullYear());
- $scope.hasReport = function (mon) {
- var start = '2017-02';//todo modify in different country
- var end = $filter('date')(new Date(), 'yyyy-MM');
- return start <= mon && end >= mon
- };
- $scope.loadReport = function (mon) {
- var monItems = mon.split('-');
- var year = monItems[0];
- var month = monItems[1];
- var monStr = year + month;
- $http.get('/sys/financial/settlement/month_reports/' + monStr).then(function (resp) {
- $scope.report = {
- month: monStr,
- settlements: resp.data
- };
- $scope.analysis = {
- gross_amount: 0,
- wechat_settlement: 0,
- net_amount: 0,
- royalpay_charge: 0
- };
- angular.forEach($scope.report.settlements, function (settle) {
- $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.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);
- });
- })
- };
- }]);
- return app;
-});
\ No newline at end of file
+ }
+ },
+ ])
+ return app
+})
diff --git a/src/main/ui/static/analysis/templates/settle_report.html b/src/main/ui/static/analysis/templates/settle_report.html
index b335ae010..c91528f4d 100644
--- a/src/main/ui/static/analysis/templates/settle_report.html
+++ b/src/main/ui/static/analysis/templates/settle_report.html
@@ -10,20 +10,23 @@