From 59b80bd0b5beeef862a91d2e9642222698e0230e Mon Sep 17 00:00:00 2001 From: yangkai Date: Thu, 25 Oct 2018 16:57:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=E5=95=86=E6=88=B7=E5=90=88=E8=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/merchants/core/ClientManager.java | 2 ++ .../core/impls/ClientManagerImpl.java | 27 +++++++++++++++++++ .../web/PartnerManageController.java | 6 +++++ .../static/payment/partner/partner-manage.js | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 9589510d6..f19d10018 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -349,4 +349,6 @@ public interface ClientManager { * @param clientId */ boolean postponeClientRate(int clientId, String clientMoniker,String nextYearExipryDate); + + JSONObject comListPartnerSelection(JSONObject manager, PartnerQuery query); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 3935ab763..0520f541e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -4047,6 +4047,33 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } + @Override + public JSONObject comListPartnerSelection(JSONObject manager, PartnerQuery query) { + JSONObject params = query.toJsonParam(); + String tempSubMchId = sysConfigManager.getSysConfig().getString("temp_sub_mch_id"); + String tempSubMchSource = sysConfigManager.getSysConfig().getString("temp_sub_mch_id_source"); + tempSubMchSource = tempSubMchSource == null ? "" : tempSubMchSource; + if (query.isTempMchId()) { + params.put("temp_mch_id", tempSubMchId); + params.put("temp_mch_id_source", tempSubMchSource); + } + PageList partners = clientMapper.comListPartners(params, + new PageBounds(query.getPage(), query.getLimit(), Order.formString("is_valid.desc,-approve_time.asc,create_time.desc"))); + int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期 + for (JSONObject partner : partners) { + String subMerchantId = partner.getString("sub_merchant_id"); + if (subMerchantId != null && tempSubMchId != null && tempSubMchId.contains(subMerchantId) + && !tempSubMchSource.contains(partner.getString("client_moniker"))) { + partner.put("temp_sub_merchant", true); + } + if (partner.getIntValue("approve_result") == 2) { + partner.put("expiry_time", DateUtils.addDays(partner.getDate("approve_time"), authDays)); + partner.put("pass_timeout", DateUtils.addDays(partner.getDate("approve_time"), authDays).compareTo(new Date()) < 0); + } + } + return PageListUtils.buildPageListResult(partners); + } + private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) { TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 76edb9f5c..52d4c1681 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -585,4 +585,10 @@ public class PartnerManageController { clientManager.subRpayMerchantApplication(clientMoniker, merchantInfo,manager); } + @RequestMapping(value = "/compliance", method = RequestMethod.GET) + @RequireManager(role = { ManagerRole.OPERATOR}) + public JSONObject lisPartnersByCompliance(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, PartnerQuery query) { + return clientManager.comListPartnerSelection(manager, query); + } + } diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 534f7723a..f2b4f9800 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -305,7 +305,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.loadPartners = function (page) { var params = angular.copy($scope.params); params.page = page || $scope.pagination.page || 1; - $http.get('/sys/partners', {params: params}).then(function (resp) { + $http.get('/sys/partners/compliance', {params: params}).then(function (resp) { $scope.partners = resp.data.data; $scope.pagination = resp.data.pagination; });