|
|
@ -10,6 +10,7 @@ import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskOrdersMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
|
|
|
@ -107,6 +108,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private RiskFileMapper riskFileMapper;
|
|
|
|
private RiskFileMapper riskFileMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private RiskOrdersMapper riskOrdersMapper;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
private ClientDeviceTokenMapper clientDeviceTokenMapper;
|
|
|
|
private ClientDeviceTokenMapper clientDeviceTokenMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private AppMessageLogMapper appMessageLogMapper;
|
|
|
|
private AppMessageLogMapper appMessageLogMapper;
|
|
|
@ -179,6 +182,49 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
return PageListUtils.buildPageListResult(riskEvents);
|
|
|
|
return PageListUtils.buildPageListResult(riskEvents);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<JSONObject> analysisByIndustry(JSONObject params, JSONObject manager) {
|
|
|
|
|
|
|
|
List<JSONObject> industryAnalysis = riskEventMapper.analysisByIndustry(params);
|
|
|
|
|
|
|
|
for(JSONObject industry:industryAnalysis){
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(industry.getString("industry"))){
|
|
|
|
|
|
|
|
industry.put("industry","未知行业");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return industryAnalysis;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<String> industryArray(){
|
|
|
|
|
|
|
|
List<String> industryArray = new ArrayList<>();
|
|
|
|
|
|
|
|
industryArray.add("鞋包服饰");
|
|
|
|
|
|
|
|
industryArray.add("机票行业");
|
|
|
|
|
|
|
|
industryArray.add("软件服务");
|
|
|
|
|
|
|
|
industryArray.add("旅游票务");
|
|
|
|
|
|
|
|
industryArray.add("国际租车");
|
|
|
|
|
|
|
|
industryArray.add("医疗服务(出国)");
|
|
|
|
|
|
|
|
industryArray.add("医疗服务(不出国)");
|
|
|
|
|
|
|
|
industryArray.add("留学教育(网络教育)");
|
|
|
|
|
|
|
|
industryArray.add("留学教育(一年及以下)");
|
|
|
|
|
|
|
|
industryArray.add("其它货物贸易行业");
|
|
|
|
|
|
|
|
industryArray.add("文具/办公用品");
|
|
|
|
|
|
|
|
industryArray.add("综合商城");
|
|
|
|
|
|
|
|
industryArray.add("酒店行业");
|
|
|
|
|
|
|
|
industryArray.add("教育行业");
|
|
|
|
|
|
|
|
industryArray.add("国际物流");
|
|
|
|
|
|
|
|
industryArray.add("数码电器");
|
|
|
|
|
|
|
|
industryArray.add("母婴");
|
|
|
|
|
|
|
|
industryArray.add("化妆品");
|
|
|
|
|
|
|
|
industryArray.add("食品");
|
|
|
|
|
|
|
|
industryArray.add("留学教育(一年以上)");
|
|
|
|
|
|
|
|
industryArray.add("其它服务行业");
|
|
|
|
|
|
|
|
industryArray.add("未知行业");
|
|
|
|
|
|
|
|
return industryArray;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<JSONObject> analysisByAmount(JSONObject params, JSONObject manager) {
|
|
|
|
|
|
|
|
return riskEventMapper.analysisByAmount(params);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject getRiskEventDetail(String riskId) {
|
|
|
|
public JSONObject getRiskEventDetail(String riskId) {
|
|
|
|
|
|
|
|
|
|
|
@ -266,7 +312,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
// 将订单order_id存入数据库方便后面快速查询
|
|
|
|
// 将订单order_id存入数据库方便后面快速查询
|
|
|
|
JSONObject orderInfo = transactionList.get(0);
|
|
|
|
JSONObject orderInfo = transactionList.get(0);
|
|
|
|
realOrderIdList.add(orderInfo.getString("order_id"));
|
|
|
|
realOrderIdList.add(orderInfo.getString("order_id"));
|
|
|
|
orderAmountList.add(orderInfo.getString("transaction_amount"));
|
|
|
|
orderAmountList.add(orderInfo.getString("clearing_amount"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
|
|
|
|
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
|
|
|
|
params.put("real_order_ids", StringUtils.join(realOrderIdList, ","));
|
|
|
|
params.put("real_order_ids", StringUtils.join(realOrderIdList, ","));
|
|
|
@ -278,6 +324,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
public void addRiskEvent(JSONObject params, JSONObject manager) {
|
|
|
|
public void addRiskEvent(JSONObject params, JSONObject manager) {
|
|
|
|
params = getEvent(params);
|
|
|
|
params = getEvent(params);
|
|
|
|
riskEventMapper.save(params);
|
|
|
|
riskEventMapper.save(params);
|
|
|
|
|
|
|
|
setRiskOrders(params);
|
|
|
|
params = riskEventMapper.findAll(params).get(0);
|
|
|
|
params = riskEventMapper.findAll(params).get(0);
|
|
|
|
riskProcessLogService.addRiskProcessLog(params.getString("risk_id"),
|
|
|
|
riskProcessLogService.addRiskProcessLog(params.getString("risk_id"),
|
|
|
|
params.getString("fillin_id"),
|
|
|
|
params.getString("fillin_id"),
|
|
|
@ -287,10 +334,27 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
RiskResultTypeEnum.NOT_HANDLED.getResultType());
|
|
|
|
RiskResultTypeEnum.NOT_HANDLED.getResultType());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setRiskOrders(JSONObject params){
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(params.getString("order_ids"))){
|
|
|
|
|
|
|
|
String riskId = params.getString("risk_id");
|
|
|
|
|
|
|
|
String orderIds = params.getString("real_order_ids");
|
|
|
|
|
|
|
|
for(String orderId : orderIds.split(",")){
|
|
|
|
|
|
|
|
JSONObject order = transactionMapper.findByOrderId(orderId);
|
|
|
|
|
|
|
|
JSONObject riskOrder = new JSONObject();
|
|
|
|
|
|
|
|
riskOrder.put("risk_id",riskId);
|
|
|
|
|
|
|
|
riskOrder.put("order_id",orderId);
|
|
|
|
|
|
|
|
riskOrder.put("clearing_amount",order.getString("clearing_amount"));
|
|
|
|
|
|
|
|
riskOrdersMapper.save(riskOrder);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void updateRiskEvent(JSONObject params) {
|
|
|
|
public void updateRiskEvent(JSONObject params) {
|
|
|
|
params = getEvent(params);
|
|
|
|
params = getEvent(params);
|
|
|
|
riskEventMapper.update(params);
|
|
|
|
riskEventMapper.update(params);
|
|
|
|
|
|
|
|
riskOrdersMapper.clearOrders(params.getString("risk_id"));
|
|
|
|
|
|
|
|
setRiskOrders(params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -930,4 +994,23 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
event = riskEventMapper.findById(riskId);
|
|
|
|
event = riskEventMapper.findById(riskId);
|
|
|
|
return event;
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void completeOrderAmount() {
|
|
|
|
|
|
|
|
List<JSONObject> riskEventList = getRiskEvents(null);
|
|
|
|
|
|
|
|
for(JSONObject riskEvent:riskEventList){
|
|
|
|
|
|
|
|
if(riskEvent.getIntValue("order_type")==4 || StringUtils.isBlank(riskEvent.getString("real_order_ids"))){
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String[] order_ids=riskEvent.getString("real_order_ids").split(",");
|
|
|
|
|
|
|
|
for(String orderId : order_ids){
|
|
|
|
|
|
|
|
JSONObject transaction = transactionMapper.findByOrderId(orderId);
|
|
|
|
|
|
|
|
JSONObject riskOrder = new JSONObject();
|
|
|
|
|
|
|
|
riskOrder.put("risk_id",riskEvent.getString("risk_id"));
|
|
|
|
|
|
|
|
riskOrder.put("order_id",transaction.getString("order_id"));
|
|
|
|
|
|
|
|
riskOrder.put("clearing_amount",transaction.getString("clearing_amount"));
|
|
|
|
|
|
|
|
riskOrdersMapper.save(riskOrder);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|