parent
c6aafed536
commit
8502b52c3f
@ -0,0 +1,92 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @Author lvjian
|
||||
* @Date 2018/10/10 11:27
|
||||
*/
|
||||
public class RiskEventQuery {
|
||||
|
||||
// 调单类型
|
||||
private Integer orderType;
|
||||
|
||||
// 商户编码
|
||||
private String clientMoniker;
|
||||
|
||||
// 子商户号
|
||||
private String subMerchantId;
|
||||
|
||||
// 订单号(多个,以逗号分隔)
|
||||
private String orderIds;
|
||||
|
||||
// 邮件发送状态
|
||||
private Integer emailStatus;
|
||||
|
||||
// 处理结果
|
||||
private Integer resultType;
|
||||
|
||||
public Integer getOrderType() {
|
||||
return orderType;
|
||||
}
|
||||
|
||||
public void setOrderType(Integer orderType) {
|
||||
this.orderType = orderType;
|
||||
}
|
||||
|
||||
public String getClientMoniker() {
|
||||
return clientMoniker;
|
||||
}
|
||||
|
||||
public void setClientMoniker(String clientMoniker) {
|
||||
this.clientMoniker = clientMoniker;
|
||||
}
|
||||
|
||||
public String getSubMerchantId() {
|
||||
return subMerchantId;
|
||||
}
|
||||
|
||||
public void setSubMerchantId(String subMerchantId) {
|
||||
this.subMerchantId = subMerchantId;
|
||||
}
|
||||
|
||||
public String getOrderIds() {
|
||||
return orderIds;
|
||||
}
|
||||
|
||||
public void setOrderIds(String orderIds) {
|
||||
this.orderIds = orderIds;
|
||||
}
|
||||
|
||||
public JSONObject toJSON() {
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
|
||||
if (orderType != null && orderType >= 1) {
|
||||
params.put("order_type", orderType);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(clientMoniker)) {
|
||||
params.put("client_moniker", clientMoniker);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(subMerchantId)) {
|
||||
params.put("sub_merchant_id", subMerchantId);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(orderIds)) {
|
||||
params.put("order_ids", orderIds);
|
||||
}
|
||||
|
||||
if (emailStatus != null && emailStatus >= 0) {
|
||||
params.put("email_status", emailStatus);
|
||||
}
|
||||
|
||||
if (resultType != null && resultType >= 0) {
|
||||
params.put("result_type", resultType);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
@ -1,10 +1,46 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.core;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author lvjian
|
||||
* @Date 2018/10/10 10:29
|
||||
*/
|
||||
public interface RiskBusinessService {
|
||||
|
||||
/**
|
||||
* 风险事件列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getRiskEvents(JSONObject params);
|
||||
|
||||
/**
|
||||
* 分页查询风险事件
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
JSONObject getRiskEventsByPage(JSONObject params);
|
||||
|
||||
/**
|
||||
* 风险事件详情
|
||||
* @param riskId
|
||||
* @return
|
||||
*/
|
||||
JSONObject getRiskEventDetail(String riskId);
|
||||
|
||||
/**
|
||||
* 新增风险事件
|
||||
* @param params
|
||||
*/
|
||||
void addRiskEvent(JSONObject params);
|
||||
|
||||
/**
|
||||
* 更新事件
|
||||
* @param params
|
||||
*/
|
||||
void updateRiskEvent(JSONObject params);
|
||||
}
|
||||
|
@ -1,12 +1,51 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.core.impl;
|
||||
|
||||
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper;
|
||||
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
|
||||
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author lvjian
|
||||
* @Date 2018/10/10 10:30
|
||||
*/
|
||||
@Service
|
||||
public class RiskBusinessServiceImpl implements RiskBusinessService {
|
||||
|
||||
@Autowired
|
||||
private RiskEventMapper riskEventMapper;
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getRiskEvents(JSONObject params) {
|
||||
return riskEventMapper.findAll(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getRiskEventsByPage(JSONObject params) {
|
||||
|
||||
PageList<JSONObject> riskEvents = riskEventMapper.listRisksByPage(params, new PageBounds(1, 10, Order.formString("create_time.desc")));
|
||||
return PageListUtils.buildPageListResult(riskEvents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getRiskEventDetail(String riskId) {
|
||||
return riskEventMapper.findById(riskId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRiskEvent(JSONObject params) {
|
||||
riskEventMapper.save(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRiskEvent(JSONObject params) {
|
||||
riskEventMapper.update(params);
|
||||
}
|
||||
}
|
||||
|
@ -1,28 +1,53 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.web;
|
||||
|
||||
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.tools.CommonConsts;
|
||||
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 风控业务
|
||||
* @Author lvjian
|
||||
* @Date 2018/10/10 1:12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/risk/business/")
|
||||
@ManagerMapping(value = "/risk/business/", role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
|
||||
public class RiskBusinessController {
|
||||
|
||||
@ManagerMapping(value = "event", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
|
||||
public String testHello() {
|
||||
return "Hello";
|
||||
@Autowired
|
||||
private RiskBusinessService riskBusinessService;
|
||||
|
||||
@GetMapping(value = "events")
|
||||
public JSONObject getRiskEvents(RiskEventQuery riskEventQuery) {
|
||||
JSONObject params = riskEventQuery.toJSON();
|
||||
return riskBusinessService.getRiskEventsByPage(params);
|
||||
}
|
||||
|
||||
@GetMapping(value = "events/{risk_id}")
|
||||
public JSONObject getRiskEventDetail(@PathVariable("risk_id") String riskId) {
|
||||
return riskBusinessService.getRiskEventDetail(riskId);
|
||||
}
|
||||
|
||||
@PostMapping(value = "events")
|
||||
public void RegisterRiskEvent(@RequestBody JSONObject params,
|
||||
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
|
||||
params.put("fillin_person", manager.getString("display_name"));
|
||||
riskBusinessService.addRiskEvent(params);
|
||||
}
|
||||
|
||||
@ManagerMapping(value = "event/{risk_id}", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
|
||||
public JSONObject getRiskEventDetail() {
|
||||
return null;
|
||||
@PutMapping(value = "events")
|
||||
public void UpdateRiskEvent(@RequestBody JSONObject params) {
|
||||
riskBusinessService.updateRiskEvent(params);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,95 @@
|
||||
<section class="content-header">
|
||||
<h1>New RiskEvent</h1>
|
||||
</section>
|
||||
|
||||
<div class="content">
|
||||
<form novalidate name="riskEventForm">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">RiskEvent Basic Information</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':riskEventForm.client_moniker.$invalid && riskEventForm.client_moniker.$dirty}">
|
||||
<label class="control-label col-sm-2" for="short-id-input">* Partner Code</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control text-uppercase"
|
||||
ng-model="riskEvent.client_moniker"
|
||||
type="text"
|
||||
name="client_moniker"
|
||||
id="short-id-input" required maxlength="6"
|
||||
ng-pattern="/^[a-zA-Z0-9]+$/">
|
||||
<div ng-messages="riskEventForm.client_moniker.$error"
|
||||
ng-if="riskEventForm.client_moniker.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required
|
||||
Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Less
|
||||
Than 6 Letters</p>
|
||||
<p class="small text-danger" ng-message="pattern">Only
|
||||
Uppercase Letters and
|
||||
Numbers are allowed</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':riskEventForm.order_type.$invalid && riskEventForm.order_type.$dirty}">
|
||||
<label class="control-label col-sm-2"
|
||||
for="order-type-input">Order Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="order_type"
|
||||
ng-model="riskEvent.order_type"
|
||||
id="order-type-input" required
|
||||
ng-options="key as value for (key, value) in orderTypes">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="riskEventForm.order_type.$error"
|
||||
ng-if="riskEventForm.order_type.$dirty">
|
||||
<p class="small text-danger" ng-message="required">
|
||||
required field
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':riskEventForm.order_ids.$invalid && riskEventForm.order_ids.$dirty}">
|
||||
<label class="control-label col-sm-2" for="order-ids-input">Order IDs</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="riskEvent.order_ids" type="text"
|
||||
name="order_ids"
|
||||
id="order-ids-input"
|
||||
required>
|
||||
<div ng-messages="riskEventForm.order_ids.$error"
|
||||
ng-if="riskEventForm.order_ids.$dirty">
|
||||
<p class="small text-danger" ng-message="required">
|
||||
required field
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="description-input">Description</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="riskEvent.description" type="text"
|
||||
name="description"
|
||||
id="description-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btn-group margin-bottom margin-top">
|
||||
<button class="btn btn-success" type="button" ng-click="save(riskEventForm)">Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -1,10 +1,230 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
欢迎来到riskDetail页面
|
||||
</body>
|
||||
</html>
|
||||
<div ui-view>
|
||||
<section class="content-header">
|
||||
<h1>Risk Event</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
<div class="row" ng-if="!editFlag">
|
||||
<div class="col-sm-12">
|
||||
<div class="nav-tabs-custom">
|
||||
<div class="tab-content">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
RiskEvent Basic Information
|
||||
<a role="button" class="pull-right"
|
||||
ng-click="changeEditFlag(editFlag)">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">Partner Code</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" ng-bind="riskEvent.client_moniker"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">Order Type</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" ng-bind="riskEvent.order_type"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">Result Type</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" ng-bind="riskEvent.result_type"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">Email Status</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" ng-bind="riskEvent.email_status"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">Reply Deadline</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">
|
||||
{{riskEvent.reply_email_date | limitTo:10}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">Description</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static" ng-bind="riskEvent.description"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 调单信息 -->
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title" style="display: inherit">
|
||||
Orders Information
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive">
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order ID</th>
|
||||
<th>Amount</th>
|
||||
<th>Input Amount</th>
|
||||
<th>AUD Amount</th>
|
||||
<th>Exchange Rate</th>
|
||||
<th>Status</th>
|
||||
<th>Create Time</th>
|
||||
<th>Gateway</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="trade in tradeLogs" ng-class="{warning:trade.clearing_status==2}">
|
||||
|
||||
<td>{{trade.order_id}}</td>
|
||||
<td>{{trade.total_amount|currency:trade.currency}}</td>
|
||||
<td ng-bind="trade.display_amount|currency:trade.currency"></td>
|
||||
<td ng-bind="trade.clearing_amount|currency:'AUD'"></td>
|
||||
<td>
|
||||
<span ng-if="(trade.channel != 'hf') && (trade.channel != 'Rpay')" ng-bind="trade.exchange_rate"></span>
|
||||
<span ng-if="(trade.channel == 'hf') || (trade.channel == 'Rpay')"> - </span>
|
||||
</td>
|
||||
<td ng-bind="trade.status|tradeStatus"></td>
|
||||
<td ng-bind="trade.create_time"></td>
|
||||
<td ng-bind="trade.gateway|tradeGateway"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a role="button" class="btn btn-info">
|
||||
Send Email
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form novalidate name="riskEventForm" ng-if="editFlag">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">RiskEvent Basic Information</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':riskEventForm.client_moniker.$invalid && riskEventForm.client_moniker.$dirty}">
|
||||
<label class="control-label col-sm-2" for="short-id-input">* Partner Code</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control text-uppercase"
|
||||
ng-model="riskEvent.client_moniker"
|
||||
type="text"
|
||||
name="client_moniker"
|
||||
id="short-id-input" required maxlength="6"
|
||||
ng-pattern="/^[a-zA-Z0-9]+$/">
|
||||
<div ng-messages="riskEventForm.client_moniker.$error"
|
||||
ng-if="riskEventForm.client_moniker.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required
|
||||
Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">Less
|
||||
Than 6 Letters</p>
|
||||
<p class="small text-danger" ng-message="pattern">Only
|
||||
Uppercase Letters and
|
||||
Numbers are allowed</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':riskEventForm.order_type.$invalid && riskEventForm.order_type.$dirty}">
|
||||
<label class="control-label col-sm-2"
|
||||
for="order-type-input">Order Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="order_type"
|
||||
ng-model="riskEvent.order_type"
|
||||
id="order-type-input" required
|
||||
ng-options="key as value for (key, value) in orderTypes">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="riskEventForm.order_type.$error"
|
||||
ng-if="riskEventForm.order_type.$dirty">
|
||||
<p class="small text-danger" ng-message="required">
|
||||
required field
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':riskEventForm.order_ids.$invalid && riskEventForm.order_ids.$dirty}">
|
||||
<label class="control-label col-sm-2" for="order-ids-input">Order IDs</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="riskEvent.order_ids" type="text"
|
||||
name="order_ids"
|
||||
id="order-ids-input"
|
||||
required>
|
||||
<div ng-messages="riskEventForm.order_ids.$error"
|
||||
ng-if="riskEventForm.order_ids.$dirty">
|
||||
<p class="small text-danger" ng-message="required">
|
||||
required field
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="reply-deadline-input">Reply Deadline</label>
|
||||
<div class="col-sm-8">
|
||||
<div style="display: inline-block">
|
||||
<input class="form-control" id="reply-deadline-input"
|
||||
type="text"
|
||||
ng-model="riskEvent.reply_email_date"
|
||||
uib-datepicker-popup size="10" placeholder="Reply Deadline"
|
||||
is-open="replyDeadline.open"
|
||||
ng-click="replyDeadline.open=true"
|
||||
datepicker-options="{minDate:today}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="description-input">Description</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="riskEvent.description" type="text"
|
||||
name="description"
|
||||
id="description-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btn-group margin-bottom margin-top">
|
||||
<button class="btn btn-success"
|
||||
style="margin-right: 10px;"
|
||||
type="button"
|
||||
ng-click="save(riskEventForm)">
|
||||
Save
|
||||
</button>
|
||||
<button class="btn btn-warning"
|
||||
type="button"
|
||||
ng-click="changeEditFlag(editFlag)">
|
||||
cancel
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in new issue