Merge branch 'develop'

master
taylor.dang 6 years ago
commit 43077e450e

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>0.2.0</version>
<version>0.2.0-dev</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -1,7 +1,9 @@
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.merchants.entity.impls.SwitchPermissionModify;
@ -40,6 +42,10 @@ public class ManualServiceimpl implements ManualService {
private SynchronizedScheduler synchronizedScheduler;
@Resource
private ClientModifySupport clientModifySupport;
@Resource
private RpayApi rpayApi;
@Resource
private ClientMapper clientMapper;
@Override
public void clientPostpone() {
@ -82,6 +88,9 @@ public class ManualServiceimpl implements ManualService {
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
if ("Rpay".equals(o.getString("rate_name"))) {
rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id));
}
});
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false));

@ -15,6 +15,10 @@ public class NotifyQueryBean {
private int page = 1;
private int limit = 20;
private String moniker;
// 新增orderId查询字段
private String orderId;
private String clientOrderId;
private String date;
private Boolean success;
@ -24,6 +28,11 @@ public class NotifyQueryBean {
if (StringUtils.isNotEmpty(moniker)) {
param.put("client_moniker", moniker);
}
if (StringUtils.isNotEmpty(orderId)) {
param.put("order_id", orderId);
}
if (StringUtils.isNotEmpty(clientOrderId)) {
param.put("client_order_id", clientOrderId);
}
@ -88,4 +97,12 @@ public class NotifyQueryBean {
public void setSuccess(Boolean success) {
this.success = success;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
}

@ -84,6 +84,7 @@ import au.com.royalpay.payment.manage.support.sms.SmsSender;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.manage.system.core.MailGunService;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
@ -1610,6 +1611,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
configNewClientRate(config, clientId, "hf", "hf_rate_value", org, "min_hf_rate");
configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate");
rpayApi.modifySurchargeConfig(client);
}
private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) {
@ -1651,6 +1654,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
configJson.put("manager_name", manager.getString("username"));
configJson.put("update_time", new Date());
clientRateMapper.updateConfig(configJson);
if ("Rpay".equals(configJson.getString("rate_name"))) {
rpayApi.modifySurchargeConfig(client);
}
int clientId = client.getIntValue("client_id");
JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat");
int cleanDays = changeRate.getIntValue("clean_days");
@ -3195,6 +3201,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skip_clearing));
rpayApi.switchMerchantSettle(client);
}
@Override

@ -1,6 +1,8 @@
package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.channels.rpay.runtime.RpayApi;
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.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
@ -52,6 +54,10 @@ public class PostponeClientTask {
private SynchronizedScheduler synchronizedScheduler;
@Resource
private ClientModifySupport clientModifySupport;
@Resource
private RpayApi rpayApi;
@Resource
private ClientMapper clientMapper;
@Scheduled(cron = "0 30 8 * * ?")
public void postponeClient() {
@ -93,7 +99,9 @@ public class PostponeClientTask {
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
if ("Rpay".equals(o.getString("rate_name"))) {
rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id));
}
});
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false));
adminAccounts.forEach(o -> {

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.log.NotifyErrorLogMapper">
<!--
原来的SQL语句
<select id="listErrorLogs" resultType="com.alibaba.fastjson.JSONObject">
SELECT l.* FROM log_notify_error l
<if test="client_moniker!=null">
@ -14,6 +16,36 @@
<if test="success!=null">and l.success=#{success}</if>
</where>
</select>
-->
<!-- 新增client_order_id字段SQL语句修改如下 -->
<select id="listErrorLogs" resultType="com.alibaba.fastjson.JSONObject">
SELECT lne.*, po.client_order_id
FROM log_notify_error lne
INNER JOIN pmt_orders po
ON lne.order_id = po.order_id
<if test = "client_moniker != null">
INNER JOIN sys_clients sc
ON sc.client_id = lne.client_id
AND sc.is_valid = 1
AND sc.client_moniker = #{client_moniker}
</if>
<where>
<if test = "order_id != null">
lne.order_id = #{order_id}
</if>
<if test = "client_order_id != null">
AND po.client_order_id = #{client_order_id}
</if>
<if test = "date != null">
AND DATE(lne.addtime) = DATE(#{date})
</if>
<if test = "success != null">
AND lne.success = #{success}
</if>
</where>
</select>
<select id="listUnsentOrders" resultType="com.alibaba.fastjson.JSONObject">
SELECT
order_id,

@ -24,6 +24,21 @@
is-open="dtCtrl.open" ng-click="dtCtrl.open=true">
</div>
</div>
<!-- 新增orderId查询条件 -->
<div class="form-group">
<label class="control-label col-sm-3"
for="orderIdInput">
Order ID
</label>
<div class="col-sm-7">
<input class="form-control"
type="text"
ng-model="params.orderId"
id="orderIdInput">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="clientOrderIdInput">Client Order ID</label>
<div class="col-sm-7">
@ -61,6 +76,7 @@
<tr>
<th>Time</th>
<th>Order ID</th>
<th>Client Order ID</th>
<th>Notify Url</th>
<th>Success</th>
<th>Http Code</th>
@ -71,7 +87,8 @@
<tr ng-repeat="log in notifyLogs">
<td ng-bind="log.addtime|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="log.order_id"></td>
<td ng-bind="log.notify_url|limitTo:50" title="{{log.notify_url}}"></td>
<td ng-bind="log.client_order_id"></td>
<td ng-bind="log.notify_url" title="{{log.notify_url}}"></td>
<td ng-bind="log.success?'Yes':'No'" ng-class="{'text-success':log.success,'text-danger':!log.success}"></td>
<td ng-bind="log.http_code"></td>
<td ng-bind="log.err_msg|limitTo:10" title="{{log.err_msg}}"></td>

@ -560,7 +560,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
};
}]);
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', function ($scope, $http, $state, commonDialog) {
$scope.paymentInfo = $scope.partner;
$scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate);
$scope.qrConfig = {currency: 'AUD'};
@ -829,7 +829,25 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.bankshow = false;
};
// 新增需求,商户端刷新支付秘钥
$scope.refreshCredential = function () {
commonDialog.confirm({
title: 'Warning',
content: 'Refresh Credential will expire the current one, ' +
'which will cause the current payment service disabled. ' +
'Are you sure going on?'
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/credential_code').then(function () {
$state.reload();
}, function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'error'
})
})
})
};
}]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {

@ -87,7 +87,15 @@
<div class="form-group">
<label class="control-label col-sm-2">Gateway Credential</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.credential_code"></p>
<p class="form-control-static">
<span ng-bind="partner.credential_code"></span>
<a role="button"
ng-click="refreshCredential()"
title="refresh"
ng-if="'111'|withRole">
<i class="fa fa-refresh"></i>
</a>
</p>
</div>
</div>
</div>

@ -160,30 +160,6 @@
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.hf_rate_value.$invalid && rate_form.hf_rate_value.$dirty}">
<label class="control-label col-sm-4" for="Rpay_rate_value_input">Rpay+ Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="jd_rate_value" stringToNumber2 class="form-control" ng-model="rate.Rpay_rate_value"
min="0.6" max="2.2" step="0.1" id="Rpay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.hf_rate_value.$error" ng-if="rate_form.hf_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="active_time_input">Active Date</label>
<div class="col-sm-6">

Loading…
Cancel
Save