diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java index f5e9f5b9f..ae34f0e95 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/riskbusiness/RiskMaterialMapper.java @@ -15,6 +15,9 @@ public interface RiskMaterialMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject material); + @AutoSql(type = SqlType.UPDATE) + void update(JSONObject material); + List findAllMaterials(@Param("risk_id") String risk_id); } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskMaterialService.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskMaterialService.java new file mode 100644 index 000000000..1265e6540 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/RiskMaterialService.java @@ -0,0 +1,17 @@ +package au.com.royalpay.payment.manage.riskbusiness.core; + +/** + * @Description: + * @Author: lujian + * @Date: 2018/11/19 19:40 + */ + +public interface RiskMaterialService { + + /** + * 更新最新一次提交的材料 + * @param riskId + * @param description + */ + void updateRiskMaterial(String riskId, String description); +} 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 bd99a0bcf..60e01399e 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 @@ -46,7 +46,6 @@ import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -164,6 +163,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo (!orderType.equals(RiskOrderTypeEnum.WARNING_ORDER.getOrderType())) && (!orderType.equals(RiskOrderTypeEnum.GENERAL_ORDER.getOrderType())); riskEvent.put("pass_timeout", isPassTimeout); + // 材料拒绝说明 + List materialList = riskMaterialMapper.findAllMaterials(riskEvent.getString("risk_id")); + if (!materialList.isEmpty()) { + riskEvent.put("refuse_description", materialList.get(0).getString("refuse_description")); + } } return PageListUtils.buildPageListResult(riskEvents); } @@ -403,6 +407,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo JSONObject event = getRiskEventDetail(riskId); Context ctx = getMailContext(event); ctx.setVariable("refuse",true); + ctx.setVariable("refuse_description", riskMaterialMapper.findAllMaterials(riskId).get(0).getString("refuse_description")); final List emailsTos = (List)ctx.getVariable("emailsTos"); final List emailsCcs = ctx.getVariable("emailsCcs")==null?new ArrayList<>():(List)ctx.getVariable("emailsCcs"); final String uploadUrl = (String)ctx.getVariable("uploadUrl"); @@ -457,8 +462,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo expireDay = "3"; } )*/ - // 原来设定的过期时间是7天,现在改成一个月 - String expireDay = "30"; + // 原来设定的过期时间是7天,现在改成半个月 + String expireDay = "180"; 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"); @@ -552,9 +557,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo public JSONObject getRiskMaterial(JSONObject param) { List riskMaterialList = riskMaterialMapper.findAllMaterials(param.getString("risk_id")); if (riskMaterialList != null && riskMaterialList.size() > 0){ - List files = riskFileMapper.findAllFiles(riskMaterialList.get(0).getString("material_id")); - JSONObject fileNew = new JSONObject(); - fileNew.put("description",riskMaterialList.get(0).getString("description")); + JSONObject fileNew = riskMaterialList.get(0); + List files = riskFileMapper.findAllFiles(fileNew.getString("material_id")); for(JSONObject file : files){ int fileType = file.getIntValue("file_type"); if(!fileNew.containsKey("file"+fileType)){ diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskMaterialServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskMaterialServiceImpl.java new file mode 100644 index 000000000..06efa92a1 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskMaterialServiceImpl.java @@ -0,0 +1,32 @@ +package au.com.royalpay.payment.manage.riskbusiness.core.impl; + +import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; +import au.com.royalpay.payment.manage.riskbusiness.core.RiskMaterialService; +import com.alibaba.fastjson.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @Description: + * @Author: lujian + * @Date: 2018/11/19 19:45 + */ +@Service +public class RiskMaterialServiceImpl implements RiskMaterialService { + + @Resource + private RiskMaterialMapper riskMaterialMapper; + + @Override + public void updateRiskMaterial(String riskId, String description) { + List materialList = riskMaterialMapper.findAllMaterials(riskId); + if (!materialList.isEmpty()){ + JSONObject material = materialList.get(0); + material.put("refuse_description", description); + riskMaterialMapper.update(material); + } + } +} 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 6eff8ecb8..94f684bb0 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 @@ -5,9 +5,11 @@ import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery; import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; +import au.com.royalpay.payment.manage.riskbusiness.core.RiskMaterialService; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import com.alibaba.fastjson.JSONObject; import com.sun.org.apache.xerces.internal.impl.dv.xs.BooleanDV; import com.sun.org.apache.xpath.internal.operations.Bool; @@ -35,6 +37,9 @@ public class RiskBusinessController { @Autowired private RiskBusinessService riskBusinessService; + @Autowired + private RiskMaterialService riskMaterialService; + @Autowired private ClientManager clientManager; @@ -78,7 +83,8 @@ public class RiskBusinessController { } @RequestMapping(value = "/{risk_id}/refuse",method = RequestMethod.PUT) - public void refuseEmail(@PathVariable String risk_id) throws IOException { + public void refuseEmail(@PathVariable String risk_id, @RequestBody JSONObject otherParams) throws IOException { + riskMaterialService.updateRiskMaterial(risk_id, otherParams.getString("refuse_description")); riskBusinessService.sendRefuseEmail(risk_id); } diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html index a4e5e7fd4..2decbc81b 100644 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ b/src/main/resources/templates/mail/risk_upload_mail.html @@ -3,7 +3,11 @@ Dear :

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

