From 3aa2ed5275e877340c7695d7ff9e233d0d7d5fbe Mon Sep 17 00:00:00 2001 From: dulingling Date: Fri, 27 Nov 2020 10:27:57 +0800 Subject: [PATCH] =?UTF-8?q?Upd:=E6=B7=BB=E5=8A=A0=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=AD=90=E5=95=86=E6=88=B7=E8=BF=9B=E4=BB=B6=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysWxMerchantApplyMapper.java | 2 +- .../manage/merchants/core/ClientManager.java | 2 ++ .../core/impls/ClientManagerImpl.java | 21 +++++++++++++++++++ .../web/PartnerManageController.java | 5 +++++ .../static/payment/partner/partner-manage.js | 13 +++++++++++- .../templates/partner_payment_info.html | 2 +- 6 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java index 913a582e8..08ffa592c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysWxMerchantApplyMapper.java @@ -15,7 +15,7 @@ import java.util.List; */ @AutoMapper(tablename = "sys_wx_merchant_apply",pkName = "merchant_app_id") public interface SysWxMerchantApplyMapper { -` ` + @Select("SELECT * FROM sys_wx_merchant_apply WHERE client_id = #{client_id} and is_valid = 1") List listWxMerchantApplices(@Param("client_id") int client_id, PageBounds pageBounds); 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 a84efa15e..66661665e 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 @@ -438,6 +438,8 @@ public interface ClientManager { void changeApplicationSubMerchantById(String clientMoniker, String merchantAppId, NewSubMerchantIdApply subMerchantIdApply, JSONObject manager); + JSONObject querySubMerchantStatus(String clientMoniker,String subMerchantId); + void registerAlipayGms(String clientMoniker, JSONObject manager); void registerAlipayOnlineGms(String clientMoniker, JSONObject manager); 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 dd77f8ac4..7d1a8bc35 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 @@ -5695,7 +5695,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } + /** + * 修改指定微信子进件商户信息 + * @param clientMoniker + * @param merchantAppId + * @param subMerchantIdApply + * @param manager + */ @Override + @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") public void changeApplicationSubMerchantById(String clientMoniker, String merchantAppId, NewSubMerchantIdApply subMerchantIdApply, JSONObject manager){ JSONObject client = clientMapper.findClientByMoniker(clientMoniker); if (client == null) { @@ -5719,11 +5727,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (StringUtils.isNotEmpty(sub_merchant_id)) { params.put("sub_merchant_id", sub_merchant_id); sysWxMerchantApplyMapper.updateSubMerchantInfoByMerchantAppId(params); + clearCacheSubMerchantIdApplices(clientMoniker); } else { throw new BadRequestException(elem.elementText("return_msg")); } } + @Override + public JSONObject querySubMerchantStatus(String clientMoniker,String subMerchantId){ + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + throw new BadRequestException("partner code is not exists!"); + } + Element elem = wxPayClient.querySubMerchant(client.getString("merchant_id"), subMerchantId); + JSONObject object = new JSONObject(); + object.put("apply_status", elem.elementText("result_code")); + return object; + } + @Override public void registerAlipayGms(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); 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 4996a9b42..628043377 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 @@ -854,6 +854,11 @@ public class PartnerManageController { clientManager.changeApplicationSubMerchantById(clientMoniker, merchantAppId,subMerchantIdApply,manager); } + @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids/{subMerchantId}/status", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) + public JSONObject querySubMerchantStatus(@PathVariable("clientMoniker") String clientMoniker,@PathVariable("subMerchantId") String subMerchantId){ + return clientManager.querySubMerchantStatus(clientMoniker,subMerchantId); + } + @ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public void registerAlipayGms(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.registerAlipayGms(clientMoniker, manager); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index c7ea19ccf..102f725d8 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2536,6 +2536,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } + $scope.queryWechatSubMerchantIdStatus = function () { + $scope.paymentInfo.sub_merchant_id + $http.get('/sys/partners/'+$scope.paymentInfo.client_moniker+'/get_merchant_ids/'+$scope.paymentInfo.sub_merchant_id+'/status').then(function (resp) { + commonDialog.alert({ + title: 'Wechat Apply Status', + content: resp.data.apply_status, + type: 'info' + }) + }) + } + }]); app.controller('clientSubMerchantIdLogCtrl', ['$scope', '$http', 'logs', function ($scope, $http, logs) { $scope.logs = logs.data; @@ -5511,7 +5522,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); return; } - $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/get_merchant_ids/'+$scope.subMerchantInfo.merchant_app_id, $scope.subMerchantInfo).then(function (resp) { + $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/sub_apply', $scope.subMerchantInfo).then(function (resp) { $scope.apply_sub_merchant_id = resp.data; $scope.$close(); if (subMerchantInfo.sub_merchant_id != null) { diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index 444069381..ba38a51d2 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -10,9 +10,9 @@

{{paymentInfo.sub_merchant_id||'Not Configure'}} +   Merchant ID:{{paymentInfo.merchant_id | choose_merchant_id}} -