export merchant excel ui button

master
yixian 5 years ago
parent cf7e8cbcaa
commit 75a7461009

@ -21,7 +21,6 @@ public class AppPermissionSupportImpl implements AppPermissionSupport {
private SysAppsMapper sysAppsMapper;
private final String signTemplate = "%s&%s&%s&%s&%s";
private Logger logger = LoggerFactory.getLogger(getClass());
public static final String[] NODES_IP_ADDRESSS = new String[]{"119.28.3.196","150.109.64.108", "119.28.178.24", "119.28.24.146", "119.28.77.25"};
@Override
public JSONObject validateSign(String appid, long timestamp, String ip, String requestUri, String sign) {
@ -42,18 +41,9 @@ public class AppPermissionSupportImpl implements AppPermissionSupport {
}
String auth = app.getString("auth_code");
String str = String.format(signTemplate, appid, auth, timestamp, requestUri, ip);
logger.debug("sso-str before hash:" + str);
logger.debug("sso-str before hash:{}", str);
String hash = DigestUtils.sha256Hex(str).toLowerCase();
if (!StringUtils.equals(hash, sign)) {
for (String nodeIp : NODES_IP_ADDRESSS) {
logger.error("[{}]请求的签名有误,使用节点 [{}] 签名", appid, nodeIp);
str = String.format(signTemplate, appid, auth, timestamp, requestUri, nodeIp);
logger.debug("NodeIp check sso-str before hash:" + str);
hash = DigestUtils.sha256Hex(str).toLowerCase();
if (StringUtils.equals(hash, sign)) {
return app;
}
}
throw new ForbiddenException("InvalidSign");
}
return app;

@ -58,7 +58,7 @@ public class SSOSupportImpl implements SSOSupport {
public String cacheClient(String appid, JSONObject clientUser) {
String code = Long.toString(System.currentTimeMillis(), 36) + RandomStringUtils.random(10, true, true);
String cacheKey = accountCacheKey("client", appid, code);
logger.debug("========cacheClient,key:"+cacheKey+"========");
logger.debug("========cacheClient,key:{}========", cacheKey);
stringRedisTemplate.boundValueOps(cacheKey).set(clientUser.toJSONString(), 30, TimeUnit.SECONDS);
return code;
}
@ -70,7 +70,7 @@ public class SSOSupportImpl implements SSOSupport {
private JSONObject getCachedAccount(String appid, String code, String type) {
String cacheKey = accountCacheKey(type, appid, code);
logger.debug("========getCachedAccount,key:"+cacheKey+"========");
logger.debug("========getCachedAccount,key:{}========", cacheKey);
String jsonstr = stringRedisTemplate.boundValueOps(cacheKey).get();
stringRedisTemplate.delete(cacheKey);
if (jsonstr != null) {
@ -81,7 +81,7 @@ public class SSOSupportImpl implements SSOSupport {
@Override
public JSONObject getCachedClientAccount(String appid, String code) {
logger.debug("========getCachedClientAccount,appid:"+appid+",code:"+code+"========");
logger.debug("========getCachedClientAccount,appid:{},code:{}========", appid, code);
return getCachedAccount(appid, code, "client");
}

@ -83,7 +83,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
var removeClientPayDesc = function (items, key) {
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.indexOf(key)>=0) {
if (item.indexOf(key) >= 0) {
items.splice(items.indexOf(item), 1);
i = i - 1;
}
@ -225,6 +225,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
});
};
$scope.exportPartnersExcel = function () {
var params = angular.copy($scope.params);
var param_str = keys(params).map(function (key) {
var value = params[key];
if (angular.isDate(value)) {
value = $filter('date')(value, 'yyyy-MM-ddTHH:mm:ssZ')
}
return key + '=' + encodeURIComponent(value)
}).join('&');
window.open('/sys/partners/exporting_excel?'+param_str)
};
/*$scope.loadLocations = function () {
var params = angular.copy($scope.params);
$http.get('/sys/partners/merchant/list_locations', {params: params}).then(function (resp) {
@ -411,7 +423,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
}
$scope.toggleClientPayType = function (type) {
if ($scope.partner.client_pay_type==null || $scope.partner.client_pay_type==undefined){
if ($scope.partner.client_pay_type == null || $scope.partner.client_pay_type == undefined) {
$scope.partner.client_pay_type = [];
}
var $idx = $scope.partner.client_pay_type.indexOf(type);
@ -424,13 +436,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
};
$scope.toggleClientPayDesc = function (type) {
if ($scope.partner.client_pay_desc==null || $scope.partner.client_pay_desc==undefined){
if ($scope.partner.client_pay_desc == null || $scope.partner.client_pay_desc == undefined) {
$scope.partner.client_pay_desc = [];
}
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
removeClientPayDesc($scope.partner.client_pay_desc, '2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
@ -544,7 +556,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.merchantIsValid = false;
return;
}
$http.get('/sys/partners/init/check_code_isvalid',{params:{clientMoniker:code}}).then(function (response) {
$http.get('/sys/partners/init/check_code_isvalid', {params: {clientMoniker: code}}).then(function (response) {
$scope.merchantIsValid = response.data;
$scope.merchantCodeChecked = true;
});
@ -604,7 +616,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
alert("Logo is necessary!");
return;
}
if ($scope.partner.client_pay_type.indexOf('2')>=0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
@ -624,11 +636,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
}
if ($scope.partner.client_pay_type.length==0) {
if ($scope.partner.client_pay_type.length == 0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
if ($scope.partner.client_pay_desc.length == 0) {
alert('请选择商户支付方式')
return;
}
@ -643,7 +655,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
@ -1256,7 +1268,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
removeClientPayDesc($scope.partner.client_pay_desc, '2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
@ -1388,11 +1400,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
if (!origin_referrer_id && $scope.partner.referrer_id) {
content = 'Update partner info successfully,But You Had add new Referrer,Please Change the BD Commission Proportion!';
}
if ($scope.partner.client_pay_type.length==0) {
if ($scope.partner.client_pay_type.length == 0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
if ($scope.partner.client_pay_desc.length == 0) {
alert('请选择商户支付方式')
return;
}
@ -1402,7 +1414,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
@ -1764,7 +1776,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
commonDialog.confirm({
title: 'Warning',
content: '是否使用该商户的现有信息进件?',
json:$scope.alipayOnline_gms_json
json: $scope.alipayOnline_gms_json
}).then(function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () {
commonDialog.alert({title: 'Success', content: '提示AlipayOnline进件成功', type: 'success'});
@ -2256,8 +2268,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
app.controller('partnerSubCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $uibModal) {
$scope.toShow = false;
$scope.init = {
child_each_refund : false,
sub_manage : false
child_each_refund: false,
sub_manage: false
}
$scope.newSubClient = function () {
@ -2861,7 +2873,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
removeClientPayDesc($scope.partner.client_pay_desc, '2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
@ -2957,7 +2969,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.merchantIsValid = false;
return;
}
$http.get('/sys/partners/init/check_code_isvalid',{params:{clientMoniker:code}}).then(function (response) {
$http.get('/sys/partners/init/check_code_isvalid', {params: {clientMoniker: code}}).then(function (response) {
$scope.merchantIsValid = response.data;
$scope.merchantCodeChecked = true;
});
@ -3018,7 +3030,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
alert("Logo is necessary!");
return;
}
if ($scope.partner.client_pay_type.indexOf('2')>=0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if (!$scope.partner.company_photo) {
alert('Shop Photo1 is necessary');
return;
@ -3032,11 +3044,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
// alert("Please Locate Merchant Location!");
// return;
// }
if ($scope.partner.client_pay_type.length==0) {
if ($scope.partner.client_pay_type.length == 0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
if ($scope.partner.client_pay_desc.length == 0) {
alert('请选择商户支付方式')
return;
}
@ -3046,7 +3058,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;

@ -386,6 +386,9 @@
ng-click="loadPartners(1)"><i
class="fa fa-search"></i> Search
</button>
<button class="btn btn-primary" type="button" ng-if="'export_clients_excel'|withFunc" ng-click="exportParntersExcel()">
<i class="fa fa-save"></i> Export
</button>
<!-- 商户分布以及商户进件位置转移 -->
<!--<button ng-if="mapFrame" class="btn btn-primary" type="button"
ng-click="loadLocations()"><i

Loading…
Cancel
Save