diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java index 0e98c9127..7f7c3c111 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/CommonSubMerchantIdMapper.java @@ -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 list(@Param("is_valid") boolean is_valid, @Param("sub_merchant_id") String sub_merchant_id,PageBounds pageBounds); + PageList 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); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java index 27a6a44d8..5e0fc4fc9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchantid/web/MerchantIdManageController.java @@ -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 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 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) diff --git a/src/main/ui/static/payment/merchantid/merchant_id_manager.js b/src/main/ui/static/payment/merchantid/merchant_id_manager.js index e78dddfcd..b184544da 100644 --- a/src/main/ui/static/payment/merchantid/merchant_id_manager.js +++ b/src/main/ui/static/payment/merchantid/merchant_id_manager.js @@ -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', diff --git a/src/main/ui/static/payment/merchantid/templates/temp_sub_merchant_id.html b/src/main/ui/static/payment/merchantid/templates/temp_sub_merchant_id.html index c9acf4d2c..da6a4bbb7 100644 --- a/src/main/ui/static/payment/merchantid/templates/temp_sub_merchant_id.html +++ b/src/main/ui/static/payment/merchantid/templates/temp_sub_merchant_id.html @@ -1,11 +1,23 @@
-
- - - Add - +
+ +
+
+ +
+
+ +
+
@@ -35,4 +47,20 @@
+