Merge branch 'add_rpay_change_rate' into develop

master
luoyang 6 years ago
commit 234b07c54b

@ -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));

@ -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 -> {

@ -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