[Y] 通用商户号功能优化

master
taylor.dang 6 years ago
parent 4523d77eee
commit fb9d6da733

@ -10,15 +10,13 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import java.util.List;
/** /**
* Create by yixian at 2017-12-05 23:13 * Create by yixian at 2017-12-05 23:13
*/ */
@AutoMapper(tablename = "pmt_sub_merchant_id", pkName = "sub_merchant_id") @AutoMapper(tablename = "pmt_sub_merchant_id", pkName = "sub_merchant_id")
public interface CommonSubMerchantIdMapper { public interface CommonSubMerchantIdMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
List<JSONObject> list(@Param("is_valid") boolean is_valid, @Param("sub_merchant_id") String sub_merchant_id,PageBounds pageBounds); PageList<JSONObject> list(@Param("is_valid") boolean isValid, @Param("sub_merchant_id") String subMerchantId, PageBounds pageBounds);
@AutoSql(type = SqlType.INSERT) @AutoSql(type = SqlType.INSERT)
void save(JSONObject record); void save(JSONObject record);
@ -27,6 +25,6 @@ public interface CommonSubMerchantIdMapper {
void update(JSONObject record); void update(JSONObject record);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("sub_merchant_id")String sub_merchant_id); JSONObject find(@Param("sub_merchant_id") String subMerchantId);
} }

@ -6,9 +6,12 @@ import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService;
import au.com.royalpay.payment.manage.permission.manager.RequireManager; import au.com.royalpay.payment.manage.permission.manager.RequireManager;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -54,8 +57,10 @@ public class MerchantIdManageController {
@RequestMapping(value = "/common_sub_merchant_id", method = RequestMethod.GET) @RequestMapping(value = "/common_sub_merchant_id", method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.OPERATOR}) @RequireManager(role = {ManagerRole.OPERATOR})
public List<JSONObject> listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id, @RequestParam(defaultValue = "true") boolean is_valid) { public JSONObject listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id,
return commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(Order.formString("create_time.desc"))); @RequestParam int page, @RequestParam(defaultValue = "true") boolean is_valid) {
PageList<JSONObject> list = commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(page, 20, Order.formString("create_time.desc")));
return PageListUtils.buildPageListResult(list);
} }
@RequestMapping(value = "/common_sub_merchant_id/{sub_merchant_id}", method = RequestMethod.POST) @RequestMapping(value = "/common_sub_merchant_id/{sub_merchant_id}", method = RequestMethod.POST)

@ -81,16 +81,18 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.pagination = {}; $scope.pagination = {};
$scope.params = {}; $scope.params = {};
$scope.loadTempSubMerchantId = function () { $scope.loadTempSubMerchantId = function (page) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params) || {};
params.page = page || $scope.pagination.page || 1;
if(!params.sub_merchant_id){ if(!params.sub_merchant_id){
delete params.sub_merchant_id; delete params.sub_merchant_id;
} }
$http.get('/sys/merchant_id/common_sub_merchant_id',{params: params}).then(function (resp) { $http.get('/sys/merchant_id/common_sub_merchant_id',{params: params}).then(function (resp) {
$scope.subMerchantIdList= resp.data; $scope.subMerchantIdList= resp.data.data;
$scope.pagination = resp.data.pagination;
}); });
}; };
$scope.loadTempSubMerchantId(); $scope.loadTempSubMerchantId(1);
$scope.save = function () { $scope.save = function () {
$uibModal.open({ $uibModal.open({
templateUrl: '/static/payment/merchantid/templates/new_common_sub_merchant_id.html', templateUrl: '/static/payment/merchantid/templates/new_common_sub_merchant_id.html',

@ -1,12 +1,24 @@
<div class="row"> <div class="row">
<div class="box-body table-responsive"> <div class="box-body table-responsive">
<div class="col-sm-12 col-xs-6"> <div class="form-group">
<a role="button" class="btn btn-primary pull-right" title="Add Sub Merchant Id" <div class="col-xs-4 col-sm-6" style="text-align: left">
<a role="button" class="btn btn-primary" title="Add Sub Merchant Id"
ng-click="save()"> ng-click="save()">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
Add Add
</a> </a>
</div> </div>
<div class="col-sm-6" style="text-align: right">
<div class="col-xs-4 col-sm-8">
<input class="form-control" placeholder="Sub Merchant Id" ng-model="params.sub_merchant_id" ng-enter="loadTempSubMerchantId(1)">
</div>
<div class="col-xs-4 col-sm-1">
<button class="btn btn-success" type="button" ng-click="loadTempSubMerchantId(1)">
<i class="fa fa-search"></i> Search
</button>
</div>
</div>
</div>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -35,4 +47,20 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="panel-footer" ng-if="subMerchantIdList.length > 0">
<uib-pagination class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadTempSubMerchantId()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
</div>
</div>
</div> </div>

Loading…
Cancel
Save