master
lujian 6 years ago
parent ea403c5072
commit 7ac0a012d6

@ -17,6 +17,7 @@ import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.pushMessage.APNSMessageHelper; import au.com.royalpay.payment.manage.pushMessage.APNSMessageHelper;
import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskEmailStatusEnum;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.manage.signin.beans.TodoNotice; import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider; import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
@ -55,6 +56,7 @@ import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.text.ParseException;
import java.util.*; import java.util.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@ -138,6 +140,31 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
} }
PageList<JSONObject> riskEvents = riskEventMapper.listRisksByPage(params, new PageBounds(params.getInteger("page"), 10, Order.formString("create_time.desc"))); PageList<JSONObject> riskEvents = riskEventMapper.listRisksByPage(params, new PageBounds(params.getInteger("page"), 10, Order.formString("create_time.desc")));
/**
*
* royalpay
*
*/
Date currentDate = new Date(), replyDate;
Integer resultType, orderType;
boolean isPassTimeout = false;
for (JSONObject riskEvent : riskEvents) {
try {
replyDate = DateUtils.parseDate(riskEvent.getString("reply_email_date"), "yyyy-MM-dd");
} catch (ParseException e) {
replyDate = currentDate;
e.printStackTrace();
}
resultType = riskEvent.getInteger("result_type");
orderType = riskEvent.getInteger("order_type");
isPassTimeout = (currentDate.after(replyDate)) &&
(!resultType.equals(RiskResultTypeEnum.MATERIAL_AUDIT_PASS.getResultType())) &&
(!resultType.equals(RiskResultTypeEnum.ALREADY_HANDLED.getResultType())) &&
(!orderType.equals(RiskOrderTypeEnum.WARNING_ORDER.getOrderType())) &&
(!orderType.equals(RiskOrderTypeEnum.GENERAL_ORDER.getOrderType()));
riskEvent.put("pass_timeout", isPassTimeout);
}
return PageListUtils.buildPageListResult(riskEvents); return PageListUtils.buildPageListResult(riskEvents);
} }
@ -164,9 +191,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
String realOrderIds = riskEvent.getString("real_order_ids"); String realOrderIds = riskEvent.getString("real_order_ids");
JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker")); JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker"));
List<JSONObject> tradeLogs = new ArrayList<>(); List<JSONObject> tradeLogs = new ArrayList<>();
/** // 通用号调单会有client为空的情况所以无法查到订单信息
* client
*/
if (client != null && StringUtils.isNotBlank(realOrderIds)) { if (client != null && StringUtils.isNotBlank(realOrderIds)) {
String[] orderIdArray = realOrderIds.trim().split(","); String[] orderIdArray = realOrderIds.trim().split(",");
JSONObject orderInfo = new JSONObject(); JSONObject orderInfo = new JSONObject();
@ -299,7 +324,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
try { try {
String emailId = mailService.sendRiskEmail(title, emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","), String emailId = mailService.sendRiskEmail(title, emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","),
emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), "",content, null,event.getIntValue("order_type")); emailsCcs.isEmpty() ? "" : StringUtils.join(emailsCcs, ","), "",content, null,event.getIntValue("order_type"));
event.put("email_status",1); event.put("email_status", RiskEmailStatusEnum.ALREADY_SEND.getEmailStatus());
event.put("result_type", RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType()); event.put("result_type", RiskResultTypeEnum.SEND_EMAIL_TO_BD.getResultType());
event.put("submit_url",uploadUrl); event.put("submit_url",uploadUrl);
Integer orderType = event.getInteger("order_type"); Integer orderType = event.getInteger("order_type");

@ -1,17 +1,24 @@
package au.com.royalpay.payment.manage.riskbusiness.core.impl; package au.com.royalpay.payment.manage.riskbusiness.core.impl;
import au.com.royalpay.payment.core.exceptions.EmailException;
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.system.ClientMapper;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException; import java.text.ParseException;
@ -33,7 +40,7 @@ public class RiskUploadServiceIpml implements RiskUploadService {
@Override @Override
public void submitMaterial(JSONObject material) { public void submitMaterial(JSONObject material) {
JSONObject event = riskEventMapper.findById(material.getString("risk_id")); JSONObject event = riskEventMapper.findById(material.getString("risk_id"));
material.putIfAbsent("update_time", DateFormatUtils.format(new Date(), "yyyy-MM-dd hh:mm:ss")); material.put("update_time", DateFormatUtils.format(new Date(), "yyyy-MM-dd hh:mm:ss"));
riskMaterialMapper.save(material); riskMaterialMapper.save(material);
material.put("material_id",riskMaterialMapper.findAllMaterials(material.getString("risk_id")).get(0).getString("material_id")); material.put("material_id",riskMaterialMapper.findAllMaterials(material.getString("risk_id")).get(0).getString("material_id"));
for(int i=1;i<=10;i++){ for(int i=1;i<=10;i++){

@ -167,7 +167,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.orderTypes = orderTypesMap; $scope.orderTypes = orderTypesMap;
$scope.resultTypes = resultTypesMap; $scope.resultTypes = resultTypesMap;
$scope.channelResults = channelResultArray; $scope.channelResults = channelResultArray;
if (riskEvent.data.is_send_client == 1)
riskEvent.data.is_send_client = true;
$scope.riskEvent = riskEvent.data; $scope.riskEvent = riskEvent.data;
// 编辑表格的数据保存对象,重新从源数据复制,从而取消保存操作时不会更新视图
$scope.riskEventEdit = angular.copy(riskEvent.data);
//var index = $scope.riskEvent.order_ids.lastIndexOf(","); //var index = $scope.riskEvent.order_ids.lastIndexOf(",");
//$scope.riskEvent.order_ids = $scope.riskEvent.order_ids.substring(0, index) + "" + $scope.riskEvent.order_ids.substring(index + 1); //$scope.riskEvent.order_ids = $scope.riskEvent.order_ids.substring(0, index) + "" + $scope.riskEvent.order_ids.substring(index + 1);
// 获取数据库中对应的渠道字段 // 获取数据库中对应的渠道字段
@ -179,8 +183,28 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
} else { } else {
orderChannel = null; orderChannel = null;
} }
// 编辑表格的数据保存对象,重新从源数据复制,从而取消保存操作时不会更新视图
$scope.riskEventEdit = angular.copy(riskEvent.data); /**
* order_ids在指定位置换行
* @param str
* @param position
* @returns {*}
*/
$scope.splitStr = function (str, position) {
var strArr = str.split(",");
var resultStr = '';
for (var i = 0; i < strArr.length; i++) {
resultStr += strArr[i];
if (i == (strArr.length - 1))
break;
if ((i + 1) % position == 0)
resultStr += ", ";
else
resultStr += ",";
}
return resultStr;
};
$scope.riskEvent.order_ids = $scope.splitStr($scope.riskEvent.order_ids, 3);
// order_type转换为string类型是因为前端select控件这样才会显示初值 // order_type转换为string类型是因为前端select控件这样才会显示初值
$scope.riskEventEdit.order_type += ""; $scope.riskEventEdit.order_type += "";
@ -531,7 +555,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}); });
}); });
}); });
} };
} }
]); ]);
@ -550,7 +574,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
{key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key {key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key
// 增加新的input后允许删除 // 增加新的input后允许删除
$scope.canMinus = true; $scope.canMinus = true;
} };
$scope.decrease = function($index) { $scope.decrease = function($index) {
// 如果input大于1删除 // 如果input大于1删除
@ -561,7 +585,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
if ($scope.materials.length == 1) { if ($scope.materials.length == 1) {
$scope.canMinus = false; $scope.canMinus = false;
} }
} };
var array=new Array(); var array=new Array();
$scope.combineMaterials = function() { $scope.combineMaterials = function() {
for (var i = 0; i < $scope.materials.length; i++) { for (var i = 0; i < $scope.materials.length; i++) {
@ -571,8 +595,9 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
} }
console.log(JSON.stringify(array)); console.log(JSON.stringify(array));
return JSON.stringify(array); return JSON.stringify(array);
} };
$scope.is_send_client = false;
$scope.save = function(form) { $scope.save = function(form) {
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {
@ -597,6 +622,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.riskEvent.alipay_materials = $scope.combineMaterials(); $scope.riskEvent.alipay_materials = $scope.combineMaterials();
$scope.riskEvent.is_send_client = $scope.is_send_client;
$http.post('/risk/business/events', $scope.riskEvent).then(function (resp) { $http.post('/risk/business/events', $scope.riskEvent).then(function (resp) {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',

@ -156,4 +156,10 @@
</div> </div>
</div> </div>
<div class="panel-footer">
<a role="button"
ui-sref="analysis_monitoring.risk_business"
class="btn btn-info">返回
</a>
</div>
</div> </div>

@ -233,6 +233,15 @@
</div> </div>
</div> </div>
<div class="form-group" ng-if="riskEvent.order_type != 5">
<label class="control-label col-sm-2">是否发送商户</label>
<div class="col-xs-6">
<input type="checkbox"
ng-model="is_send_client"
bs-switch>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -142,6 +142,16 @@
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">是否发送商户</label>
<div class="col-xs-6">
<input type="checkbox"
bs-switch
switch-readonly="true"
ng-model="riskEvent.is_send_client">
</div>
</div>
<div ng-if="clientInfo != null"> <div ng-if="clientInfo != null">
<div class="form-group" ng-if="riskEvent.result_type <= 2"> <div class="form-group" ng-if="riskEvent.result_type <= 2">
<label class="control-label col-sm-2">Operaction</label> <label class="control-label col-sm-2">Operaction</label>
@ -408,12 +418,13 @@
for="order-ids-input">Platform Transaction IDs for="order-ids-input">Platform Transaction IDs
</label> </label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" <textarea class="form-control"
ng-model="riskEventEdit.order_ids" ng-model="riskEventEdit.order_ids"
type="text" type="text"
name="order_ids" name="order_ids"
id="order-ids-input" id="order-ids-input"
required> required>
</textarea>
<div ng-messages="riskEventForm.order_ids.$error" <div ng-messages="riskEventForm.order_ids.$error"
ng-if="riskEventForm.order_ids.$dirty"> ng-if="riskEventForm.order_ids.$dirty">
<p class="small text-danger" <p class="small text-danger"
@ -499,6 +510,15 @@
</div> </div>
</div> </div>
<div class="form-group" ng-if="riskEvent.order_type != 5">
<label class="control-label col-sm-2">是否发送商户</label>
<div class="col-xs-6">
<input type="checkbox"
bs-switch
ng-model="riskEventEdit.is_send_client">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
for="channel-result-input">Channel Handle Result for="channel-result-input">Channel Handle Result

@ -1,3 +1,8 @@
<style>
.pass_timeout {
color: red;
}
</style>
<section class="content-header"> <section class="content-header">
<h1>Risk Records</h1> <h1>Risk Records</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -170,7 +175,11 @@
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3 class="box-title">RiskEvent List</h3> <h3 class="box-title" style="display: inline-block; float: left;">RiskEvent List</h3>
<div>
<span class="pass_timeout pull-right">&nbsp;&nbsp;逾期提醒&nbsp;&nbsp;</span>
<span class="bg-red pull-right">&nbsp;&nbsp;等待风控&nbsp;&nbsp;</span>
</div>
</div> </div>
<div class="box-body no-padding table-responsive"> <div class="box-body no-padding table-responsive">
@ -199,7 +208,7 @@
</a> </a>
</td> </td>
<td ng-bind="riskEvent.order_type | orderType"></td> <td ng-bind="riskEvent.order_type | orderType"></td>
<td> <td ng-class="{'bg-red': riskEvent.result_type == 2, 'pass_timeout': riskEvent.pass_timeout}">
<span ng-if="riskEvent.order_type == 5">-</span> <span ng-if="riskEvent.order_type == 5">-</span>
<span ng-if="riskEvent.order_type != 5">{{riskEvent.result_type | resultType:resultSearchTypes}}</span> <span ng-if="riskEvent.order_type != 5">{{riskEvent.result_type | resultType:resultSearchTypes}}</span>
</td> </td>

Loading…
Cancel
Save