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 @@ +
+ +