From 716937b33375f65031d0c6e0a7e8b72e17ea461d Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 28 Jun 2019 11:27:14 +0800 Subject: [PATCH 01/22] =?UTF-8?q?fix=20=20=E4=B8=B4=E6=97=B6=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E5=A4=8D=EF=BC=8C=E8=BF=87=E6=BB=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchants/core/impls/ClientManagerImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 5e1e71643..6074e7476 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 @@ -5087,14 +5087,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid try { mailService.sendEmailWhihBcc("测试商户账户已更新", "info@royalpay.com.au", needSendEmails, content); } catch (Exception e) { - throw new BadRequestException("邮件发送失败", e); + logger.error("邮件发送失败", e); } }).start(); List needNotifyUsers = royalPayUsers.stream().filter(user -> StringUtils.isNotEmpty(user.getString("wx_openid"))).map(user -> user.getString("wx_openid")).collect(Collectors.toList()); + List sendAccounts = new ArrayList<>(); needNotifyUsers.forEach(userOpenId -> { try { - String signStr = "?sign=" + AESencrypt(accounts.toString(), userOpenId); + accounts.forEach(account ->{ + JSONObject params = new JSONObject(); + params.put("client_moniker", account.getString("client_moniker")); + params.put("role", account.getIntValue("role")); + params.put("username", account.getString("username")); + params.put("password", account.getString("password")); + sendAccounts.add(params); + }); + String signStr = "?sign=" + AESencrypt(sendAccounts.toString(), userOpenId); MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); TemplateMessage msg = initSendTestPasswordTemplate(userOpenId, paymentApi.getTemplateId("test-merchant-password"), signStr.replace("+", "%2B")); paymentApi.sendTemplateMessage(msg); From 37266365d336c6d6aa14156e316a49eb71f9c743 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 2 Jul 2019 17:08:46 +0800 Subject: [PATCH 02/22] =?UTF-8?q?add=20=E5=95=86=E6=88=B7=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/mappers/system/ClientMapper.java | 2 ++ .../payment/manage/merchants/core/ClientManager.java | 2 ++ .../manage/merchants/core/impls/ClientManagerImpl.java | 9 +++++++++ .../manage/merchants/web/PartnerManageController.java | 6 ++++++ .../payment/manage/mappers/system/ClientMapper.xml | 4 ++++ src/main/ui/static/payment/partner/partner-manage.js | 6 ++++++ .../ui/static/payment/partner/templates/add_partner.html | 4 +++- 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index ea5068c86..7ef02be41 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -122,4 +122,6 @@ public interface ClientMapper { List createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date,@Param("start_date_month") Date start_date_month); List clientPayTypeInfoByClientIdRange(@Param("begin") int begin, @Param("end") int end); + + int getPartnercode(@Param("codes") String codes); } 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 efdf669d4..5d8e10901 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 @@ -43,6 +43,8 @@ public interface ClientManager { List listPartners(JSONObject manager, PartnerQuery query); + String initMerchantCode(); + @Transactional JSONObject registerClient(String clientMoniker, ClientRegisterInfo registery, 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 6074e7476..1e74e9ae0 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 @@ -630,6 +630,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return clientMapper.listPartnerSelection(params, new PageBounds(Order.formString("create_time.desc"))); } + @Override + public String initMerchantCode() { + String code = RandomStringUtils.randomAlphanumeric(4).toUpperCase(); + if (clientMapper.getPartnercode(code) > 0) { + return initMerchantCode(); + } + return code; + } + @Override @Transactional public JSONObject registerClient(String clientMoniker, ClientRegisterInfo registery, JSONObject manager) { 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 9723ecf91..3df2f98fc 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 @@ -48,6 +48,12 @@ public class PartnerManageController { return clientManager.listPartners(manager, query); } + + @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET) + public String initMerchantCode() { + return clientManager.initMerchantCode(); + } + @RequestMapping(method = RequestMethod.POST) @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ClientRegisterInfo registery, diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index 3f0bcb658..19d6f31f5 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -645,4 +645,8 @@ AND p.client_id >= #{begin} AND p.client_id < #{end} + + diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 9e43f403d..fc9907856 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -368,6 +368,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } else { $scope.partner = {timezone: 'Australia/Melbourne'}; } + $scope.initMerchantCode = function () { + $http.get('/sys/partners/init/merchant_code').then(function (response) { + $scope.partner.client_moniker = response.data; + }); + }; + $scope.initMerchantCode(); $scope.partner.company_phone_c = 61; $scope.partner.contact_phone_c = 61; $scope.partner.client_pay_type = []; diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 5e6b73c87..b371dd5c8 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -35,11 +35,13 @@ Numbers)
+ ng-pattern="/^[a-zA-Z0-9]+$/" readonly> +

No further changeable!

From e1bdad97b868684dc015773494ed5682fe5b32fb Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 3 Jul 2019 11:21:39 +0800 Subject: [PATCH 03/22] =?UTF-8?q?fix=20website=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/static/payment/partner/templates/partner_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index 185f56bcc..d3054bb3b 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -592,7 +592,7 @@
-
+
From 793cbbf02da0c47269456a83a29e2d14704926db Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 5 Jul 2019 16:44:17 +0800 Subject: [PATCH 04/22] =?UTF-8?q?fix=20=E8=8B=B1=E6=96=87=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=88=90=E5=8A=9F=E9=A1=B5=20=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/merchants/core/ClientManager.java | 2 ++ .../merchants/core/impls/ClientManagerImpl.java | 10 +++++++++- .../merchants/web/PartnerManageController.java | 5 +++++ .../ui/static/payment/partner/partner-manage.js | 15 +++++++++++++++ .../payment/partner/templates/add_partner.html | 6 +++++- 5 files changed, 36 insertions(+), 2 deletions(-) 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 5d8e10901..8130e20e7 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 @@ -45,6 +45,8 @@ public interface ClientManager { String initMerchantCode(); + boolean getMerchantIsValid(String clientMoniker); + @Transactional JSONObject registerClient(String clientMoniker, ClientRegisterInfo registery, 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 1e74e9ae0..c0f5384ca 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 @@ -633,12 +633,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public String initMerchantCode() { String code = RandomStringUtils.randomAlphanumeric(4).toUpperCase(); - if (clientMapper.getPartnercode(code) > 0) { + if (!getMerchantIsValid(code)) { return initMerchantCode(); } return code; } + @Override + public boolean getMerchantIsValid(String clientMoniker) { + if (clientMapper.getPartnercode(clientMoniker) > 0) { + return false; + } + return true; + } + @Override @Transactional public JSONObject registerClient(String clientMoniker, ClientRegisterInfo registery, JSONObject manager) { 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 3df2f98fc..8d7ddadfa 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 @@ -54,6 +54,11 @@ public class PartnerManageController { return clientManager.initMerchantCode(); } + @RequestMapping(value = "/init/check_code_isvalid", method = RequestMethod.GET) + public boolean getMerchantIsValid(@RequestParam String clientMoniker) { + return clientManager.getMerchantIsValid(clientMoniker); + } + @RequestMapping(method = RequestMethod.POST) @RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody @Valid ClientRegisterInfo registery, diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index fc9907856..1f2684509 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -371,6 +371,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.initMerchantCode = function () { $http.get('/sys/partners/init/merchant_code').then(function (response) { $scope.partner.client_moniker = response.data; + $scope.merchantCodeChecked = true; + $scope.merchantIsValid = true; }); }; $scope.initMerchantCode(); @@ -437,6 +439,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.clean_days = angular.copy(clean_days_map); $scope.bd_citys = angular.copy(bd_city_map); $scope.params = {textType: 'all', org_name: 'ALL'}; + $scope.merchantIsValid = false; + $scope.merchantCodeChecked = false; function remove(arr, val) { if (angular.isArray(arr)) { @@ -526,6 +530,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter // $scope.t2city_map = angular.copy(t2city_map); $scope.timezones = timezone.configs(); + $scope.checkMerchantCodeIsValid = function (code) { + if (code.length != 4) { + $scope.merchantCodeChecked = false; + $scope.merchantIsValid = false; + return; + } + $http.get('/sys/partners/init/check_code_isvalid',{params:{clientMoniker:code}}).then(function (response) { + $scope.merchantIsValid = response.data; + $scope.merchantCodeChecked = true; + }); + }; $scope.save = function (form) { if (form.$invalid) { angular.forEach(form, function (item, key) { diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index b371dd5c8..1e5dec61c 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -40,8 +40,12 @@ type="text" name="client_moniker" id="short-id-input" required maxlength="4" - ng-pattern="/^[a-zA-Z0-9]+$/" readonly> + ng-pattern="/^[a-zA-Z0-9]+$/" ng-change="checkMerchantCodeIsValid(partner.client_moniker)"> + + + +

No further changeable!

From cd0f90d3ad7588e0f092e5b083daa902c51f3769 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 5 Jul 2019 16:52:01 +0800 Subject: [PATCH 05/22] =?UTF-8?q?fix=20subpartner=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=95=86=E6=88=B7=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/payment/partner/partner-manage.js | 21 +++++++++++++++++++ .../templates/add_sub_partner_dialog.html | 8 ++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 1f2684509..8ecf5793a 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2784,10 +2784,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } else { $scope.partner = {timezone: 'Australia/Melbourne'}; } + $scope.initMerchantCode = function () { + $http.get('/sys/partners/init/merchant_code').then(function (response) { + $scope.partner.client_moniker = response.data; + $scope.merchantCodeChecked = true; + $scope.merchantIsValid = true; + }); + }; + $scope.initMerchantCode(); $scope.partner.company_phone_c = 61; $scope.partner.contact_phone_c = 61; $scope.partner.client_pay_type = []; $scope.partner.client_pay_desc = []; + $scope.merchantIsValid = false; + $scope.merchantCodeChecked = false; var resetClientPayDescByTpey = function (type) { type = parseInt(type); if (type == 1) { @@ -2914,6 +2924,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.timezones = timezone.configs(); $scope.states = stateMap.configs(); $scope.countries = countryMap.configs(); + $scope.checkMerchantCodeIsValid = function (code) { + if (code.length != 4) { + $scope.merchantCodeChecked = false; + $scope.merchantIsValid = false; + return; + } + $http.get('/sys/partners/init/check_code_isvalid',{params:{clientMoniker:code}}).then(function (response) { + $scope.merchantIsValid = response.data; + $scope.merchantCodeChecked = true; + }); + }; $scope.saveSubPartner = function (form) { if (form.$invalid) { angular.forEach(form, function (item, key) { diff --git a/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html b/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html index 537a23227..17bb61475 100644 --- a/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html +++ b/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html @@ -25,8 +25,14 @@
+ id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/" ng-change="checkMerchantCodeIsValid(partner.client_moniker)"> + + + + +

No further changeable!

From 6be7f13b3760e884c5ead4ccb8d997ff9d0d373d Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Mon, 8 Jul 2019 11:40:40 +0800 Subject: [PATCH 06/22] =?UTF-8?q?[Y]=20=E9=A3=8E=E6=8E=A7=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9E=E9=A3=8E=E6=8E=A7=E6=8C=87=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/mail/risk_upload_mail.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html index c4466e71e..719540fd0 100644 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ b/src/main/resources/templates/mail/risk_upload_mail.html @@ -146,6 +146,9 @@

我司风控系统检测到您短期内后台交易存在异常行为(单人多次大金额交易退款频繁),触发平台风控预警,特此提醒:请勿使用平台进行违规交易,一经核查将关闭支付权限。请知悉。
RoyalPay's risk management system has identified abnormal transactions from your records in a short time(Single person pays large sums several timesfrequent refund transactions),which triggered the platform risk control warning. Here reminds: Do not use the platform for illegal transactions. Once verified, the payment authority will be closed.

+
+ +

了解更多关于我司风控事宜。Click into the link to see more about our risk management work.

顺颂商祺
Sincerely

From 2995bf5ba5eb10a09e03289750190906b66f4d17 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 9 Jul 2019 11:38:10 +0800 Subject: [PATCH 07/22] =?UTF-8?q?add=20=E8=87=AA=E5=8A=A9=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=95=86=E6=88=B7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/merchants/core/ClientApply.java | 3 + .../merchants/core/impls/ClientApplyImpl.java | 182 ++++++++++++++---- .../merchants/web/PartnerApplyController.java | 6 +- .../templates/partner_application.html | 5 + 4 files changed, 161 insertions(+), 35 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java index 68569df3b..76be422f8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientApply.java @@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.merchants.beans.ClientApplyInfo; import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; import com.alibaba.fastjson.JSONObject; +import javax.servlet.http.HttpServletResponse; import java.util.List; @@ -40,4 +41,6 @@ public interface ClientApply { JSONObject findOrgByBDId(String bd_id); void notifyBD(String client_apply_id); + + void exportApplyPartnerList(JSONObject manager, HttpServletResponse response) throws Exception; } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java index 99b8288a4..2d9c07f5d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java @@ -27,6 +27,12 @@ import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.*; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; @@ -36,11 +42,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; +import java.io.OutputStream; +import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; /** * Created by yishuqian on 18/10/2016. @@ -158,44 +167,44 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw JSONObject partner = info.insertObject(); - if (info.getClientMoniker()== null || info.getClientMoniker().isEmpty()){ + if (info.getClientMoniker() == null || info.getClientMoniker().isEmpty()) { throw new NotFoundException("clientMoniker can not be null"); } - if (info.getShortName() == null || info.getShortName().isEmpty()){ - partner.put("short_name","0"); + if (info.getShortName() == null || info.getShortName().isEmpty()) { + partner.put("short_name", "0"); } - if (!partner.containsKey("sector")){ - partner.put("sector","0"); + if (!partner.containsKey("sector")) { + partner.put("sector", "0"); } - if (!partner.containsKey("industry")){ - partner.put("industry","0"); + if (!partner.containsKey("industry")) { + partner.put("industry", "0"); } - if (info.getAddress() == null || info.getAddress().isEmpty()){ - partner.put("address","0"); + if (info.getAddress() == null || info.getAddress().isEmpty()) { + partner.put("address", "0"); } - if (info.getSuburb() == null || info.getSuburb().isEmpty()){ - partner.put("suburb","0"); + if (info.getSuburb() == null || info.getSuburb().isEmpty()) { + partner.put("suburb", "0"); } - if (info.getPostcode() == null || info.getPostcode().isEmpty()){ - partner.put("postcode","0"); + if (info.getPostcode() == null || info.getPostcode().isEmpty()) { + partner.put("postcode", "0"); } - if (info.getState() == null || info.getState().isEmpty()){ - partner.put("state","0"); + if (info.getState() == null || info.getState().isEmpty()) { + partner.put("state", "0"); } - if (info.getCountry() == null || info.getCountry().isEmpty()){ - partner.put("county","AUS"); + if (info.getCountry() == null || info.getCountry().isEmpty()) { + partner.put("county", "AUS"); } - if (info.getCompanyPhone()== null || info.getCompanyPhone().isEmpty()){ - partner.put("company_phone","0"); + if (info.getCompanyPhone() == null || info.getCompanyPhone().isEmpty()) { + partner.put("company_phone", "0"); } - if (info.getContactPerson() == null || info.getContactPerson().isEmpty()){ - partner.put("contact_person","0"); + if (info.getContactPerson() == null || info.getContactPerson().isEmpty()) { + partner.put("contact_person", "0"); } - if (info.getContactEmail() == null || info.getContactEmail().isEmpty()){ - partner.put("contact_email","0"); + if (info.getContactEmail() == null || info.getContactEmail().isEmpty()) { + partner.put("contact_email", "0"); } - if (partner.containsKey("remark")){ + if (partner.containsKey("remark")) { partner.remove("remark"); } @@ -212,9 +221,9 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw if (clientMapper.findClientByMoniker(info.getClientMoniker()) != null) { throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); } - partner.put("source",2);//自主申请 - partner.put("country","AUS");//自主申请 - partner.put("ali_sub_merchant_id",info.getClientMoniker()); + partner.put("source", 2);//自主申请 + partner.put("country", "AUS");//自主申请 + partner.put("ali_sub_merchant_id", info.getClientMoniker()); clientMapper.save(partner); JSONObject clientConfig = new JSONObject(); @@ -222,8 +231,8 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw clientConfig.put("client_pay_type", apply.getString("client_pay_type")); clientConfig.put("client_pay_desc", apply.getString("client_pay_desc")); } - clientConfig.put("client_id",partner.getIntValue("client_id")); - clientConfig.put("client_moniker",info.getClientMoniker()); + clientConfig.put("client_id", partner.getIntValue("client_id")); + clientConfig.put("client_moniker", info.getClientMoniker()); clientConfigService.save(clientConfig); JSONObject client_bd = new JSONObject(); @@ -251,12 +260,12 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw Assert.notNull(apply); - if (info.getClientMoniker()== null || info.getClientMoniker().isEmpty()){ + if (info.getClientMoniker() == null || info.getClientMoniker().isEmpty()) { throw new NotFoundException("clientMoniker can not be null"); } JSONObject client = clientMapper.findClientByMoniker(info.getClientMoniker()); Assert.notNull(client); - clientModifySupport.processClientModify(new SourceModify(manager,client.getString("client_moniker"),2)); + clientModifySupport.processClientModify(new SourceModify(manager, client.getString("client_moniker"), 2)); apply.put("client_id", client.getIntValue("client_id")); apply.put("client_moniker", info.getClientMoniker()); apply.put("apply_approve_result", 2); @@ -269,8 +278,8 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw JSONObject account = clientAccountMapper.findById(accountId); Assert.notNull(account); JSONObject updateObj = new JSONObject(); - updateObj.put("account_id",accountId); - updateObj.put("remark",remark); + updateObj.put("account_id", accountId); + updateObj.put("remark", remark); clientAccountMapper.update(updateObj); } @@ -292,7 +301,7 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw @Override public void notifyBD(String client_apply_id) { JSONObject client = clientApplyMapper.findClientApplicationById(client_apply_id); - publisher.publishEvent(new ClientApplyNotifyBDEvent(this,client)); + publisher.publishEvent(new ClientApplyNotifyBDEvent(this, client)); } @@ -300,4 +309,109 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { this.publisher = applicationEventPublisher; } + + @Override + public void exportApplyPartnerList(JSONObject manager, HttpServletResponse resp) throws Exception{ + PartnerQuery partnerQuery = new PartnerQuery(); + JSONObject params = partnerQuery.toJsonParam(); + if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { + params.put("bd_user", manager.getString("manager_id")); + } + OutputStream ous = null; + resp.setContentType("application/octet-stream;"); + resp.addHeader("Content-Disposition", "attachment; filename=" + "apply_partner_list.xls"); + ous = resp.getOutputStream(); + HSSFWorkbook wb = new HSSFWorkbook(); + Cell cell = null; + HSSFFont font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + font.setFontHeightInPoints((short) 10); + CellStyle titleStyle = wb.createCellStyle(); + titleStyle.setFont(font); + HSSFCellStyle style = wb.createCellStyle(); + style.setFillForegroundColor(HSSFColor.RED.index); + style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + PageList partners = clientApplyMapper.listPartnerApplications(params, new PageBounds(Order.formString("apply_approve_result.asc,create_time.desc"))); + Sheet sheet = wb.createSheet("apply_partner_list"); + sheet.setDefaultColumnWidth(20); + int rowNum = 0; + Row row = sheet.createRow(rowNum); + String[] CommissionTitle = {"Application Time", "Client Moniker", "Company Name", "Short Name", "Contact Person" , "Contact Phone", "Contact Email", "Country","State", "Suburb", "Address", "Company Phone", "Company Website", "Progress", "BD", "Apply Approve Result", "Source"}; + for (int i = 0; i < CommissionTitle.length; i++) { + cell = row.createCell(i, Cell.CELL_TYPE_STRING); + cell.setCellStyle(titleStyle); + cell.setCellValue(CommissionTitle[i]); + } + for (JSONObject partner : partners) { + row = sheet.createRow(++rowNum); + String type = ""; + row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(partner.getDate("create_time"),"yyyy-MM-dd HH:mm:ss")); + row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("client_moniker")); + row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_name")); + row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("short_name")); + row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("contact_person")); + row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("contact_phone")); + row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("contact_email")); + row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("country")); + row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("state")); + row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("suburb")); + row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("address")); + row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_phone")); + row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_website")); + row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("remark")); + row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("bd_user_name")); + row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(getApplyResultStatus(partner.getIntValue("apply_approve_result"))); + row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(getSource(partner.getIntValue("apply_approve_result"))); + } + wb.write(ous); + ous.flush(); + } + + public String getApplyResultStatus(int result) { + String status = ""; + switch (result) { + case 0: + status = "待审核"; + break; + case 1: + status = "已提交BD"; + break; + case 2: + status = "BD已通过"; + break; + case 3: + status = "初审拒绝"; + break; + case 4: + status = "BD提交后不通过"; + break; + default: + status = "待审核"; + break; + } + return status; + } + + public String getSource(int result) { + String status = ""; + switch (result) { + case 0: + status = "PC"; + break; + case 1: + status = "公众号菜单"; + break; + case 2: + status = "公众号推送"; + break; + case 3: + status = "小程序申请"; + break; + default: + status = "PC"; + break; + } + return status; + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java index ea9f41539..bf1f153e8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerApplyController.java @@ -164,5 +164,9 @@ public class PartnerApplyController { return clientApply.listBDByOrg(org_id); } - + @RequestMapping(value = "/export_xls", method = RequestMethod.GET) + public void exportApplyPartnerList(HttpServletResponse httpResponse, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception{ + clientApply.exportApplyPartnerList(manager, httpResponse); + } } diff --git a/src/main/ui/static/payment/partner/templates/partner_application.html b/src/main/ui/static/payment/partner/templates/partner_application.html index 5541bd35e..63ac128bd 100644 --- a/src/main/ui/static/payment/partner/templates/partner_application.html +++ b/src/main/ui/static/payment/partner/templates/partner_application.html @@ -14,6 +14,11 @@
+
From 4ece67e6aaadd6fec00a95d274d5ada28988d8a2 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Wed, 10 Jul 2019 15:15:08 +0800 Subject: [PATCH 08/22] =?UTF-8?q?[Y]=20=E4=BF=AE=E5=A4=8D=E6=AF=8F?= =?UTF-8?q?=E6=97=A5=E8=87=AA=E5=8A=A8=E5=8C=96=E7=94=9F=E6=88=90=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E5=BC=82=E5=B8=B8=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/analysis/mappers/TransactionAnalysisMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml index 32ef0c8cf..96ee0b611 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/TransactionAnalysisMapper.xml @@ -689,8 +689,8 @@ COUNT(DISTINCT o.customer_id) AS customers, o.channel AS channel, ifnull(SUM(if(t.transaction_type = 'Credit', t.clearing_amount, 0)), 0) AS total, - ifnull(SUM(if(t.refund_id>0, t.clearing_amount, 0)), 0) AS refund_amount, - SUM(if(t.refund_id>0, 1, 0)) AS refund_orders, + ifnull(SUM(if(t.transaction_type = 'Debit', t.clearing_amount, 0)), 0) AS refund_amount, + SUM(if(t.transaction_type = 'Debit', 1, 0)) AS refund_orders, round(SUM(if(t.transaction_type='Credit',t.clearing_amount,0))/COUNT(DISTINCT o.customer_id),2) single_amount FROM pmt_transactions t INNER JOIN pmt_orders o ON o.order_id = t.order_id From 1f8c0cb942fa6b21a3a5c82e9a6b98a8fe40258f Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 10 Jul 2019 15:16:09 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/web/TestController.java | 3 - .../core/impls/ClientManagerImpl.java | 61 +++++++++---------- .../merchants/enums/PaymentScenarioEnum.java | 59 ++++++++++++++++++ .../merchants/enums/paymentScenarioEnum.java | 47 -------------- 4 files changed, 89 insertions(+), 81 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java delete mode 100644 src/main/java/au/com/royalpay/payment/manage/merchants/enums/paymentScenarioEnum.java diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 2f2725959..b2873e131 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -25,7 +25,6 @@ import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.system.core.TradeSecureService; -import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.defines.TradeType; @@ -62,8 +61,6 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.List; 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 c0f5384ca..be80afe17 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 @@ -103,7 +103,6 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestMethod; import org.thymeleaf.context.Context; import org.thymeleaf.spring4.SpringTemplateEngine; -import sun.misc.BASE64Encoder; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -416,8 +415,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } //商户支付场景 if (StringUtils.isNotBlank(client.getString("client_pay_type"))) { - client.put("client_pay_type",client.getString("client_pay_type").split(",")); - client.put("client_pay_desc",client.getString("client_pay_desc").split(",")); + client.put("client_pay_type", client.getString("client_pay_type").split(",")); + client.put("client_pay_desc", client.getString("client_pay_desc").split(",")); } if (StringUtils.isNotBlank(client.getString("parent_client_id")) && sysClientMapper.childClientId(client.getIntValue("client_id")).size() > 0) { @@ -427,7 +426,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject partnerGatewaySign = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); if (partnerGatewaySign == null) { client.put("enable_gateway_version2", false); - }else { + } else { client.put("enable_gateway_version2", partnerGatewaySign.getBooleanValue("is_valid")); client.put("gateway_sign", partnerGatewaySign); } @@ -525,7 +524,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid int authDays = PlatformEnvironment.getEnv().authDays();// 快速自助开通申请有效期 for (JSONObject partner : partners) { String subMerchantId = partner.getString("sub_merchant_id"); - if (subMerchantId != null ) { + if (subMerchantId != null) { partner.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); } if (partner.getIntValue("approve_result") == 2) { @@ -1818,7 +1817,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid List clients = clientMapper.listChildClients(partner.getIntValue("client_id")); if (clients.size() > 0) { partner.put("level3Clients", clients); - clients.forEach(e->{ + clients.forEach(e -> { e.put("parent_client_moniker", partner.getString("client_moniker")); }); } @@ -1903,7 +1902,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject clientInfo = getClientInfo(Integer.parseInt(currentClientId)); if (clientInfo.containsKey("parent_client_id")) { int parentClientId = clientInfo.getIntValue("parent_client_id"); - if (parentClientId != client_id && client_id!= Integer.parseInt(currentClientId) && !listLevel3Client(client_id).contains(parentClientId)) { + if (parentClientId != client_id && client_id != Integer.parseInt(currentClientId) && !listLevel3Client(client_id).contains(parentClientId)) { throw new Exception("partner has no permission"); } } @@ -3272,7 +3271,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid gatewaySignInfo.put("last_update_date", new Date()); merchantSignInfoMapper.insert(gatewaySignInfo); } - clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"),"is_valid" ,enable_gateway_v2)); + clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "is_valid", enable_gateway_v2)); } @Override @@ -3282,7 +3281,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"),"verify_ip" ,verify_ip)); + clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "verify_ip", verify_ip)); } @Override @@ -3293,7 +3292,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } if (StringUtils.isNotBlank(ipWhitelistConfig)) { - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"ip_whitelist", ipWhitelistConfig, "重新设置IP白名单")); + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "ip_whitelist", ipWhitelistConfig, "重新设置IP白名单")); } } @@ -3306,8 +3305,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } JSONObject key = getRsaKey(); - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"platform_public_key",key.getString("public_key"),"重新生成平台公钥")); - clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"platform_private_key",key.getString("private_key"),"重新生成平台私钥")); + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "platform_public_key", key.getString("public_key"), "重新生成平台公钥")); + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "platform_private_key", key.getString("private_key"), "重新生成平台私钥")); } @Override @@ -3648,7 +3647,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - return clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"),detailId); + return clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"), detailId); } @Override @@ -4177,27 +4176,27 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid queryGMSJson.put("partner", mch.getPid()); queryGMSJson.put("sign_type", "MD5"); queryGMSJson.put("_input_charset", "utf-8"); - queryGMSJson.put("timestamp", DateFormatUtils.format(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss")); + queryGMSJson.put("timestamp", DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); queryGMSJson.put("secondary_merchant_name", client.getString("company_name")); queryGMSJson.put("secondary_merchant_id", client.getString("client_moniker")); queryGMSJson.put("store_id", client.getString("client_moniker")); queryGMSJson.put("store_name", client.getString("short_name")); - queryGMSJson.put("store_country", client.getString("country").substring(0,2)); - queryGMSJson.put("store_address", client.getString("country") + " "+client.getString("state") + " "+client.getString("suburb") + " "+client.getString("address")); + queryGMSJson.put("store_country", client.getString("country").substring(0, 2)); + queryGMSJson.put("store_address", client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")); queryGMSJson.put("store_industry", client.getString("alipayindustry")); queryGMSJson.put("internal_store_photo", client.getString("company_photo")); queryGMSJson.put("external_storefront_photo", client.getString("store_photo")); - queryGMSJson.put("register_country", client.getString("country").substring(0,2)); - queryGMSJson.put("register_address", client.getString("country") + " "+client.getString("state") + " "+client.getString("suburb") + " "+client.getString("address")); + queryGMSJson.put("register_country", client.getString("country").substring(0, 2)); + queryGMSJson.put("register_address", client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")); if ("Company".equals(client.getString("business_structure"))) { queryGMSJson.put("secondary_merchant_type", "ENTERPRISE"); queryGMSJson.put("registration_no", client.getString("acn")); - }else { + } else { queryGMSJson.put("secondary_merchant_type", "INDIVIDUAL"); queryGMSJson.put("representative_name", client.getString("contact_person")); } - queryGMSJson.put("contact_no",client.getString("contact_phone")); - queryGMSJson.put("contact_email",client.getString("contact_email")); + queryGMSJson.put("contact_no", client.getString("contact_phone")); + queryGMSJson.put("contact_email", client.getString("contact_email")); return queryGMSJson; } @@ -4214,12 +4213,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid queryGMSJson.put("partner", mch.getPid()); queryGMSJson.put("sign_type", "MD5"); queryGMSJson.put("_input_charset", "utf-8"); - queryGMSJson.put("timestamp", DateFormatUtils.format(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss")); + queryGMSJson.put("timestamp", DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); queryGMSJson.put("secondary_merchant_name", client.getString("company_name")); queryGMSJson.put("secondary_merchant_id", client.getString("client_moniker")); queryGMSJson.put("secondary_merchant_industry", client.getString("alipayindustry")); - queryGMSJson.put("register_country", client.getString("country").substring(0,2)); - queryGMSJson.put("register_address", client.getString("country") + " "+client.getString("state") + " "+client.getString("suburb") + " "+client.getString("address")); + queryGMSJson.put("register_country", client.getString("country").substring(0, 2)); + queryGMSJson.put("register_address", client.getString("country") + " " + client.getString("state") + " " + client.getString("suburb") + " " + client.getString("address")); JSONObject website = new JSONObject(); List websites = new ArrayList<>(); website.put("site_type", "WEB"); @@ -4231,12 +4230,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid queryGMSJson.put("secondary_merchant_type", "ENTERPRISE"); queryGMSJson.put("registration_no", client.getString("acn")); queryGMSJson.put("shareholder_name", client.getString("contact_person")); - }else { + } else { queryGMSJson.put("secondary_merchant_type", "INDIVIDUAL"); queryGMSJson.put("representative_name", client.getString("contact_person")); } - queryGMSJson.put("contact_no",client.getString("contact_phone")); - queryGMSJson.put("contact_email",client.getString("contact_email")); + queryGMSJson.put("contact_no", client.getString("contact_phone")); + queryGMSJson.put("contact_email", client.getString("contact_email")); return queryGMSJson; } @@ -4855,7 +4854,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid needCheckParams.put("bank_account_no", bankAccount.getString("account_no")); } List listRiskySimilarMerchants = riskAttentionMerchantsMapper.listRiskySimilarMerchants(needCheckParams); - if (listRiskySimilarMerchants.size() > 0) { + if (!listRiskySimilarMerchants.isEmpty()) { StringBuilder appendStr = new StringBuilder(); StringBuilder infoStr = new StringBuilder(); @@ -5112,7 +5111,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid List sendAccounts = new ArrayList<>(); needNotifyUsers.forEach(userOpenId -> { try { - accounts.forEach(account ->{ + accounts.forEach(account -> { JSONObject params = new JSONObject(); params.put("client_moniker", account.getString("client_moniker")); params.put("role", account.getIntValue("role")); @@ -5173,8 +5172,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid KeyPair keyPairGen = RSACrypt.generateKeyPairs(); RSAPublicKey publicKey = (RSAPublicKey) keyPairGen.getPublic(); RSAPrivateKey privateKey = (RSAPrivateKey) keyPairGen.getPrivate(); - key.put("public_key", new BASE64Encoder().encode(publicKey.getEncoded())); - key.put("private_key", new BASE64Encoder().encode(privateKey.getEncoded())); + key.put("public_key", Base64.encodeBase64String(publicKey.getEncoded())); + key.put("private_key", Base64.encodeBase64String(privateKey.getEncoded())); return key; } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java b/src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java new file mode 100644 index 000000000..b58f6ffe0 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/enums/PaymentScenarioEnum.java @@ -0,0 +1,59 @@ +package au.com.royalpay.payment.manage.merchants.enums; + +/** + * @Author: luoyang + * @Date: 2019-05-29 10:30 + */ +public enum PaymentScenarioEnum { + PC_WEB("101", "PC网站"),//1 + + MOBILE_WEB("102", "手机端网站"),//2 + + APP("103", "APP"),//3 + + WECHAT_ALIPAY_WEB("104", "微信内、支付宝内网站"),//4 + + MINIPROGRAM("105", "小程序"),//5 + + QRCODE_BOARD("201", "二维码立牌"),//6 + + ROYALPAY_POS("202", "Royalpay POS"),//7 + + CASHIER_POS("203", "收银系统"),//8 + + IPOS("20301", "ipos"),//9 + + POSPAL("20302", "pospal"),//10 + + AUPOS("20303", "aupos"),//11 + + OTHER("20399", "other"),//12 + + VENDING_MACHINE("204", "无人售货机"),//13 + + LOTUS("20304", "Lotus"), + + AOSHANGBAO("20305", "AoShangBao"), + + INFINITY("20306", "Infinity"), + + EASY_CLOUD("20307", "EasyCloud"), + + AOMAIKE("20308", "AoMaiKe"); + + private final String scenarioTypeId; + private final String desc; + + public String getScenarioTypeId() { + return scenarioTypeId; + } + + public String getDesc() { + return desc; + } + + PaymentScenarioEnum(String scenarioTypeId, String desc) { + this.scenarioTypeId = scenarioTypeId; + this.desc = desc; + } +} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/paymentScenarioEnum.java b/src/main/java/au/com/royalpay/payment/manage/merchants/enums/paymentScenarioEnum.java deleted file mode 100644 index 912300a0a..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/enums/paymentScenarioEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -package au.com.royalpay.payment.manage.merchants.enums; - -/** - * @Author: luoyang - * @Date: 2019-05-29 10:30 - */ -public enum paymentScenarioEnum { - PC_WEB(1, "PC网站"), - - MOBILE_WEB(2, "手机端网站"), - - APP(3, "APP"), - - WECHAT_ALIPAY_WEB(4, "微信内、支付宝内网站"), - - MINIPROGRAM(5, "小程序"), - - QRCODE_BOARD(6, "二维码立牌"), - - ROYALPAY_POS(7,"Royalpay POS"), - - CASHIER_POS(8,"收银系统"), - - IPOS(9,"ipos"), - - POSPAL(10,"pospal"), - - AUPOS(11,"aupos"), - - OTHER(12,"other"), - - VENDING_MACHINE(13,"无人售货机"); - - private final int scenarioTypeId; - private final String desc; - - public int getScenarioTypeId() { - return scenarioTypeId; - } - - public String getDesc() { - return desc; - } - paymentScenarioEnum(int scenarioTypeId, String desc) { - this.scenarioTypeId = scenarioTypeId; - this.desc = desc; - }} \ No newline at end of file From a30d4b34b9a540b2729d47ec24b76e4f48c2e255 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Thu, 11 Jul 2019 23:13:38 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E5=85=A8=E9=87=8F=E5=BC=80=E9=80=9A?= =?UTF-8?q?=E5=95=86=E6=88=B7=20CBPAY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dev/web/TestController.java | 36 +++++++++++++++++++ .../manage/mappers/system/ClientMapper.java | 2 ++ .../manage/mappers/system/ClientMapper.xml | 12 +++++++ 3 files changed, 50 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 2f2725959..662bfd6f1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -28,7 +28,10 @@ import au.com.royalpay.payment.manage.system.core.TradeSecureService; import au.com.royalpay.payment.manage.system.core.beans.TradeSecureFile; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.tools.CommonConsts; +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.defines.TradeType; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.http.HttpUtils; @@ -67,6 +70,8 @@ import java.util.Arrays; import java.util.Date; import java.util.List; +import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; + /** * Created by yixian on 2016-07-06. */ @@ -128,6 +133,8 @@ public class TestController implements ApplicationEventPublisherAware { @Resource private SysConfigManager sysConfigManager; @Resource + private MpWechatApiProvider mpWechatApiProvider; + @Resource private TradeSecureService tradeSecureService; private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au"; @@ -469,4 +476,33 @@ public class TestController implements ApplicationEventPublisherAware { public void initClientPayType(@RequestParam int begin,@RequestParam int end) { aliforexcelService.initClientPayType(begin,end); } + + @PutMapping(value = "/open/cb_bankpay") + public void switchCBBankPayLinkPermission() { + List merchants = clientMapper.listNeedOpenCbpayMerchant(); + merchants.forEach(mch -> { + JSONObject client = clientMapper.findClientByMonikerAll(mch.getString("client_moniker")); + if (client == null) { + throw new InvalidShortIdException(); + } + if (StringUtils.isEmpty(client.getString("cb_bankpay_url"))) { + String longUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link/pc"); + String cb_bankpay_url = getCBBankShortLink(longUrl); + client.put("cb_bankpay_url", cb_bankpay_url); + client.put("enable_cb_bankpay_link", true); + client.put("enable_cb_bankpay", true); + clientMapper.update(client); + } else { + client.put("enable_cb_bankpay_link", true); + clientMapper.update(client); + } + }); + } + + private String getCBBankShortLink(String longUrl) { + MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); + return api.registerShortUrl(longUrl); + } + + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 7ef02be41..2e2d9d93b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -38,6 +38,8 @@ public interface ClientMapper { @AutoSql(type = SqlType.SELECT) JSONObject findClientByMonikerAll(@Param("client_moniker") String clientMoniker); + List listNeedOpenCbpayMerchant(); + @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") List getClientBySubMerchantId(@Param("sub_merchant_id") String subMerchantId); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index 19d6f31f5..0d53d156e 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -649,4 +649,16 @@ + + From f6fbb00dce07af73b7f49abd45c0c9883d579a02 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 15 Jul 2019 10:50:38 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E6=B8=85=E7=AE=97?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8F=90=E4=BA=A4=E6=97=B6=E9=87=8D=E7=BD=AE?= =?UTF-8?q?disable=20=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/settlement/core/impls/ManualSettleSupportImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java index 147cee5f8..7baef44dd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java @@ -66,6 +66,9 @@ public class ManualSettleSupportImpl implements ManualSettleSupport { currentTask.put("applier_id", account.getString("account_id")); currentTask.put("applier_name", account.getString("display_name")); currentTask.put("settle_to", settleTo); + currentTask.put("disable_flag", 0); + currentTask.put("disable_time", null); + currentTask.put("disable_remark", null); if (taskId != null) { taskManualSettleMapper.update(currentTask); } else { From 435aa9740f4b3e81cc18cf18db911257b0c5645e Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 15 Jul 2019 14:37:34 +0800 Subject: [PATCH 12/22] =?UTF-8?q?fixcbbank=20=E5=AE=89=E5=8D=93input?= =?UTF-8?q?=E5=81=8F=E7=A7=BB=E9=97=AE=E9=A2=98=20&&=20=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=B8=85=E7=AE=97=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/cbpay/css/v2/gateway_phone.css | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/ui/static/templates/cbpay/css/v2/gateway_phone.css b/src/main/ui/static/templates/cbpay/css/v2/gateway_phone.css index 4ee6caf8f..c38596c3c 100644 --- a/src/main/ui/static/templates/cbpay/css/v2/gateway_phone.css +++ b/src/main/ui/static/templates/cbpay/css/v2/gateway_phone.css @@ -261,11 +261,12 @@ input.value:focus { } .currencyrow { + display: flex; box-sizing: border-box; margin-top: 0; text-align: left; margin-bottom: 0px; - position: relative; + /*position: relative;*/ } @media screen and (max-height: 670px) { @@ -293,7 +294,7 @@ input.value:focus { } .currencyrow > * { - display: inline-block; + /*display: inline-block;*/ vertical-align: bottom; margin-bottom: 0; box-sizing: border-box; @@ -617,11 +618,12 @@ input.value:focus { .payment-input { border-radius: 2px; - width: 54%; + /*width: 54%;*/ height: 64px; font-family: PingFang-SC-Heavy; font-size: 25px; color: #000000; + flex-grow:1; letter-spacing: 2.4px; border-style:none; } @@ -693,9 +695,11 @@ input.value:focus { background: #FF6600; color: #fff; } -.currency{ +.currency { + line-height: 64px; padding-left: 6px; - height: 52px; + padding-right: 6px; + height: 64px; width: 30px; font-family: PingFang-SC-Heavy; font-size: 25px; From f4f68c0d79f0b3aee068483ececc3a367b4a31f2 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 15 Jul 2019 17:55:52 +0800 Subject: [PATCH 13/22] =?UTF-8?q?add=20=E5=95=86=E6=88=B7=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=9C=BA=E6=99=AF5=E4=B8=AApos=E6=96=B0=E6=B8=A0?= =?UTF-8?q?=E9=81=93=EF=BC=8C=E4=BB=A5=E5=8F=8A=E5=AF=B9=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/merchant_application.html | 87 ++++++++---- .../merchant_application.js | 69 +++++++--- .../static/payment/partner/partner-manage.js | 130 +++++++++--------- .../partner/templates/add_partner.html | 86 ++++++++---- .../templates/add_sub_partner_dialog.html | 86 ++++++++---- .../partner/templates/partner_detail.html | 55 ++++++-- .../partner/templates/partner_edit.html | 86 ++++++++---- .../templates/simple_application_detail.html | 63 ++++++--- 8 files changed, 434 insertions(+), 228 deletions(-) diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index fada2f2b6..be623f3f9 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -111,7 +111,13 @@ } - + .btn-default:active, + .btn-default.active, + .open > .dropdown-toggle.btn-default { + color: #333; + background-color: #f7bf90; + border-color: #adadad; + }