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 ccc4075a6..64933b72d 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 @@ -9,6 +9,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; import au.com.royalpay.payment.manage.notice.core.MailService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; +import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskOrderTypeEnum; import au.com.royalpay.payment.tools.env.PlatformEnvironment; @@ -113,13 +114,10 @@ public class RiskBusinessServiceImpl implements RiskBusinessService { if (StringUtils.isNotBlank(orderIds)) { String[] orderIdArray = orderIds.trim().split(","); JSONObject query = new JSONObject(); - // 获取每笔订单的信息 + // 获取订单信息 for (int i = 0; i < orderIdArray.length; i++) { - query.put("order_id", orderIdArray[i]); - PageList logs = orderMapper.listOrders(query, new PageBounds()); - if (logs != null && logs.size() != 0) { - tradeLogs.add(logs.get(0)); - } + JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i]); + tradeLogs.add(orderInfo); } } return tradeLogs; @@ -162,7 +160,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService { for (int i = 1; i <= 10; i++) { filePath = riskMaterial.getString("file" + i + "_url"); if (filePath != null) { - zos.putNextEntry(new ZipEntry(filePath.substring(filePath.lastIndexOf("/")))); + // 文件名前添加'file' + i是为了防止文件名一样 + zos.putNextEntry(new ZipEntry("file" + i + filePath.substring(filePath.lastIndexOf("/")))); InputStream inputStream = new URL(filePath).openConnection().getInputStream(); byte[] buffer = new byte[1024]; int result = 0; @@ -192,7 +191,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService { 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")); event.put("email_status",1); - event.put("result_type",1); + event.put("result_type", RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()); + Integer orderType = event.getInteger("order_type"); + if (orderType == RiskOrderTypeEnum.WARNING_ORDER.getOrderType()) { + event.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType()); + } riskEventMapper.update(event); } catch (Exception e) { throw new EmailException("Email Sending Failed", e); @@ -213,7 +216,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService { 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")); event.put("email_status",2); - event.put("result_type",4); + event.put("result_type",RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); riskEventMapper.update(event); } catch (Exception e) { throw new EmailException("Email Sending Failed", e); diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskEmailStatusEnum.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskEmailStatusEnum.java new file mode 100644 index 000000000..7f9f2e570 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskEmailStatusEnum.java @@ -0,0 +1,27 @@ +package au.com.royalpay.payment.manage.riskbusiness.enums; + +/** + * @Author lvjian + * @Date 2018/10/16 22:22 + */ +public enum RiskEmailStatusEnum { + NOT_SEND(0), + ALREADY_SEND(1), + BACK_AND_SEND(2), + SEND_EMAIL_AGAIN(3), + ; + + private Integer emailStatus; + + RiskEmailStatusEnum(Integer emailStatus) { + this.emailStatus = emailStatus; + } + + public Integer getEmailStatus() { + return emailStatus; + } + + public void setEmailStatus(Integer emailStatus) { + this.emailStatus = emailStatus; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java index 9df482c2f..d0d5604ff 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskOrderTypeEnum.java @@ -5,11 +5,13 @@ package au.com.royalpay.payment.manage.riskbusiness.enums; * @Date 2018/10/16 20:18 */ public enum RiskOrderTypeEnum { + WECHAT_ORDER(1), ALIPAY_ORDER(2), ROYALPAY_ORDER(3), WARNING_ORDER(4), - GENERAL_ORDER(5); + GENERAL_ORDER(5) + ; private Integer orderType; diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java index f26606a8c..2938586d8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/enums/RiskResultTypeEnum.java @@ -13,17 +13,17 @@ public enum RiskResultTypeEnum { MATERIAL_NOT_PASS(4), ALREADY_HANDLED(5); - private Integer orderType; + private Integer resultType; - public Integer getOrderType() { - return orderType; + RiskResultTypeEnum(Integer resultType) { + this.resultType = resultType; } - public void setOrderType(Integer orderType) { - this.orderType = orderType; + public Integer getResultType() { + return resultType; } - RiskResultTypeEnum(Integer orderType) { - this.orderType = orderType; + public void setResultType(Integer resultType) { + this.resultType = resultType; } } diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index cb273e2fb..aeeb5907a 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -214,7 +214,10 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], title: 'Warning', content: 'Please confirm sending mail.' }).then(function () { - $http.put('/risk/business/' + $scope.riskEvent.risk_id + '/upload_mail').then(function () { + var url = '/risk/business/' + $scope.riskEvent.risk_id + '/upload_mail'; + if ($scope.riskEvent.result_type == 1) + url = '/risk/business/' + $scope.riskEvent.risk_id + '/urge'; + $http.put(url).then(function () { $state.reload(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); diff --git a/src/main/ui/static/analysis/templates/audit_material.html b/src/main/ui/static/analysis/templates/audit_material.html index b8092759b..e4a462ad2 100644 --- a/src/main/ui/static/analysis/templates/audit_material.html +++ b/src/main/ui/static/analysis/templates/audit_material.html @@ -6,11 +6,11 @@ 一键下载 通过 打回 diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index 9a052136e..cae8734e4 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -51,7 +51,7 @@

+ ng-bind="clientInfo.sub_merchant_id">

@@ -117,44 +117,19 @@ - -
-
+
-
+
@@ -163,7 +138,9 @@
- +
@@ -172,8 +149,7 @@
+ bs-switch>
@@ -183,13 +159,13 @@
@@ -257,7 +233,7 @@
Send Email {{riskEvent.result_type == 1 ? 'again' : ''}} diff --git a/src/main/ui/static/analysis/templates/risk_business.html b/src/main/ui/static/analysis/templates/risk_business.html index 3cb5d0421..92ed5fc19 100644 --- a/src/main/ui/static/analysis/templates/risk_business.html +++ b/src/main/ui/static/analysis/templates/risk_business.html @@ -223,19 +223,7 @@ - - {{riskEvent.result_type | resultType}}( - 临时关停商户 - 临时关停渠道 - ) - - - {{riskEvent.result_type | resultType}}( - 加入商户黑名单 - 加入用户黑名单 - ) - - + {{riskEvent.result_type | resultType}}