diff --git a/pom.xml b/pom.xml index f7b6879e5..581acdc88 100644 --- a/pom.xml +++ b/pom.xml @@ -5,15 +5,17 @@ au.com.royalpay.payment payment-parent - 0.2.0 + 1.0.0 4.0.0 manage + 1.0.19 + UTF-8 1.1.2 - 1.1.18 + ${project.version} 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 691df38f6..dad9bb3be 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 @@ -67,6 +67,8 @@ import java.net.URISyntaxException; 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. */ 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 aaf0c1857..fea78aecf 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 @@ -528,7 +528,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) { @@ -1823,7 +1823,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")); }); } @@ -1908,7 +1908,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"); } } @@ -3277,7 +3277,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 @@ -3287,7 +3287,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 @@ -3298,7 +3298,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白名单")); } } @@ -3311,8 +3311,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 @@ -3653,7 +3653,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 @@ -4182,27 +4182,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; } @@ -4219,12 +4219,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"); @@ -4236,12 +4236,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; } @@ -4859,7 +4859,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(); 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 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 e81f17cac..b8f804af5 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 @@ -659,7 +659,7 @@ WHERE scr.rate_name = 'CB_BankPay' AND (scr.expiry_time IS NULL OR scr.expiry_time >= NOW())) - AND cb_bankpay_url IS NULL; + AND cb_bankpay_url IS NULL 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

diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 46e7e3868..3c6b279d4 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -390,6 +390,9 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot }; $scope.toggleClientPayType = function (type) { + if (!$scope.partner.client_pay_type) { + $scope.partner.client_pay_type = []; + } var $idx = $scope.partner.client_pay_type.indexOf(type); if ($idx >= 0) { $scope.partner.client_pay_type.splice($idx, 1); @@ -410,6 +413,9 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot }; $scope.toggleClientPayDesc = function (type) { + if (!$scope.partner.client_pay_desc) { + $scope.partner.client_pay_desc = []; + } var $idx = $scope.partner.client_pay_desc.indexOf(type); if ($idx >= 0) { if (type == '203') {