[fix]是否发送商户、超期提醒

master
lujian 6 years ago
parent f885797ac4
commit 1b43e2ac4d

@ -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.bean.AppManagerMessageBuilder;
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.signin.beans.TodoNotice;
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
@ -55,6 +56,7 @@ import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URL;
import java.text.ParseException;
import java.util.*;
import javax.annotation.Resource;
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")));
/**
*
* 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);
}
@ -164,9 +191,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
String realOrderIds = riskEvent.getString("real_order_ids");
JSONObject client = clientMapper.findClientByMonikerAll(riskEvent.getString("client_moniker"));
List<JSONObject> tradeLogs = new ArrayList<>();
/**
* client
*/
// 通用号调单会有client为空的情况所以无法查到订单信息
if (client != null && StringUtils.isNotBlank(realOrderIds)) {
String[] orderIdArray = realOrderIds.trim().split(",");
JSONObject orderInfo = new JSONObject();
@ -299,7 +324,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
try {
String emailId = mailService.sendRiskEmail(title, emailsTos.isEmpty() ? "" : StringUtils.join(emailsTos, ","),
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("submit_url",uploadUrl);
Integer orderType = event.getInteger("order_type");

@ -40,7 +40,7 @@ public class RiskUploadServiceIpml implements RiskUploadService {
@Override
public void submitMaterial(JSONObject material) {
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);
material.put("material_id",riskMaterialMapper.findAllMaterials(material.getString("risk_id")).get(0).getString("material_id"));
for(int i=1;i<=10;i++){

@ -167,7 +167,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.orderTypes = orderTypesMap;
$scope.resultTypes = resultTypesMap;
$scope.channelResults = channelResultArray;
if (riskEvent.data.is_send_client == 1)
riskEvent.data.is_send_client = true;
$scope.riskEvent = riskEvent.data;
// 编辑表格的数据保存对象,重新从源数据复制,从而取消保存操作时不会更新视图
$scope.riskEventEdit = angular.copy(riskEvent.data);
//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);
// 获取数据库中对应的渠道字段
@ -179,8 +183,28 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
} else {
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控件这样才会显示初值
$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
// 增加新的input后允许删除
$scope.canMinus = true;
}
};
$scope.decrease = function($index) {
// 如果input大于1删除
@ -561,7 +585,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
if ($scope.materials.length == 1) {
$scope.canMinus = false;
}
}
};
var array=new Array();
$scope.combineMaterials = function() {
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));
return JSON.stringify(array);
}
};
$scope.is_send_client = false;
$scope.save = function(form) {
if (form.$invalid) {
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.is_send_client = $scope.is_send_client;
$http.post('/risk/business/events', $scope.riskEvent).then(function (resp) {
commonDialog.alert({
title: 'Success',

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

@ -233,6 +233,15 @@
</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>

@ -142,6 +142,16 @@
</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 class="form-group" ng-if="riskEvent.result_type <= 2">
<label class="control-label col-sm-2">Operaction</label>
@ -408,12 +418,13 @@
for="order-ids-input">Platform Transaction IDs
</label>
<div class="col-sm-8">
<input class="form-control"
<textarea class="form-control"
ng-model="riskEventEdit.order_ids"
type="text"
name="order_ids"
id="order-ids-input"
required>
</textarea>
<div ng-messages="riskEventForm.order_ids.$error"
ng-if="riskEventForm.order_ids.$dirty">
<p class="small text-danger"
@ -499,6 +510,15 @@
</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">
<label class="control-label col-sm-2"
for="channel-result-input">Channel Handle Result

@ -1,3 +1,8 @@
<style>
.pass_timeout {
color: red;
}
</style>
<section class="content-header">
<h1>Risk Records</h1>
<ol class="breadcrumb">
@ -170,7 +175,11 @@
<div class="box">
<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 class="box-body no-padding table-responsive">
@ -199,7 +208,7 @@
</a>
</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">{{riskEvent.result_type | resultType:resultSearchTypes}}</span>
</td>

Loading…
Cancel
Save