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 ed13c38ff..50105af90 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 @@ -108,10 +108,16 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo @Override public JSONObject getRiskEventsByPage(JSONObject params, JSONObject manager) { - // TODO: 2018/10/19 BD看到的result_type应该是1或者4,后续改进 + // 如果登录的角色是BD,添加查询条件result_type为1或者4,order_type为1或者2 if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { params.put("bd_id", manager.getString("manager_id")); - params.put("result_type", RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()); + List orderTypes = Arrays.asList(RiskOrderTypeEnum.WECHAT_ORDER.getOrderType(), + RiskOrderTypeEnum.ALIPAY_ORDER.getOrderType()); + params.put("order_types", orderTypes); + + List resultTypes = Arrays.asList(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType(), + RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType()); + params.put("result_types", resultTypes); } PageList riskEvents = riskEventMapper.listRisksByPage(params, new PageBounds(params.getInteger("page"), 10, Order.formString("create_time.desc"))); @@ -574,7 +580,6 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo @Override public void checkTodo(JSONObject manager, List notices) { - // TODO: 2018/10/19 后面把if判断里面的权限改一下 if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { JSONObject params = new JSONObject(); params.put("bd_id", manager.getString("manager_id")); @@ -586,7 +591,10 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo params.put("client_moniker", client.getString("client_moniker")); List riskEventList = riskEventMapper.findAll(params); for (JSONObject event : riskEventList) { - if (event.getIntValue("result_type") == 1) { + Integer resultType = event.getIntValue("result_type"); + Integer orderType = event.getIntValue("order_type"); + // Integer是对象,所以用equals方法比较 + if ((resultType.equals(RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()) || resultType.equals(RiskResultTypeEnum.MATERIAL_NOT_PASS.getResultType())) && (orderType.equals(RiskOrderTypeEnum.WECHAT_ORDER.getOrderType()) || orderType.equals(RiskOrderTypeEnum.ALIPAY_ORDER.getOrderType()))) { noticeFlag = true; break; } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java index 50a7c8500..68bb91911 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/web/RiskFileUploadController.java @@ -42,6 +42,7 @@ public class RiskFileUploadController { */ @RequestMapping(value = "/{codeKey}", method = RequestMethod.POST) public void upload(@PathVariable String codeKey, @RequestBody JSONObject material) { + riskUploadService.checkUploadMailKey(codeKey, material.getString("risk_id")); riskUploadService.submitMaterial(material); riskUploadService.deleteUploadMailKey(codeKey); } 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 e0c574170..575f2e469 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,7 +51,14 @@ - LEFT JOIN sys_client_bd scb + LEFT JOIN( + SELECT DISTINCT client_id + FROM sys_client_bd + WHERE + is_valid = 1 + AND bd_id = #{bd_id} + AND end_date > NOW() + ) scb ON sc.client_id = scb.client_id @@ -61,12 +68,24 @@ AND re.client_moniker = #{client_moniker} - + AND re.order_type = #{order_type} - + + + #{order_type} + + + + AND re.result_type = #{result_type} + + + #{result_type} + + + AND re.order_ids LIKE CONCAT('%', #{order_ids}, '%') @@ -82,9 +101,6 @@ AND re.reply_email_date = #{reply_email_date} - - AND scb.bd_id = #{bd_id} - diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index fff773ec3..c1924b7f6 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -24,8 +24,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], var resultTypesMap = { "0": "未处理", - "1": "已发送邮件至BD", - "2": "BD已提交材料,等待审核", + "1": "已发送邮件", + "2": "已提交材料,等待审核", "3": "材料审核通过", "4": "材料审核不通过,已打回", "5": "已处理" @@ -377,6 +377,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.clientInfo = $scope.riskEvent.clientInfo; $scope.material={}; $scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss'); + $scope.material.risk_id = $scope.riskEvent.risk_id; $scope.uploadFile1 = function (files) { if (files && files.length) { var urls = new Array(); @@ -516,7 +517,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], } }; $scope.submit = function (form) { - $http.post('/risk/upload/'+$scope.codeKey, $scope.material).then(function (resp) { + var codeKey = $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', content: 'Submit successfully', type: 'success'}); alert('Submit successfully'); window.location.href="/risk_upload_success.html"; diff --git a/src/main/ui/static/analysis/templates/audit_material.html b/src/main/ui/static/analysis/templates/audit_material.html index 16c92636e..b62e28732 100644 --- a/src/main/ui/static/analysis/templates/audit_material.html +++ b/src/main/ui/static/analysis/templates/audit_material.html @@ -153,17 +153,6 @@ - - - - - - - - - - - diff --git a/src/main/ui/static/analysis/templates/bd_upload_material.html b/src/main/ui/static/analysis/templates/bd_upload_material.html index 010dfa15e..00983f23b 100644 --- a/src/main/ui/static/analysis/templates/bd_upload_material.html +++ b/src/main/ui/static/analysis/templates/bd_upload_material.html @@ -1,6 +1,6 @@
-

{{clientInfo.short_name}}

+
diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index 78c510c4b..7e191973b 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -267,7 +267,7 @@
Upload Material