wangning 6 years ago
parent 80332ebeac
commit 9d50f0c687

@ -8,6 +8,37 @@ public class PermissionClientVO {
private Long id;
private String clientMoniker;
private int clientId;
private boolean is_valid;
private boolean isValid;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getClientMoniker() {
return clientMoniker;
}
public void setClientMoniker(String clientMoniker) {
this.clientMoniker = clientMoniker;
}
public int getClientId() {
return clientId;
}
public void setClientId(int clientId) {
this.clientId = clientId;
}
public boolean getIsValid() {
return isValid;
}
public void setValid(boolean valid) {
isValid = valid;
}
}

@ -1,14 +1,19 @@
package au.com.royalpay.payment.manage.management.sysconfig.web;
import au.com.royalpay.payment.manage.management.sysconfig.beans.PermissionClientVO;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.system.core.PermissionClientMoudulesService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -25,14 +30,14 @@ public class SysPermissionClientController {
private PermissionClientMoudulesService permissionClientMoudulesService;
@RequestMapping(value = "/client/{client_id}/list", method = RequestMethod.GET)
public List<JSONObject> list(@PathVariable int client_id) {
return permissionClientMoudulesService.listByClientId(client_id);
@RequestMapping(value = "/list", method = RequestMethod.GET)
public List<JSONObject> list(@RequestParam String client_moniker) {
return permissionClientMoudulesService.listByClientMoniker(client_moniker);
}
@RequestMapping(value = "/client/{client_id}", method = RequestMethod.POST)
public List<JSONObject> modify(@PathVariable int client_id,) {
return permissionClientMoudulesService.listByClientId(client_id);
@RequestMapping(value = "/{id}", method = RequestMethod.POST)
public void modify(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject loginManager, @PathVariable Long id, @RequestBody PermissionClientVO permissionClientVO) {
permissionClientMoudulesService.switchValid(id,permissionClientVO.getIsValid(),loginManager);
}
}

@ -29,4 +29,7 @@ public interface SysPermissionClientMoudulesMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("id") Long id);
@AutoSql(type = SqlType.SELECT)
List<JSONObject> listByClientMoniker(@Param("client_moniker")String client_moniker);
}

@ -15,6 +15,8 @@ public interface PermissionClientMoudulesService {
List<JSONObject> listByClientId(int clientId);
List<JSONObject> listByClientMoniker(String clientMoniker);
void switchValid(Long id,boolean isValid,JSONObject account);
}

