master
lujian 6 years ago
parent 01e0c211ac
commit 968c4848c5

@ -15,6 +15,9 @@ public interface RiskMaterialMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject material);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject material);
List<JSONObject> findAllMaterials(@Param("risk_id") String risk_id);
}

@ -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);
}

@ -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<JSONObject> 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<String> emailsTos = (List<String>)ctx.getVariable("emailsTos");
final List<String> emailsCcs = ctx.getVariable("emailsCcs")==null?new ArrayList<>():(List<String>)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<JSONObject> riskMaterialList = riskMaterialMapper.findAllMaterials(param.getString("risk_id"));
if (riskMaterialList != null && riskMaterialList.size() > 0){
List<JSONObject> 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<JSONObject> files = riskFileMapper.findAllFiles(fileNew.getString("material_id"));
for(JSONObject file : files){
int fileType = file.getIntValue("file_type");
if(!fileNew.containsKey("file"+fileType)){

@ -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<JSONObject> materialList = riskMaterialMapper.findAllMaterials(riskId);
if (!materialList.isEmpty()){
JSONObject material = materialList.get(0);
material.put("refuse_description", description);
riskMaterialMapper.update(material);
}
}
}

@ -5,15 +5,24 @@ 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;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
@ -28,6 +37,9 @@ public class RiskBusinessController {
@Autowired
private RiskBusinessService riskBusinessService;
@Autowired
private RiskMaterialService riskMaterialService;
@Autowired
private ClientManager clientManager;
@ -71,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);
}

@ -3,7 +3,11 @@
<b>Dear <span th:text="${bdNamesStr}"></span> :</b>
<p>
<span th:text="${hello}"></span><span th:text="${bdNamesStr}"></span>
<span th:if="${refuse}">,您提交的风控材料已被拒绝</span>。 请于
<span th:if="${refuse}">,您提交的风控材料已被拒绝</span>
<span th:if="${refuse_description != null}">
拒绝理由:<span th:text="${refuse_description}" style="background-color: yellow"></span>
</span>
请于
<span th:text="${reply_date}" style="background: #FCE824;"></span>
<span style="background: #FCE824;">下午5:00悉尼时间</span>提供腾讯被查商户
<span th:text="${client.short_name}"></span> (<span th:text="${client.client_moniker}"></span>)的以下材料:
@ -46,6 +50,9 @@
<p th:if="${refuse}" style="background-color: #dd0000">您提交的风控材料已被拒绝。<br>
The risk materials you submitted has been rejected
</p>
<p th:if="${refuse_description != null}">
拒绝理由:<span th:text="${refuse_description}" style="background-color: yellow"></span>
</p>
<p>近期由于我们的风控系统检测到您的交易异常<span th:if="${royalpay_order_type==1}">已暂时将您的清算周期调整为T+<span th:text="${client.clean_days}"></span></span>,还请您提供以下材料,还原附件中列明的交易的真实背景:<br>
RoyalPay's risk management system recently has identified abnormal transactions from your records<span th:if="${royalpay_order_type==1}">, clean days has been adjusted to T+<span th:text="${client.clean_days}"></span></span>.so please provide us with following materials to assist in verifying the real scenario of the transactions attached:</p>
<p>1.请解释相应的消费场景/业务模式,例如网站商城,扫码支付, 消费者到店支付等;<br>

@ -538,25 +538,42 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
var url = '/risk/business/events';
var warningMessageHTML = '是否确定<span style="color: green; font-weight: bolder; font-size: 20px;">通过</span>该材料?';
if (auditType == 4) {
url = '/risk/business/' + $scope.riskEvent.risk_id + '/refuse';
warningMessageHTML = '是否确定<span style="color: red; font-weight: bolder; font-size: 20px;">拒绝</span>该材料?'
}
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 = '是否确定<span style="color: red; font-weight: bolder; font-size: 20px;">拒绝</span>该材料?'
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'
});
})
})
}
};
}
]);

@ -25,9 +25,18 @@
</div>
<div class="panel-body">
<div class="form-vertical">
<div class="form-group" ng-if="riskMaterial.refuse_description != null">
<label class="control-label col-sm-2">Refuse Reason</label>
<div class="col-sm-10">
<div class="form-control-static">
<p ng-bind="riskMaterial.refuse_description"></p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Description:</label>
<div class="col-sm-8">
<div class="col-sm-10">
<div class="form-control-static">
<p ng-bind="riskMaterial.description"></p>
</div>

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

Loading…
Cancel
Save