Merge remote-tracking branch 'origin/develop' into develop

master
yixian 6 years ago
commit 4430a5ac4a

@ -4,15 +4,14 @@ import au.com.royalpay.payment.core.risk.bean.RiskTypeEnum;
import au.com.royalpay.payment.manage.logview.beans.LogRiskQueryBean;
import au.com.royalpay.payment.manage.mappers.log.LogRiskMapper;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@ -30,14 +29,14 @@ public class LogRiskController {
@Resource
private TradeLogService tradeLogService;
@RequestMapping(value = "/risk_log/list", method = RequestMethod.GET)
@GetMapping(value = "/risk_log/list")
public JSONObject listLogRisk(LogRiskQueryBean logRiskQueryBean) {
return PageListUtils.buildPageListResult(
logRiskMapper.listWithClientInfo(logRiskQueryBean.toParams(), new PageBounds(logRiskQueryBean.getPage(), logRiskQueryBean.getLimit())));
}
@RequestMapping(value = "/risk_log/typeCharts", method = RequestMethod.GET)
@GetMapping(value = "/risk_log/typeCharts")
public JSONObject typeCharts(LogRiskQueryBean logRiskQueryBean) {
List<JSONObject> statisticsRiskLogList = logRiskMapper.statisticsRiskLog(logRiskQueryBean.toParams());
if (CollectionUtils.isEmpty(statisticsRiskLogList)) {
@ -84,7 +83,7 @@ public class LogRiskController {
return result;
}
@RequestMapping(value = "/pre_refund/list", method = RequestMethod.GET)
@GetMapping(value = "/pre_refund/list")
public JSONObject listPreRefund(PreRefundQueryBean preRefundQueryBean) {
return PageListUtils.buildPageListResult(tradeLogService.listPreRefundClients(preRefundQueryBean));
}

@ -4,11 +4,7 @@ import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.tasksupport.SettlementSupport;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.log.ValidationLogMapper;
import au.com.royalpay.payment.manage.mappers.log.*;
import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
@ -34,16 +30,15 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.lock.Locker;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.tasksupport.TaskFinishNotifyEvent;
import au.com.royalpay.payment.tools.utils.DateVaildUtil;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
@ -52,12 +47,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.joda.time.DateTime;
import org.joda.time.Days;
@ -75,37 +65,20 @@ import org.springframework.util.CollectionUtils;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Currency;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
/**
@ -163,7 +136,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Resource
private ClientDeviceMapper clientDeviceMapper;
private static final int MAX_TRACK_DAYS = 31;
@Value("${app.settlement.email-to}")
private String settlementEmailTo;
@Value("${app.settlement.email-cc}")
@ -627,9 +600,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Override
public JSONObject getCleanLogsInClients(ClearingLogQuery query, JSONObject manager) {
JSONObject params = query.toParams();
DateVaildUtil.validDateDuration(params.getDate("from"), params.getDate("to"), MAX_TRACK_DAYS);
if (query.getClientMoniker() != null && !query.getClientMoniker().isEmpty()) {
JSONObject client = clientManager.getClientInfoByMoniker(query.getClientMoniker());
Assert.notNull(client);
}
if (manager.getInteger("org_id") != null) {
params.put("org_id", manager.getIntValue("org_id"));
@ -642,9 +615,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Override
public JSONObject analysisCleanLogs(ClearingLogQuery query, JSONObject manager) {
JSONObject params = query.toParams();
DateVaildUtil.validDateDuration(params.getDate("from"), params.getDate("to"), MAX_TRACK_DAYS);
if (query.getClientMoniker() != null && !query.getClientMoniker().isEmpty()) {
JSONObject client = clientManager.getClientInfoByMoniker(query.getClientMoniker());
Assert.notNull(client);
}
if (manager.getInteger("org_id") != null) {
params.put("org_id", manager.getIntValue("org_id"));

@ -54,7 +54,7 @@ public class ManagerPermissionScanner implements BeanPostProcessor, PermissionRe
PermissionNode node = new PermissionNode(controller.getSimpleName(), method.getName());
getRequestInfo(node, clazzRequestMapping, methodMapping);
node.setPermissions(clazzPermission, methodPermission);
logger.debug("register permission:" + node.getFuncName() + ":" + node.getRequestId());
logger.trace("register permission:{}:{}", node.getFuncName(), node.getRequestId());
if (permissionNodes.containsKey(node.getFuncId())) {
throw new RuntimeException("Duplicated permission function ID:" + controller.getName() + "." + method.getName());
}

@ -307,14 +307,16 @@
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
</select>
<select id="listPreRefundClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT ifnull(sum(if(transaction_type = 'Credit', clearing_amount, -clearing_amount)), 0) amount,
cc.client_id client_id,
max(t.transaction_time) transation_time,
cc.client_moniker client_moniker
from (select client_id,client_moniker from sys_client_config where enable_refund_auth=1) cc
inner join pmt_transactions t on cc.client_id = t.client_id
GROUP BY cc.client_id
having amount &lt; 0
SELECT sc.client_id,
sc.client_moniker,
IFNULL(SUM(IF(pt.transaction_type = 'Credit', pt.clearing_amount, -pt.clearing_amount)), 0) amount,
IFNULL(MAX(pt.create_time), sc.approve_time) transation_time
FROM pmt_transactions pt,
sys_clients sc
WHERE clearing_status = 0
AND pt.client_id = sc.client_id
GROUP BY client_id
HAVING amount &lt; 0
</select>
<select id="validAnalysis" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[

@ -113,7 +113,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}
$scope.chooseOrg = function (org) {
if (org == 'all') {
if (org === 'all') {
delete $scope.params.org_id;
$scope.showOrg = 'All'
} else {
@ -135,6 +135,8 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$http.get('/sys/clean_logs/clients', {params: params}).then(function (resp) {
$scope.clearing_logs = resp.data.data;
$scope.pagination = resp.data.pagination;
}, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
});
analysisLog(params);
};
@ -144,8 +146,6 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
})
};
$scope.loadClearingLogs(1);
$scope.loadClearingLogsHistory = function (days) {
var endDate = new Date();
var startDate = new Date();

@ -99,10 +99,6 @@
<a role="button" class="btn btn-default btn-sm"
ng-click="lastMonth()">Last Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="thisYear()">This Year</a>
</div>
<div uib-dropdown ng-if="orgs" class="btn-group">
<button id="single-button" type="button" class="btn btn-default"
uib-dropdown-toggle ng-disabled="disabled">

@ -699,10 +699,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.showFile();
$scope.passClient = function () {
if (!$scope.partner.wechat_institution_merchant_id) {
commonDialog.alert({title: 'info', content: 'Wechat Institution Merchant Id not Refresh', type: 'info'});
return;
}
$scope.refreshWechatInstitutionMerchantId();
if ($scope.partner.enable_hf) {
if ($scope.partner.hfindustry == null) {
alert("已开启HF支付通道HF行业不可为空!");
@ -775,14 +772,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
});
};
$scope.pass2GreenChannel = function () {
if (!$scope.partner.wechat_institution_merchant_id) {
commonDialog.alert({
title: 'info',
content: 'Wechat Institution Merchant Id not Refresh',
type: 'info'
});
return;
}
$scope.refreshWechatInstitutionMerchantId();
commonDialog.confirm({
title: 'Green Channel Audit Partner',
content: 'Are you sure to mark partner ' + $scope.partner.company_name + ' green channel audited '
@ -1559,20 +1549,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.ctrl = {};
$scope.saveSubMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: $scope.paymentInfo.sub_merchant_id}).then(function (resp) {
$scope.refreshInstitutionAfterSaveMerchantId();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.refreshInstitutionAfterSaveMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Modify Wechat Sub Merchant ID And Refresh Wechat Institution Merchant Id successfully',
type: 'success'
});
$scope.loadPartnerPaymentInfo();
$scope.refreshWechatInstitutionMerchantId();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
@ -1580,11 +1557,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.refreshWechatInstitutionMerchantId = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', {wechat_institution_merchant_id: $scope.paymentInfo.wechat_institution_merchant_id}).then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Refresh Wechat Institution Merchant Id successfully',
type: 'success'
});
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
@ -1610,7 +1582,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
content: '是否使用该商户的现有信息进件?',
json:$scope.alipay_gms_json
}).then(function () {
if ($scope.partner.business_structure == "Company") {
if ($scope.partner.business_structure === "Company") {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms', {representative_id: ""}).then(function () {
commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'});
}, function (resp) {
@ -1634,7 +1606,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}, function (resp) {
commonDialog.alert({title: 'Error', content: "查询失败:" + resp.data.message, type: 'error'});
})
}
};
$scope.submitAlipayOnlineSubId = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipayOnline_gms_json').then(function (resp) {
$scope.alipayOnline_gms_json = resp.data;

Loading…
Cancel
Save