From 543327f0ff893caaa02d1b12055f95312d624075 Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Thu, 13 Dec 2018 18:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E6=8E=A7=E4=BA=8B=E4=BB=B6=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A6=81=E7=94=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../riskbusiness/core/RiskBusinessService.java | 2 ++ .../core/impl/RiskBusinessServiceImpl.java | 8 ++++++++ .../riskbusiness/web/RiskBusinessController.java | 5 +++++ .../mappers/riskbusiness/RiskEventMapper.xml | 3 +++ src/main/ui/static/analysis/risk_business.js | 14 ++++++++++++++ .../analysis/templates/riskEvent_detail.html | 3 +++ 6 files changed, 35 insertions(+) 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 74a62881f..88168752b 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 @@ -126,6 +126,8 @@ public interface RiskBusinessService { */ JSONObject getRiskEventMaterialsRemark(String riskId); + void banRiskEvent(String riskId); + JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager); JSONObject updateIsSendClient(String riskId); 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 22f4494ac..5b418e5b0 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 @@ -980,6 +980,14 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo return result; } + @Override + public void banRiskEvent(String riskId) { + JSONObject params = new JSONObject(); + params.put("risk_id",riskId); + params.put("is_valid",0); + riskEventMapper.update(params); + } + @Transactional @Override public JSONObject riskEventMaterialPass(JSONObject params, JSONObject manager) { 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 b589de9fb..ef501dec0 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 @@ -151,6 +151,11 @@ public class RiskBusinessController { riskBusinessService.sendUrgeEmail(risk_id); } + @RequestMapping(value = "/ban/{risk_id}",method = RequestMethod.DELETE) + public void banEvent(@PathVariable String risk_id){ + riskBusinessService.banRiskEvent(risk_id); + } + @GetMapping(value = "/partners") public List getPartners(PartnerQuery partnerQuery) { JSONObject param = partnerQuery.toJsonParam(); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml index e188bec19..5ce07e53d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskEventMapper.xml @@ -51,6 +51,7 @@ ON sc.client_id = scb.client_id + re.is_valid = 1 AND re.risk_id = #{risk_id} @@ -175,6 +176,7 @@ ON re.risk_id = ro.risk_id + re.is_valid = 1 AND re.risk_id = #{risk_id} @@ -257,6 +259,7 @@ ) ro ON re.risk_id = ro.risk_id + re.is_valid = 1 AND re.risk_id = #{risk_id} diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index 29aa25c7c..9e4c5a1c8 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -292,6 +292,20 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], orderChannel = null; } + $scope.deleteRiskEvent = function () { + commonDialog.confirm({ + title: 'Delete This Risk Event', + content: 'Are you sure to delete this risk event?' + }).then(function () { + $http.delete('/risk/business/ban/' + $scope.riskEvent.risk_id).then(function () { + $state.go('analysis_monitoring.risk_business'); + commonDialog.alert({title: 'Delete', content: 'Risk Event Already Disabled', type: 'error'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + /** * order_ids在指定位置换行 * @param str diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index 08917465a..229b61246 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -9,6 +9,9 @@ +
+ +