|
|
|
@ -149,7 +149,10 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
|
String orderIds = riskEvent.getString("order_ids");
|
|
|
|
|
JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker"));
|
|
|
|
|
List<JSONObject> tradeLogs = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotBlank(orderIds)) {
|
|
|
|
|
/**
|
|
|
|
|
* 通用号调单会有client为空的情况,所以无法查到订单信息
|
|
|
|
|
*/
|
|
|
|
|
if (client != null && StringUtils.isNotBlank(orderIds)) {
|
|
|
|
|
String[] orderIdArray = orderIds.trim().split(",");
|
|
|
|
|
JSONObject orderInfo = new JSONObject();
|
|
|
|
|
String realOrderId = "";
|
|
|
|
@ -192,19 +195,26 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
|
params.put("order_ids", orderIds);
|
|
|
|
|
String[] orderIdArray = orderIds.split(",");
|
|
|
|
|
List<String> orderAmountList = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < orderIdArray.length; i++) {
|
|
|
|
|
JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id"));
|
|
|
|
|
// 判断该笔订单是否存在,是否属于该商户
|
|
|
|
|
if (orderInfo == null)
|
|
|
|
|
throw new OrderNotExistsException();
|
|
|
|
|
else {
|
|
|
|
|
if (!clientMoniker.equals(orderInfo.getString("partner_code"))) {
|
|
|
|
|
throw new OrderNotMatchException();
|
|
|
|
|
/**
|
|
|
|
|
* 通用号调单的时候,是不用填写client_moniker的,但是系统需要client_id关联查询订单信息,
|
|
|
|
|
* 所以当client为空的时候,就不去校验订单的信息了,从而order_amounts字段为空
|
|
|
|
|
* 带来的影响是前台根据金额字段查询对该风控事件就不起作用了。
|
|
|
|
|
*/
|
|
|
|
|
if (client != null) {
|
|
|
|
|
for (int i = 0; i < orderIdArray.length; i++) {
|
|
|
|
|
JSONObject orderInfo = orderMapper.findOrderById(orderIdArray[i],client.getIntValue("client_id"));
|
|
|
|
|
// 判断该笔订单是否存在,是否属于该商户
|
|
|
|
|
if (orderInfo == null)
|
|
|
|
|
throw new OrderNotExistsException();
|
|
|
|
|
else {
|
|
|
|
|
if (!clientMoniker.equals(orderInfo.getString("partner_code"))) {
|
|
|
|
|
throw new OrderNotMatchException();
|
|
|
|
|
}
|
|
|
|
|
orderAmountList.add(orderInfo.getString("total_amount"));
|
|
|
|
|
}
|
|
|
|
|
orderAmountList.add(orderInfo.getString("total_amount"));
|
|
|
|
|
}
|
|
|
|
|
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
|
|
|
|
|
}
|
|
|
|
|
params.put("order_amounts", StringUtils.join(orderAmountList, ","));
|
|
|
|
|
}
|
|
|
|
|
riskEventMapper.save(params);
|
|
|
|
|
}
|
|
|
|
|