From 36ac26023041673ff65ca82a52226d419ca2a6b4 Mon Sep 17 00:00:00 2001 From: lujian Date: Fri, 2 Nov 2018 18:30:35 +0800 Subject: [PATCH 1/8] =?UTF-8?q?[fix]=E9=A3=8E=E6=8E=A7=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E4=B8=8A=E4=BC=A0=EF=BC=8C=E5=9B=9E=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/RiskBusinessService.java | 4 +- .../core/impl/RiskBusinessServiceImpl.java | 63 ++++++++++++++++--- .../web/RiskBusinessController.java | 2 +- .../templates/mail/risk_upload_mail.html | 58 +++++++++++++++-- .../analysis/templates/riskEvent_detail.html | 43 ++++++++++++- .../templates/riskEvent_detail_bd.html | 6 +- 6 files changed, 153 insertions(+), 23 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java index 94ac8396b..52ccf932d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskBusinessService.java @@ -36,10 +36,10 @@ public interface RiskBusinessService { /** * 获取风险事件的调单信息 - * @param orderIds + * @param riskEvent * @return */ - List getRiskEventOrderList(String orderIds); + List getRiskEventOrderList(JSONObject riskEvent); /** * 新增风险事件 diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index b64c2744a..783d94b4a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -146,15 +146,25 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo } @Override - public List getRiskEventOrderList(String orderIds) { + public List getRiskEventOrderList(JSONObject riskEvent) { + String orderIds = riskEvent.getString("order_ids"); List tradeLogs = new ArrayList<>(); if (StringUtils.isNotBlank(orderIds)) { String[] orderIdArray = orderIds.trim().split(","); - JSONObject query = new JSONObject(); + JSONObject orderInfo = new JSONObject(); + String realOrderId = ""; // 获取订单信息 - for (int i = 0; i < orderIdArray.length; i++) { - JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i]); - tradeLogs.add(orderInfo); + if (riskEvent.getIntValue("order_type") == 3) { + for (int i = 0; i < orderIdArray.length; i++) { + realOrderId = orderMapper.findOrderById(orderIdArray[i]).getString("order_id"); + orderInfo = tradeLogService.getOrderDetail(new JSONObject(), riskEvent.getString("client_moniker"), realOrderId, null); + tradeLogs.add(orderInfo); + } + } else { + for (int i = 0; i < orderIdArray.length; i++) { + orderInfo = orderMapper.findOrderById(orderIdArray[i]); + tradeLogs.add(orderInfo); + } } } return tradeLogs; @@ -370,7 +380,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo } private Context getMailContext(JSONObject event) throws IOException { - JSONObject client = clientMapper.findClientByMonikerAll(event.getString("client_moniker")); + String clientMoniker = event.getString("client_moniker"); + JSONObject client = clientMapper.findClientByMonikerAll(clientMoniker); if (client == null) { throw new InvalidShortIdException(); } @@ -379,12 +390,20 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo codeKey = RandomStringUtils.random(20, true, true); } String codeKeyValue = RandomStringUtils.random(10, true, true); + /* String expireDay = "7"; if(event.getIntValue("order_type")>2){ expireDay = "3"; } + )*/ + // 原来设定的过期时间是7天,现在改成一个月 + String expireDay = "30"; stringRedisTemplate.boundValueOps(getRiskUploadKey(codeKey)).set(codeKeyValue, Long.parseLong(expireDay), TimeUnit.DAYS); String uploadUrl = PlatformEnvironment.getEnv().concatUrl("/risk/upload/") + event.getString("risk_id") + "/" + codeKey; + int orderType = event.getIntValue("order_type"); + if (orderType == 1 || orderType == 2) + uploadUrl = PlatformEnvironment.getEnv().concatUrl("/manage.html#/analysis/monitoring/") + event.getString("risk_id") + "/bd/detail"; + //uploadUrl = "localhost:9009" + "/manage.html#/analysis/monitoring/" + event.getString("risk_id") + "/bd/detail"; List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); List bdNames = new ArrayList<>(); List bdEmails = new ArrayList<>(); @@ -403,8 +422,10 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo String bdNamesStr = bdNames.isEmpty() ? "" : StringUtils.join(bdNames, ","); String reply_date = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"),-1),"yyyy年MM月dd日"); String reply_date_english = DateFormatUtils.format(DateUtils.addDays(event.getDate("reply_email_date"),-1),"dd/MM/yyyy"); - + GregorianCalendar gregorianCalendar = new GregorianCalendar(); + String hello = gregorianCalendar.get(GregorianCalendar.AM_PM) == 0 ? "上午好" : "下午好"; Context ctx = new Context(); + ctx.setVariable("hello", hello); ctx.setVariable("order_type", event.getIntValue("order_type")); ctx.setVariable("bdNamesStr", bdNamesStr); ctx.setVariable("reply_date", reply_date); @@ -413,11 +434,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo ctx.setVariable("uploadUrl", uploadUrl); ctx.setVariable("royalpay_order_type", event.getIntValue("royalpay_order_type")); ctx.setVariable("warning_order_type", event.getIntValue("warning_order_type")); + String[] orderIds = event.getString("order_ids").split(","); + List orders = new ArrayList(); switch (event.getIntValue("order_type")){ case 1: case 2: - String[] orderIds = event.getString("order_ids").split(","); - List orders = new ArrayList(); for(String orderId : orderIds){ JSONObject order = orderMapper.findOrderById(orderId); if(order==null){ @@ -430,6 +451,24 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo ctx.setVariable("emailsTos", bdEmails); break; case 3: + String realOrderId = ""; + for(String orderId : orderIds){ + realOrderId = orderMapper.findOrderById(orderId).getString("order_id"); + JSONObject order = tradeLogService.getOrderDetail(new JSONObject(), clientMoniker, realOrderId, null); + if(order==null){ + throw new BadRequestException("Order: "+orderId+" not exists"); + } + order.put("order_description", StringUtils.defaultString(order.getString("order_description"))); + order.put("gateway", getGateWay(order.getIntValue("gateway"))); + order.put("status", getStatus(order.getIntValue("status"))); + order.put("order_detail", StringUtils.defaultString(order.getString("order_detail"))); + order.put("total_amount", order.getString("currency") + " " + order.getString("total_amount")); + order.put("display_amount", order.getString("currency") + " " + order.getString("display_amount")); + order.put("customer_payment_amount", order.getString("currency") + " " + order.getString("customer_payment_amount")); + order.put("clearing_amount", "AUD "+ order.getString("clearing_amount")); + orders.add(order); + } + ctx.setVariable("orders", orders); List attachList = new ArrayList<>(); JSONObject file = new JSONObject(); file.put("name", client.getString("short_name")+ "被查单号相关信息.xlsx"); @@ -473,11 +512,15 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo return null; } + + private byte[] generateRiskOrders(JSONObject event) throws IOException { String[] orderIds = event.getString("order_ids").split(","); Workbook wb = new XSSFWorkbook(); + String realOrderId = ""; for(String orderId : orderIds){ - JSONObject orderDetail = tradeLogService.getOrderDetail(new JSONObject(), event.getString("client_moniker"), orderId, null); + realOrderId = orderMapper.findOrderById(orderId).getString("order_id"); + JSONObject orderDetail = tradeLogService.getOrderDetail(new JSONObject(), event.getString("client_moniker"), realOrderId, null); Sheet sheet = wb.createSheet(orderId); sheet.setDefaultColumnWidth((short) 40); Row row0 = sheet.createRow(0); diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java index ba33b0ab9..b92252ec5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskBusinessController.java @@ -48,7 +48,7 @@ public class RiskBusinessController { public JSONObject getRiskEventDetail(@PathVariable("risk_id") String riskId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { JSONObject riskEvent = riskBusinessService.getRiskEventDetail(riskId); - List tradeLogs = riskBusinessService.getRiskEventOrderList(riskEvent.getString("order_ids")); + List tradeLogs = riskBusinessService.getRiskEventOrderList(riskEvent); riskEvent.put("tradeLogs", tradeLogs); return riskEvent; } diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html index 16459d5c4..38e301ca0 100644 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ b/src/main/resources/templates/mail/risk_upload_mail.html @@ -1,8 +1,14 @@
Dear : -

您好,您提交的风控材料已被拒绝。请于下午6:00(悉尼时间)前提供被查商户 ()的以下材料

-

请提供以下被查单号的小票, 物流单据(如有邮寄产品的情况), 以及消费者与买家的聊天记录等来佐证被查交易单号。 被查交易单号如下:

+

+ + ,您提交的风控材料已被拒绝。 请于 + + 下午5:00(悉尼时间)前提供腾讯被查商户 + ()的以下材料: +

+

1、请提供以下被查单号的小票, 物流单据(如有邮寄产品的情况), 以及消费者与买家的聊天记录等来佐证被查交易单号。 被查交易单号如下:

@@ -29,7 +35,7 @@
-

如果提交的材料不齐, 则有关停支付的风险。还请按时提供商户材料并直接回复该邮件, 感谢,辛苦。

+

如果提交的材料不齐, 则有关停支付的风险。感谢,辛苦。

Submit Risk Materials

@@ -39,8 +45,8 @@

您提交的风控材料已被拒绝。
The risk materials you submitted has been rejected

-

近期由于我们的风控系统检测到您的交易异常,已暂时将您的清算周期调整为T+,还请您提供以下材料,还原附件中列明的交易的真实背景:
- RoyalPay's risk management system recently has identified abnormal transactions from your records, clean days has been adjusted to T+.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:

+

近期由于我们的风控系统检测到您的交易异常,已暂时将您的清算周期调整为T+,还请您提供以下材料,还原附件中列明的交易的真实背景:
+ RoyalPay's risk management system recently has identified abnormal transactions from your records, clean days has been adjusted to T+.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:

1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;
  Please explain the relative payment scenario/business activities, for example, online store, QR code payment, payment at the store, etc;

2.提供相应购物清单,订单小票(请提供与被查交易订单号相匹配的交易时间及金额的发票);
  @@ -52,7 +58,47 @@

5.其他可以还原交易背景的资料,如和消费者的聊天记录等,来佐证被查单号交易的真实性;
  Other materials that can verify the payment scenario, for example, chatting history, to prove the truth of the transactions;

注:以上证件需原件扫描件/数码拍摄件,且照片内容需真实有效,不得做任何修改。

-

请查收附件中关于被抽查的订单交易的相关信息,并在下午6:00 (悉尼时间)前将所需材料直接回复该邮件,未能按时提交完整证明材料,支付渠道将被关停,请您务必配合调查。感谢。
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PartnerOrder IDPlatform Transaction IDOrder DescriptionCustomer IDIPTotal AmountInput AmountPay AmountExchange RateClearing AmountGatewayCreate TimeStatusPay Time
+

请查收关于被抽查的订单交易的相关信息,并在下午6:00 (悉尼时间)前将所需材料直接回复该邮件,未能按时提交完整证明材料,支付渠道将被关停,请您务必配合调查。感谢。
Please find sampled transactions in attachment, and reply required materials to this email before 6:00 pm (AEST). If you can not provide qualified materials on time, the payment channels would be suspended or restricted with amount limit. Please be sure to assist the investigation. Thanks.

diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index d4f1c0def..2ecd9b4f9 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -223,7 +223,48 @@
- +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PartnerOrder IDPlatform Transaction IDOrder DescriptionCustomer IDIPTotal AmountInput AmountPay AmountExchange RateClearing AmountGatewayCreate TimeStatusPaytime
{{trade.client.short_name}}({{trade.client.client_moniker}}){{trade.order_id}}{{trade.system_transaction_id}}{{trade.order_description}}{{trade.customer_id}}{{trade.customer_ip}}{{trade.currency}} {{trade.total_amount}}{{trade.currency}} {{trade.display_amount}}{{trade.currency}} {{trade.customer_payment_amount}}{{trade.exchange_rate}}AUD {{trade.clearing_amount}}{{trade.gateway | tradeGateway}}{{trade.create_time}}{{trade.status | tradeStatus}}{{trade.transaction_time}}
+ diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail_bd.html b/src/main/ui/static/analysis/templates/riskEvent_detail_bd.html index beac21adc..f524f866c 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail_bd.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail_bd.html @@ -31,9 +31,9 @@ From 58aed6224a928d42c35cec7793ceea6f802bbfce Mon Sep 17 00:00:00 2001 From: yangkai Date: Mon, 5 Nov 2018 09:30:56 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=B3=A8=E9=87=8ABD=E8=87=AA=E4=B8=BB?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/manage.html | 4 ++-- src/main/ui/static/menu/templates/main_menu.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/ui/manage.html b/src/main/ui/manage.html index 9979122aa..5e92e2271 100644 --- a/src/main/ui/manage.html +++ b/src/main/ui/manage.html @@ -321,12 +321,12 @@ margin-bottom: 10%;"/> 商户交易额统计 -
  • 自主申请|Partner Applies -
  • + --> diff --git a/src/main/ui/static/menu/templates/main_menu.html b/src/main/ui/static/menu/templates/main_menu.html index f56c6d465..12b8ce33e 100644 --- a/src/main/ui/static/menu/templates/main_menu.html +++ b/src/main/ui/static/menu/templates/main_menu.html @@ -101,7 +101,7 @@ -
    +
    From 7370251a746a4a87a7736f2c2c05b98a5deb2cfd Mon Sep 17 00:00:00 2001 From: lujian Date: Mon, 5 Nov 2018 10:39:36 +0800 Subject: [PATCH 3/8] =?UTF-8?q?[fix]bd=E4=B8=8A=E4=BC=A0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0codekey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java | 2 +- src/main/ui/static/analysis/risk_business.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index 783d94b4a..3ada0f519 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -402,7 +402,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo String uploadUrl = PlatformEnvironment.getEnv().concatUrl("/risk/upload/") + event.getString("risk_id") + "/" + codeKey; int orderType = event.getIntValue("order_type"); if (orderType == 1 || orderType == 2) - uploadUrl = PlatformEnvironment.getEnv().concatUrl("/manage.html#/analysis/monitoring/") + event.getString("risk_id") + "/bd/detail"; + uploadUrl = PlatformEnvironment.getEnv().concatUrl("/manage.html#/analysis/monitoring/") + event.getString("risk_id") + "/bd/detail?codeKey=" + codeKey; //uploadUrl = "localhost:9009" + "/manage.html#/analysis/monitoring/" + event.getString("risk_id") + "/bd/detail"; List bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date()); List bdNames = new ArrayList<>(); diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index 7527ee58d..6e6d3ec30 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -439,7 +439,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], } }; $scope.submit = function (form) { - var codeKey = $scope.riskEvent.submit_url.substring($scope.riskEvent.submit_url.lastIndexOf('/') + 1); + var codeKey = $scope.riskEvent.submit_url.substring($scope.riskEvent.submit_url.lastIndexOf('=') + 1) || $scope.riskEvent.submit_url.substring($scope.riskEvent.submit_url.lastIndexOf('/') + 1); $http.post('/risk/upload/' + codeKey, $scope.material).then(function (resp) { commonDialog.alert({ title: 'Success', From 6aeac6a5fee502bdad69d68cbd346b76e99ed8b8 Mon Sep 17 00:00:00 2001 From: lujian Date: Mon, 5 Nov 2018 11:50:29 +0800 Subject: [PATCH 4/8] =?UTF-8?q?[fix]gateway=E6=98=BE=E7=A4=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/boot/managerMainApp.js | 2 +- src/main/ui/static/boot/managerMainAppv2.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/ui/static/boot/managerMainApp.js b/src/main/ui/static/boot/managerMainApp.js index e86d81b69..5873c9bb1 100644 --- a/src/main/ui/static/boot/managerMainApp.js +++ b/src/main/ui/static/boot/managerMainApp.js @@ -431,7 +431,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '3': return '线上网关'; case '4': - return 'JSAPI网关'; + return 'WeChat HTML5'; case '5': return '线下网关'; case '6': diff --git a/src/main/ui/static/boot/managerMainAppv2.js b/src/main/ui/static/boot/managerMainAppv2.js index e5f3a2bf6..69806e518 100644 --- a/src/main/ui/static/boot/managerMainAppv2.js +++ b/src/main/ui/static/boot/managerMainAppv2.js @@ -445,7 +445,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo case '3': return '线上网关'; case '4': - return 'JSAPI网关'; + return 'WeChat HTML5'; case '5': return '线下网关'; case '6': From 9b9ee268e2714929979766aba39539fab58c3ae6 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Mon, 5 Nov 2018 18:06:31 +0800 Subject: [PATCH 5/8] update --- .../manage/mappers/payment/OrderMapper.java | 2 +- .../core/impl/RiskBusinessServiceImpl.java | 33 ++++++++++--------- .../manage/mappers/payment/OrderMapper.xml | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java index cb0a76396..0b400d7dd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.java @@ -80,7 +80,7 @@ public interface OrderMapper { PageList listTransactionsForApp(JSONObject params, PageBounds pageBounds); - JSONObject findOrderById(@Param("order_id") String orderId); + JSONObject findOrderById(@Param("order_id") String orderId,@Param("client_id") int clientId); List listHalloweenActOrder(JSONObject param); } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index 3ada0f519..d99bf093a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -12,7 +12,6 @@ import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; @@ -148,6 +147,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo @Override public List getRiskEventOrderList(JSONObject riskEvent) { String orderIds = riskEvent.getString("order_ids"); + JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker")); List tradeLogs = new ArrayList<>(); if (StringUtils.isNotBlank(orderIds)) { String[] orderIdArray = orderIds.trim().split(","); @@ -156,13 +156,13 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo // 获取订单信息 if (riskEvent.getIntValue("order_type") == 3) { for (int i = 0; i < orderIdArray.length; i++) { - realOrderId = orderMapper.findOrderById(orderIdArray[i]).getString("order_id"); + realOrderId = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id")).getString("order_id"); orderInfo = tradeLogService.getOrderDetail(new JSONObject(), riskEvent.getString("client_moniker"), realOrderId, null); tradeLogs.add(orderInfo); } } else { for (int i = 0; i < orderIdArray.length; i++) { - orderInfo = orderMapper.findOrderById(orderIdArray[i]); + orderInfo = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id")); tradeLogs.add(orderInfo); } } @@ -193,7 +193,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo String[] orderIdArray = orderIds.split(","); List orderAmountList = new ArrayList<>(); for (int i = 0; i < orderIdArray.length; i++) { - JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i]); + JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id")); // 判断该笔订单是否存在,是否属于该商户 if (orderInfo == null) throw new OrderNotExistsException(); @@ -262,7 +262,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo royalThreadPoolExecutor.execute(() -> { try { String emailId = mailService.sendRiskEmail(title, emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), - emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, event.getIntValue("order_type")==3?(List)ctx.getVariable("files"):null,event.getIntValue("order_type")); + emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, null,event.getIntValue("order_type")); event.put("email_status",1); event.put("result_type", RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()); event.put("submit_url",uploadUrl); @@ -349,7 +349,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo royalThreadPoolExecutor.execute(() -> { try { String emailId = mailService.sendRiskEmail("You need to resubmit risk materials", emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), - emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, event.getIntValue("order_type")==3?(List)ctx.getVariable("files"):null,event.getIntValue("order_type")); + emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, null,event.getIntValue("order_type")); event.put("email_status",2); event.put("result_type",RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); event.put("submit_url",uploadUrl); @@ -370,7 +370,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo royalThreadPoolExecutor.execute(() -> { try { String emailId = mailService.sendRiskEmail("Please submit risk materials as soon as possible", emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), - emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, event.getIntValue("order_type")==3?(List)ctx.getVariable("files"):null,event.getIntValue("order_type")); + emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), content, null,event.getIntValue("order_type")); event.put("email_status",3); riskEventMapper.update(event); } catch (Exception e) { @@ -440,7 +440,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo case 1: case 2: for(String orderId : orderIds){ - JSONObject order = orderMapper.findOrderById(orderId); + JSONObject order = orderMapper.findOrderById(orderId,client.getIntValue("client")); if(order==null){ throw new BadRequestException("Order: "+orderId+" not exists"); } @@ -453,7 +453,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo case 3: String realOrderId = ""; for(String orderId : orderIds){ - realOrderId = orderMapper.findOrderById(orderId).getString("order_id"); + realOrderId = orderMapper.findOrderById(orderId,client.getIntValue("client")).getString("order_id"); JSONObject order = tradeLogService.getOrderDetail(new JSONObject(), clientMoniker, realOrderId, null); if(order==null){ throw new BadRequestException("Order: "+orderId+" not exists"); @@ -469,12 +469,12 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo orders.add(order); } ctx.setVariable("orders", orders); - List attachList = new ArrayList<>(); - JSONObject file = new JSONObject(); - file.put("name", client.getString("short_name")+ "被查单号相关信息.xlsx"); - file.put("content", Base64.encodeBase64String(generateRiskOrders(event))); - attachList.add(file); - ctx.setVariable("files",attachList); +// List attachList = new ArrayList<>(); +// JSONObject file = new JSONObject(); +// file.put("name", client.getString("short_name")+ "被查单号相关信息.xlsx"); +// file.put("content", Base64.encodeBase64String(generateRiskOrders(event))); +// attachList.add(file); +// ctx.setVariable("files",attachList); case 4: ctx.setVariable("title","RoyalPay风控调查 — " + client.getString("short_name")); ctx.setVariable("emailsCcs", bdEmails); @@ -516,10 +516,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo private byte[] generateRiskOrders(JSONObject event) throws IOException { String[] orderIds = event.getString("order_ids").split(","); + JSONObject client = clientMapper.findClientByMonikerAll(event.getString("client_moniker")); Workbook wb = new XSSFWorkbook(); String realOrderId = ""; for(String orderId : orderIds){ - realOrderId = orderMapper.findOrderById(orderId).getString("order_id"); + realOrderId = orderMapper.findOrderById(orderId,client.getIntValue("client_id")).getString("order_id"); JSONObject orderDetail = tradeLogService.getOrderDetail(new JSONObject(), event.getString("client_moniker"), realOrderId, null); Sheet sheet = wb.createSheet(orderId); sheet.setDefaultColumnWidth((short) 40); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index cdbb3d8d2..2eb0ebb9b 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -819,7 +819,7 @@ AND t.refund_id IS NULL AND t.transaction_type = 'Credit' AND t.channel != 'System' - WHERE t.system_transaction_id = #{order_id} + WHERE t.system_transaction_id = #{order_id} AND p.client_id = #{client_id}
    Order ID - - + + -