您提交的风控材料已被拒绝。
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:

1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;
diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index 40c08befe..e62781b43 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -538,25 +538,42 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], var url = '/risk/business/events'; var warningMessageHTML = '是否确定通过该材料?'; - if (auditType == 4) { - url = '/risk/business/' + $scope.riskEvent.risk_id + '/refuse'; - warningMessageHTML = '是否确定拒绝该材料?' - } - commonDialog.confirm({ - title: 'Warning', - contentHtml: $sce.trustAsHtml(warningMessageHTML) - }).then(function () { - $scope.riskEvent.result_type = auditType; - $http.put(url, $scope.riskEvent).then(function (resp) { - $state.go('^', {}, {reload: true}); - }, function (resp) { - commonDialog.alert({ - title: 'Error', - content: resp.data.message, - type: 'error' + if (auditType == 3) { + commonDialog.confirm({ + title: 'Warning', + contentHtml: $sce.trustAsHtml(warningMessageHTML) + }).then(function () { + $scope.riskEvent.result_type = auditType; + $http.put(url, $scope.riskEvent).then(function (resp) { + commonDialog.alert({title: 'Success', content: "材料已通过!"}); + $state.go('^', {}, {reload: true}); + }, function (resp) { + commonDialog.alert({ + title: 'Error', + content: resp.data.message, + type: 'error' + }); }); }); - }); + } + else if (auditType == 4) { + url = '/risk/business/' + $scope.riskEvent.risk_id + '/refuse'; + //warningMessageHTML = '是否确定拒绝该材料?' + commonDialog.inputText({title: 'Input Refuse Description', size: 'lg'}).then(function (text) { + $scope.riskEvent.refuse_description = text; + $http.put(url, $scope.riskEvent).then(function () { + commonDialog.alert({title: 'Success', content: "材料已拒绝!"}); + $state.go('^', {}, {reload: true}); + }, 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 d4e157704..d93b759fc 100644 --- a/src/main/ui/static/analysis/templates/audit_material.html +++ b/src/main/ui/static/analysis/templates/audit_material.html @@ -25,9 +25,18 @@

+
+ +
+
+

+
+
+
+
-
+

diff --git a/src/main/ui/static/commons/services/commonDialog.js b/src/main/ui/static/commons/services/commonDialog.js index 57aa93950..e69b39019 100644 --- a/src/main/ui/static/commons/services/commonDialog.js +++ b/src/main/ui/static/commons/services/commonDialog.js @@ -74,7 +74,7 @@ define(['../app', 'angular'], function (app, angular) { inputText:function (cfg) { return $uibModal.open({ templateUrl:'/static/commons/templates/text_input.html', - size:'sm', + size: cfg.size || 'sm', resolve:{ cfg:function () { return cfg;