luoyang 6 years ago
parent 33bca80450
commit aba4101dd7

@ -6,4 +6,6 @@ public interface HfUpdateService {
String updateStatus();
String rpayUpdate();
}

@ -1,5 +1,6 @@
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.HfUpdateService;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
@ -23,6 +24,8 @@ public class HfUpdateImpl implements HfUpdateService {
private MpWechatApiProvider mpWechatApiProvider;
@Resource
private ClientConfigMapper clientConfigMapper;
@Resource
private RpayApi rpayApi;
@Override
public String updateStatus() {
@ -41,4 +44,14 @@ public class HfUpdateImpl implements HfUpdateService {
});
return "ok";
}
@Override
public String rpayUpdate() {
List<JSONObject> clientIds = clientMapper.findByrpayNotNull();
clientIds.forEach(dbResult -> {
rpayApi.modifySurchargeConfig(dbResult);
});
return "ok";
}
}

@ -4,6 +4,7 @@ import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient;
import au.com.royalpay.payment.channels.bestpay.runtime.BestPayClient;
import au.com.royalpay.payment.channels.jd.runtime.JDClient;
import au.com.royalpay.payment.channels.rpay.runtime.RpayClient;
import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient;
import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
@ -96,6 +97,8 @@ public class TestController implements ApplicationEventPublisherAware {
@Resource
private JDClient jdClient;
@Resource
private RpayClient rpayClient;
@Resource
private TradeLogService tradeLogService;
@Resource
private RetailAppService retailAppService;
@ -292,6 +295,11 @@ public class TestController implements ApplicationEventPublisherAware {
xmlStr = XmlFormatUtils.formatXml(elem);
res.put("xml", xmlStr);
break;
case "Rpay":
JSONObject orderInfo = rpayClient.queryOrderStatus(orderId);
String rpayjson = JSON.toJSONString(orderInfo, SerializerFeature.PrettyFormat);
res.put("xml", rpayjson);
break;
default:
throw new BadRequestException("Not Support channel:" + channel);
}
@ -403,4 +411,9 @@ public class TestController implements ApplicationEventPublisherAware {
public String hfClearAmount() {
return hfUpdateService.updateStatus();
}
@ManagerMapping(value = "/rpayUpdate", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER)
public String rpayUpdateClearing() {
return hfUpdateService.rpayUpdate();
}
}

@ -102,4 +102,6 @@ public interface ClientMapper {
@AutoSql(type = SqlType.UPDATE)
void updateRpayEnterpriseId(@Param("client_id") int clientId, @Param("rpay_enterprise_id") String rpayEnterpriseId);
List<JSONObject> findByrpayNotNull();
}

@ -3204,6 +3204,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException();
}
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skip_clearing));
client.put("skip_clearing", skip_clearing);
rpayApi.switchMerchantSettle(client);
}

@ -365,4 +365,8 @@
<select id="findByhfPayUrlNotNull" resultType="com.alibaba.fastjson.JSONObject">
select client_id,client_moniker FROM sys_clients WHERE hf_pay_url != ''
</select>
<select id="findByrpayNotNull" resultType="com.alibaba.fastjson.JSONObject">
select * FROM sys_clients WHERE rpay_enterprise_id != ''
</select>
</mapper>

@ -63,6 +63,10 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
url: '/hfupdate',
templateUrl: '/static/config/devtools/templates/hfupdate.html',
controller: 'hfupdateCtrl'
}).state('devtools.rpayupdate', {
url: '/rpayupdate',
templateUrl: '/static/config/devtools/templates/rpayupdate.html',
controller: 'rpayupdateCtrl'
})
}]);
app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
@ -384,6 +388,22 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}]);
app.controller('rpayupdateCtrl', ['$scope', '$http','$filter', function ($scope, $http,$filter) {
$scope.selecttotal = true;
$scope.update = function () {
$scope.totalhide = true;
$scope.selecttotal = false;
$http.put('/dev/rpayUpdate').then(function (resp) {
$scope.totalhide = false;
$scope.selecttotal = true;
}, function (resp) {
alert(resp.data.message);
})
}
}]);
return app;
});

@ -1,5 +1,5 @@
<section class="content-header">
<h1>更新HF短链接</h1>
<h1>更新HF短链接</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-cog"></i> Basic Config

@ -83,6 +83,10 @@
<i class="fa fa-credit-card-alt"></i>
更新HF短连接
</a>
<a class="btn btn-app" role="button" ui-sref=".rpayupdate">
<i class="fa fa-credit-card-alt"></i>
更新HF短连接
</a>
</div>
</div>
</section>

@ -0,0 +1,15 @@
<section class="content-header">
<h1>更新Rpay进件费率时间</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-cog"></i> Basic Config
</li>
<li><a ui-sref="^">Dev Tools</a></li>
<li class="active">rpayupdate</li>
</ol>
</section>
<section class="content">
<div class="box">
<button class="btn btn-primary" ng-click="update()">Update</button> <label ng-hide="selecttotal" style="padding-left: 30px">请稍后</label>
</div>
</section>
Loading…
Cancel
Save