Merge remote-tracking branch 'origin/master'

master
yixian 6 years ago
commit f0616d9323

@ -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.SqlType;
import java.util.List;
/**
* Create by yixian at 2017-12-05 23:13
*/
@AutoMapper(tablename = "pmt_sub_merchant_id", pkName = "sub_merchant_id")
public interface CommonSubMerchantIdMapper {
@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)
void save(JSONObject record);
@ -27,6 +25,6 @@ public interface CommonSubMerchantIdMapper {
void update(JSONObject record);
@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.tools.CommonConsts;
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.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -54,8 +57,10 @@ public class MerchantIdManageController {
@RequestMapping(value = "/common_sub_merchant_id", method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.OPERATOR})
public List<JSONObject> listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id, @RequestParam(defaultValue = "true") boolean is_valid) {
return commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(Order.formString("create_time.desc")));
public JSONObject listCommonSubMerchantId(@RequestParam(required = false) String sub_merchant_id,
@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)

@ -81,16 +81,18 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.pagination = {};
$scope.params = {};
$scope.loadTempSubMerchantId = function () {
var params = angular.copy($scope.params);
$scope.loadTempSubMerchantId = function (page) {
var params = angular.copy($scope.params) || {};
params.page = page || $scope.pagination.page || 1;
if(!params.sub_merchant_id){
delete params.sub_merchant_id;
}
$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 () {
$uibModal.open({
templateUrl: '/static/payment/merchantid/templates/new_common_sub_merchant_id.html',

@ -1,11 +1,23 @@
<div class="row">
<div class="box-body table-responsive">
<div class="col-sm-12 col-xs-6">
<a role="button" class="btn btn-primary pull-right" title="Add Sub Merchant Id"
ng-click="save()">
<i class="fa fa-plus"></i>
Add
</a>
<div class="form-group">
<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()">
<i class="fa fa-plus"></i>
Add
</a>
</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">
<thead>
@ -35,4 +47,20 @@
</tbody>
</table>
</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>

Loading…
Cancel
Save