@ -9,6 +9,7 @@ import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;
@ -44,6 +45,12 @@ public class PermissionClientMoudulesServiceImpl implements PermissionClientMoud
return permissionClientMoudulesMapper.listByClientId(clientId);
}
@Override
@Cacheable(value = ":system:client_permission:", key = "#moniker")
public List<JSONObject> listByClientMoniker(String clientMoniker) {
return permissionClientMoudulesMapper.listByClientMoniker(clientMoniker);
}
@Override
public void switchValid(Long id, boolean isValid, JSONObject account) {
JSONObject record = permissionClientMoudulesMapper.find(id);

@ -163,6 +163,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
url: '/sub_merchant_applicaitons',
templateUrl: 'static/payment/partner/templates/sub_merchant_id_apply.html',
controller: 'subMerchantIdApplicaitonsCtrl'
}).state('partners.detail.permission_client', {
url: '/permission_client',
templateUrl: 'static/payment/partner/templates/partner_permission.html',
controller: 'permissionClientCtrl'
});
}]);
app.controller('partnerListCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
@ -2154,7 +2158,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.loadTradeLogs(1);
}
}]);
app.controller('partnerPluginsCtrl', ['$scope', '$uibModal', function ($scope, $uibModal) {
$scope.configRedpack = function () {
$uibModal.open({
@ -2184,7 +2187,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
}
}]);
app.controller('partnerDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder', function ($scope, $http, orderService, commonDialog, refunder) {
$scope.pagination = {};
$scope.listDevices = function (page) {
@ -2283,7 +2285,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
refunder.refunded(order.order_id)
};
}]);
app.controller('partnerRedpackConfigDialogCtrl', ['$scope', '$http', 'partner', 'config', function ($scope, $http, partner, config) {
$scope.config = config.data;
if (!Object.keys($scope.config).length) {
@ -2463,7 +2464,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.listRedpackLogs(1);
}]);
app.controller('partnerAuthFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) {
$scope.file = file.data || {};
@ -2685,7 +2685,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.complianceChangeCheck();
}]);
app.controller('partnerSettlementCtrl', ['$scope', '$uibModal', '$http', 'clientMoniker', '$filter', function ($scope, $uibModal, $http, clientMoniker, $filter) {
$scope.params = {};
$scope.pagination = {};
@ -2773,7 +2772,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
};
$scope.channelAndDayOfAnalysis(1);
}]);
app.controller('productCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', '$state', 'Upload', 'industryMap', function ($scope, $http, $uibModal, commonDialog, $state, Upload, industryMap) {
$scope.importShow = 0;
$scope.pagination = {};
@ -2972,6 +2970,30 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
}
}]);
app.controller('permissionClientCtrl', ['$scope', '$http', '$uibModal', '$state', '$filter', 'commonDialog','clientMoniker', function ($scope, $http, $uibModal, $state, $filter, commonDialog,clientMoniker) {
$scope.partner = {client_moniker:clientMoniker};
$scope.loadPermissionList = function () {
$http.get('/sys/permission/list',partner).then(function (resp) {
$scope.permissionList = resp.data;
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
});
};
$scope.switchValid = function (id,valid) {
$scope.partner.isValid = valid;
$http.post('/sys/permission/'+id,$scope.partner).then(function (resp) {
},function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
})
};
}]);
app.filter('bdOrg', function () {
return function (bdUsers, org_id) {
if (org_id) {

@ -253,6 +253,9 @@
<li ui-sref-active="active" ng-if="('10'|withRole)">
<a ui-sref=".sub_merchant_applicaitons">Wechat Merchant Id Applicaitons</a>
</li>
<li ui-sref-active="active" ng-if="('10'|withRole)">
<a ui-sref=".permission_client">Wechat Merchant Id Applicaitons</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div class="panel panel-default">

@ -0,0 +1,229 @@
<div class="row margin-bottom">
<div class="col-sm-12">
<div class="form-horizontal">
<div class="form-group col-xs-12">
<label class="col-xs-4 col-sm-2">
<select class="form-control" ng-model="params.textType">
<option value="all">ALL</option>
<option value="client_moniker">Partner Code</option>
<option value="client_name">Partner Name</option>
<option value="sys_trans_id">Platform Transaction ID</option>
<option value="channel">Channel</option>
<option value="order_id">Order ID</option>
<option value="remark">Remark</option>
</select>
</label>
<div class="col-sm-4 col-xs-8">
<input class="form-control" placeholder="Keyword" ng-enter="loadTradeLogs(1)"
ng-model="params.searchText">
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.status=='ALL'}"
ng-click="params.status='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PAID'}"
ng-click="params.status='PAID';loadTradeLogs(1)">Payment Success</a> |
<a role="button" ng-class="{'bg-primary':params.status=='ALL_REFUNDED'}"
ng-click="params.status='ALL_REFUNDED';loadTradeLogs(1)">All Refund</a> |
<a role="button" ng-class="{'bg-primary':params.status=='PARTIAL_REFUNDED'}"
ng-click="params.status='PARTIAL_REFUNDED';loadTradeLogs(1)">Partial Refund</a> |
<a role="button" ng-class="{'bg-primary':params.status=='FULL_REFUNDED'}"
ng-click="params.status='FULL_REFUNDED';loadTradeLogs(1)">Full Refund</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Gateway</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.gateway==null}"
ng-click="params.gateway=null;loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([0,1])}"
ng-click="params.gateway=[0,1];loadTradeLogs(1)">Retail In-Store</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([5,6])}"
ng-click="params.gateway=[5,6];loadTradeLogs(1)">Retail API</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([2,7])}"
ng-click="params.gateway=[2,7];loadTradeLogs(1)">QR Code</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([3])}"
ng-click="params.gateway=[3];loadTradeLogs(1)">Online API</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([4])}"
ng-click="params.gateway=[4];loadTradeLogs(1)">WeChat HTML5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([8])}"
ng-click="params.gateway=[8];loadTradeLogs(1)">Mobile H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([9])}"
ng-click="params.gateway=[9];loadTradeLogs(1)">Third Party Gateway</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([10])}"
ng-click="params.gateway=[10];loadTradeLogs(1)">APP</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([11])}"
ng-click="params.gateway=[11];loadTradeLogs(1)">Share Code</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([12])}"
ng-click="params.gateway=[12];loadTradeLogs(1)">MiniProgram</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([13])}"
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR Code</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([14])}"
ng-click="params.gateway=[14];loadTradeLogs(1)">Share Link</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Channel</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':params.channel=='ALL'}"
ng-click="params.channel='ALL';loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='WECHAT'}"
ng-click="params.channel='WECHAT';loadTradeLogs(1)">Wechat Pay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAY'}"
ng-click="params.channel='ALIPAY';loadTradeLogs(1)">Alipay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='ALIPAYONLINE'}"
ng-click="params.channel='ALIPAYONLINE';loadTradeLogs(1)">AlipayOnline</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='BESTPAY'}"
ng-click="params.channel='BESTPAY';loadTradeLogs(1)">BestPay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='JD'}"
ng-click="params.channel='JD';loadTradeLogs(1)">JDpay</a> |
<a role="button" ng-class="{'bg-primary':params.channel=='HF'}"
ng-click="params.channel='HF';loadTradeLogs(1)">HFpay</a>
</p>
</div>
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Date Range</label>
<div class="col-sm-10 col-xs-8">
<div class="form-control-static form-inline">
<div style="display: inline-block">
<input class="form-control" id="date-from-input" ng-model="params.datefrom"
uib-datepicker-popup size="10" placeholder="From"
is-open="dateBegin.open" ng-click="dateBegin.open=true"
datepicker-options="{maxDate:params.dateto||today}">
</div>
~
<div style="display: inline-block">
<input class="form-control" id="date-to-input" ng-model="params.dateto"
uib-datepicker-popup size="10" placeholder="To"
is-open="dateTo.open" ng-click="dateTo.open=true"
datepicker-options="{minDate:params.datefrom,maxDate:today}">
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">Today</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">Yesterday</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm"
ng-click="chooseLast7Days()">Last 7
Days</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm" ng-click="thisMonth()">This
Month</a>
</div>
<div class="btn-group">
<a role="button" class="btn btn-default btn-sm" ng-click="lastMonth()">Last
Month</a>
</div>
</div>
</div>
</div>
<div class="form-group col-xs-12" ng-if="partner.has_children">
<label class="control-label col-xs-4 col-sm-2">Sub Partner</label>
<div class="col-sm-10 col-xs-8">
<p class="form-control-static">
<a role="button" ng-class="{'bg-primary':isAll}" ng-click="chooseClient('all')">All</a>
<label ng-repeat="sub in clients">
|&nbsp;<a role="button" ng-class="{'bg-primary':sub.client_id==chooseClientId}"
ng-click="chooseClient(sub.client_id)">{{sub.short_name}}</a>&nbsp;
</label>
</p>
</div>
</div>
<button class="btn btn-success" type="button" ng-click="loadTradeLogs(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h3 class="box-title" style="display: inherit">Orders
<span class="small" ng-if="tradeLogs.length">(Found {{pagination.totalCount}} orders and {{analysis.order_count}} transactions worth of {{analysis.paid_fee|currency:'AUD'}})</span>
<span style="float: right;font-size: 14px;">Pre Authorization:<i class="fa fa-stop" aria-hidden="true" style="color: #fff2a5"></i></span>
</h3>
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Client Order ID</th>
<th>Order ID</th>
<th>Amount</th>
<th>Input Amount</th>
<th>AUD Amount</th>
<th>Exchange Rate</th>
<th>Status</th>
<th>Create Time</th>
<th>Gateway</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="trade in tradeLogs" ng-class="{warning:trade.clearing_status==2}">
<td ng-bind="trade.client_order_id||'NOT PROVIDED'"></td>
<td>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="Znyoo" ng-if="trade.channel=='Znyoo'"/>
<img src="/static/images/wechatpay_sign.png" uib-tooltip="WechatPay" ng-if="trade.channel=='Wechat'"/>
<img src="/static/images/bestpay_sign.png" uib-tooltip="BestPay" ng-if="trade.channel=='Bestpay'"/>
<img src="/static/images/alipay_sign.png" uib-tooltip="Alipay" ng-if="trade.channel=='Alipay'"/>
<img src="/static/images/alipay_sign.png" uib-tooltip="AlipayOnline" ng-if="trade.channel=='AlipayOnline'"/>
<img src="/static/images/jd_sign.png" uib-tooltip="JD Pay" ng-if="trade.channel=='jd'"/>
<img src="/static/images/hf_sign.png" uib-tooltip="HF Pay" ng-if="trade.channel=='hf'"/>
{{trade.order_id}}
</td>
<td>
{{trade.total_amount|currency:trade.currency+' '}}
<a ng-if="trade.refund_fee" class="text-danger" role="button"
ng-click="showRefundLog(trade.order_id)">(-{{trade.refund_fee}})</a>
</td>
<td ng-bind="trade.display_amount|currency:trade.currency"></td>
<td ng-bind="trade.clearing_amount|currency:'AUD '"></td>
<td ng-bind="trade.exchange_rate"></td>
<td ng-bind="trade.status|tradeStatus"></td>
<td ng-bind="trade.create_time"></td>
<td ng-bind="trade.gateway|tradeGateway"></td>
<td>
<a role="button" class="text-bold" ng-click="showTradeDetail(trade)" title="Detail">
<i class="fa fa-list-alt"></i>
</a>
<a role="button" ng-if="trade.status>=5 && trade.confirm_time!=null && trade.clearing_status<2 && ('do_refund'|withFunc)"
class="text-bold text-danger"
ng-click="newRefund(trade.order_id)" title="Refund">
<i class="fa fa-undo"></i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<uib-pagination ng-if="tradeLogs.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadTradeLogs()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
Loading…
Cancel
Save