wangning 7 years ago
parent 51fdf932c1
commit 33db182dfb

@ -1,10 +1,10 @@
package au.com.royalpay.payment.manage.mappers.risk; package au.com.royalpay.payment.manage.mappers.risk;
import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
@ -18,7 +18,7 @@ public interface RiskMerchantRecordMapper {
@AutoSql(type = SqlType.UPDATE) @AutoSql(type = SqlType.UPDATE)
void update(JSONObject record); void update(JSONObject record);
List<JSONObject> query(JSONObject params); PageList<JSONObject> query(JSONObject params, PageBounds pagination);
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
JSONObject findById(@Param("id") String id); JSONObject findById(@Param("id") String id);

@ -1,6 +1,8 @@
package au.com.royalpay.payment.manage.mappers.risk; package au.com.royalpay.payment.manage.mappers.risk;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -21,4 +23,5 @@ public interface RiskTransactionLogMapper {
@AutoSql(type = SqlType.SELECT) @AutoSql(type = SqlType.SELECT)
List<JSONObject> findByRecordId(@Param("record_id") String record_id); List<JSONObject> findByRecordId(@Param("record_id") String record_id);
PageList<JSONObject> query(JSONObject params, PageBounds pagination);
} }

@ -1,41 +0,0 @@
package au.com.royalpay.payment.manage.risk.bean;
import com.alibaba.fastjson.JSONObject;
public class QueryRIskRecord {
private String status;
private String client_moniker;
private String record_id;
public JSONObject toParams(){
JSONObject params = new JSONObject();
params.put("status",this.status);
params.put("client_moniker",this.client_moniker);
params.put("record_id",this.record_id);
return params;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getRecord_id() {
return record_id;
}
public void setRecord_id(String record_id) {
this.record_id = record_id;
}
public String getClient_moniker() {
return client_moniker;
}
public void setClient_moniker(String client_moniker) {
this.client_moniker = client_moniker;
}
}

@ -0,0 +1,69 @@
package au.com.royalpay.payment.manage.risk.bean;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import java.text.ParseException;
public class QueryRiskOrder {
private String record_id;
private String c_end_time;
private int client_id;
private int limit = 20;
private int page;
public JSONObject toParams() {
JSONObject params = new JSONObject();
params.put("record_id", this.record_id);
params.put("client_id", this.client_id);
try {
if (c_end_time != null) {
params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" }));
}
} catch (ParseException e) {
}
return params;
}
public String getRecord_id() {
return record_id;
}
public void setRecord_id(String record_id) {
this.record_id = record_id;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public String getC_end_time() {
return c_end_time;
}
public void setC_end_time(String c_end_time) {
this.c_end_time = c_end_time;
}
public int getClient_id() {
return client_id;
}
public void setClient_id(int client_id) {
this.client_id = client_id;
}
}

@ -0,0 +1,83 @@
package au.com.royalpay.payment.manage.risk.bean;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import java.text.ParseException;
public class QueryRiskRecord {
private String status;
private String client_moniker;
private String record_id;
private String c_end_time;
private int client_id;
private int limit = 20;
private int page;
public JSONObject toParams() {
JSONObject params = new JSONObject();
params.put("status", this.status);
params.put("client_moniker", this.client_moniker);
params.put("record_id", this.record_id);
params.put("client_id", this.client_id);
try {
if (c_end_time != null) {
params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" }));
}
} catch (ParseException e) {
}
return params;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getRecord_id() {
return record_id;
}
public void setRecord_id(String record_id) {
this.record_id = record_id;
}
public String getClient_moniker() {
return client_moniker;
}
public void setClient_moniker(String client_moniker) {
this.client_moniker = client_moniker;
}
public int getLimit() {
return limit;
}
public void setLimit(int limit) {
this.limit = limit;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public String getC_end_time() {
return c_end_time;
}
public void setC_end_time(String c_end_time) {
this.c_end_time = c_end_time;
}
}

@ -2,12 +2,11 @@ package au.com.royalpay.payment.manage.risk.core;
import au.com.royalpay.payment.manage.risk.bean.AddRiskDetailLog; import au.com.royalpay.payment.manage.risk.bean.AddRiskDetailLog;
import au.com.royalpay.payment.manage.risk.bean.DealRiskRecord; import au.com.royalpay.payment.manage.risk.bean.DealRiskRecord;
import au.com.royalpay.payment.manage.risk.bean.QueryRIskRecord; import au.com.royalpay.payment.manage.risk.bean.QueryRiskOrder;
import au.com.royalpay.payment.manage.risk.bean.QueryRiskRecord;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.List;
public interface RiskMerchantService { public interface RiskMerchantService {
void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account); void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account);
@ -18,14 +17,16 @@ public interface RiskMerchantService {
void dealRiskRecord(JSONObject account,DealRiskRecord dealRiskRecord); void dealRiskRecord(JSONObject account,DealRiskRecord dealRiskRecord);
List<JSONObject> getRiskOrders(String recordId); JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder);
List<JSONObject> getRiskRecords(QueryRIskRecord queryRIskRecord); JSONObject getRiskRecords(QueryRiskRecord queryRiskRecord);
void addWhiteList(String client_moinker); void addWhiteList(String client_moinker);
void disableWhiteList(String client_moinker); void disableWhiteList(String client_moinker);
JSONObject getRecordById(String record_id);
} }

@ -7,18 +7,21 @@ import au.com.royalpay.payment.manage.mappers.risk.RiskWhiteListMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.risk.bean.AddRiskDetailLog; import au.com.royalpay.payment.manage.risk.bean.AddRiskDetailLog;
import au.com.royalpay.payment.manage.risk.bean.DealRiskRecord; import au.com.royalpay.payment.manage.risk.bean.DealRiskRecord;
import au.com.royalpay.payment.manage.risk.bean.QueryRIskRecord; import au.com.royalpay.payment.manage.risk.bean.QueryRiskOrder;
import au.com.royalpay.payment.manage.risk.bean.QueryRiskRecord;
import au.com.royalpay.payment.manage.risk.core.RiskMerchantService; import au.com.royalpay.payment.manage.risk.core.RiskMerchantService;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -39,8 +42,8 @@ public class RiskMerchantServiceImpl implements RiskMerchantService {
@Override @Override
public void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account) { public void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account) {
JSONObject record = addRiskDetailLog.params(); JSONObject record = addRiskDetailLog.params();
record.put("auditor",account.getString("display_name")); record.put("auditor", account.getString("display_name"));
record.put("create_time",new Date()); record.put("create_time", new Date());
riskMerchantDetalLogMapper.save(record); riskMerchantDetalLogMapper.save(record);
} }
@ -79,7 +82,7 @@ public class RiskMerchantServiceImpl implements RiskMerchantService {
} }
JSONObject record = new JSONObject(); JSONObject record = new JSONObject();
record.put("id", recordId); record.put("id", recordId);
record.put("status", "1"); record.put("status", "2");
riskMerchantRecordMapper.update(record); riskMerchantRecordMapper.update(record);
JSONObject detail = new JSONObject(); JSONObject detail = new JSONObject();
detail.put("record_id", recordId); detail.put("record_id", recordId);
@ -91,28 +94,48 @@ public class RiskMerchantServiceImpl implements RiskMerchantService {
} }
@Override @Override
public void dealRiskRecord(JSONObject account,DealRiskRecord dealRiskRecord) { @Transactional
public void dealRiskRecord(JSONObject account, DealRiskRecord dealRiskRecord) {
JSONObject record = riskMerchantRecordMapper.findById(dealRiskRecord.getRecordId()); JSONObject record = riskMerchantRecordMapper.findById(dealRiskRecord.getRecordId());
if(record==null){ if (record == null) {
throw new NotFoundException("Risk Record Not Found Please Check"); throw new NotFoundException("Risk Record Not Found Please Check");
} }
if(dealRiskRecord.getLimitAmount()!=null){ if (record.getIntValue("status") != 0) {
clientManager.setMaxOrderAmount(record.getString("client_moniker"),dealRiskRecord.getLimitAmount()); throw new BadRequestException("The Record Has Been Handled");
}
String operation = "";
if (dealRiskRecord.getLimitAmount() != null) {
clientManager.setMaxOrderAmount(record.getString("client_moniker"), dealRiskRecord.getLimitAmount());
operation = operation + "限额" + dealRiskRecord.getLimitAmount();
} }
if(dealRiskRecord.getDisableMerchat()){ if (dealRiskRecord.getDisableMerchat()) {
clientManager.switchChannelPermission(account, record.getString("client_moniker"), "Wechat", false); clientManager.switchChannelPermission(account, record.getString("client_moniker"), "Wechat", false);
clientManager.switchChannelPermission(account, record.getString("client_moniker"), "Alipay", false); clientManager.switchChannelPermission(account, record.getString("client_moniker"), "Alipay", false);
operation = operation + " 关闭支付通道";
} }
JSONObject detail = new JSONObject();
detail.put("record_id", dealRiskRecord.getRecordId());
detail.put("client_id", record.getIntValue("client_id"));
detail.put("auditor", account.getString("display_name"));
detail.put("operation", StringUtils.isEmpty(operation) ? null : (operation = "处理结果:" + operation));
detail.put("create_time", new Date());
riskMerchantDetalLogMapper.save(detail);
record.put("status", 1);
riskMerchantRecordMapper.update(record);
} }
@Override @Override
public List<JSONObject> getRiskOrders(String recordId) { public JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder) {
return riskTransactionLogMapper.findByRecordId(recordId); return PageListUtils.buildPageListResult(
riskTransactionLogMapper.query(queryRiskOrder.toParams(), new PageBounds(queryRiskOrder.getPage(), queryRiskOrder.getLimit())));
} }
@Override @Override
public List<JSONObject> getRiskRecords(QueryRIskRecord queryRIskRecord) { public JSONObject getRiskRecords(QueryRiskRecord queryRiskRecord) {
return riskMerchantRecordMapper.query(queryRIskRecord.toParams()); return PageListUtils.buildPageListResult(
riskMerchantRecordMapper.query(queryRiskRecord.toParams(), new PageBounds(queryRiskRecord.getPage(), queryRiskRecord.getLimit())));
} }
@Override @Override
@ -143,4 +166,9 @@ public class RiskMerchantServiceImpl implements RiskMerchantService {
white.put("is_valid", false); white.put("is_valid", false);
riskWhiteListMapper.update(white); riskWhiteListMapper.update(white);
} }
@Override
public JSONObject getRecordById(String record_id) {
return riskMerchantRecordMapper.findById(record_id);
}
} }

@ -3,7 +3,8 @@ package au.com.royalpay.payment.manage.risk.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.risk.bean.AddRiskDetailLog; import au.com.royalpay.payment.manage.risk.bean.AddRiskDetailLog;
import au.com.royalpay.payment.manage.risk.bean.DealRiskRecord; import au.com.royalpay.payment.manage.risk.bean.DealRiskRecord;
import au.com.royalpay.payment.manage.risk.bean.QueryRIskRecord; import au.com.royalpay.payment.manage.risk.bean.QueryRiskOrder;
import au.com.royalpay.payment.manage.risk.bean.QueryRiskRecord;
import au.com.royalpay.payment.manage.risk.core.RiskMerchantService; import au.com.royalpay.payment.manage.risk.core.RiskMerchantService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
@ -16,8 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
/** /**
@ -31,10 +30,15 @@ public class RiskController {
private RiskMerchantService riskMerchantService; private RiskMerchantService riskMerchantService;
@RequestMapping(value = "/records", method = RequestMethod.GET) @RequestMapping(value = "/records", method = RequestMethod.GET)
public List<JSONObject> list(QueryRIskRecord recordQuery) { public JSONObject list(QueryRiskRecord recordQuery) {
return riskMerchantService.getRiskRecords(recordQuery); return riskMerchantService.getRiskRecords(recordQuery);
} }
@RequestMapping(value = "/records/{record_id}", method = RequestMethod.GET)
public JSONObject getById(@PathVariable String record_id) {
return riskMerchantService.getRecordById(record_id);
}
@RequestMapping(value = "/records/{record_id}/dropOrder", method = RequestMethod.PUT) @RequestMapping(value = "/records/{record_id}/dropOrder", method = RequestMethod.PUT)
public void dropOrder(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id) { public void dropOrder(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id) {
riskMerchantService.DropOrderRiskRecord(manager, record_id); riskMerchantService.DropOrderRiskRecord(manager, record_id);
@ -51,11 +55,12 @@ public class RiskController {
riskMerchantService.dealRiskRecord(manager,dealRiskRecord); riskMerchantService.dealRiskRecord(manager,dealRiskRecord);
} }
@RequestMapping(value = "/orders/{record_id}", method = RequestMethod.GET) @RequestMapping(value = "/orders", method = RequestMethod.GET)
public List<JSONObject> getRiskOrders(@PathVariable String record_id) { public JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder) {
return riskMerchantService.getRiskOrders(record_id); return riskMerchantService.getRiskOrders(queryRiskOrder);
} }
@RequestMapping(value = "/white/{client_moniker}", method = RequestMethod.POST) @RequestMapping(value = "/white/{client_moniker}", method = RequestMethod.POST)
public void addWhiteList(@PathVariable String client_moniker) { public void addWhiteList(@PathVariable String client_moniker) {
riskMerchantService.addWhiteList(client_moniker); riskMerchantService.addWhiteList(client_moniker);

@ -14,6 +14,12 @@
<if test="client_moniker!=null"> <if test="client_moniker!=null">
and client_moniker = #{client_moniker} and client_moniker = #{client_moniker}
</if> </if>
<if test="c_end_time!=null">
and create_time &lt; #{c_end_time}
</if>
<if test="client_id != 0">
and client_id = #{client_id}
</if>
</where> </where>
</select> </select>
</mapper> </mapper>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.risk.RiskTransactionLogMapper">
<select id="query" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM risk_transaction_log
<where>
<if test="record_id!=null">
and record_id = #{record_id}
</if>
<if test="client_id !=0">
and client_id = #{client_id}
</if>
<if test="c_end_time != null">
and create_time &lt; #{c_end_time}
</if>
</where>
</select>
</mapper>

@ -1,84 +1,159 @@
define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], function (angular) { define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], function (angular) {
'use strict'; 'use strict';
var riskType = [
{code: 1, label: 'test1'},
{code: 2, label: 'test2'},
];
var app = angular.module('RiskManagement', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload']); var app = angular.module('RiskManagement', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('analysis_monitoring.risk_manager', { $stateProvider.state('analysis_monitoring.risk_manager', {
url: '/risk/manage', url: '/risk/manage',
templateUrl: '/static/risk/templates/risk.html', templateUrl: '/static/risk/templates/risk.html',
controller: 'RiskManageCtrl', controller: 'RiskManageCtrl',
}).state('analysis_monitoring.risk_detail', { }).state('analysis_monitoring.risk_orders', {
url: '/detail', url: '/risk/{record_id}/orders',
templateUrl: '/static/risk/templates/risk_detail.html', templateUrl: '/static/risk/templates/risk_orders.html',
controller: 'RiskDetailCtrl', controller: 'RiskOrderCtrl',
params : { resolve:{
param:null record:['$http','$stateParams', function ($http,$stateParams) {
return $http.get('/sys/risk/records/'+$stateParams.record_id).then(function (res) {
return res.data;
});
}]
} }
}).state('vipcustomers.detail', { }).state('analysis_monitoring.risk_history', {
url: '/{vip_code}/detail', url: '/risk/{record_id}/history',
templateUrl: '/static/payment/vipcustomer/templates/vipcustomer_detail.html', templateUrl: '/static/risk/templates/risk_history.html',
controller: 'vipCustomerDetailCtrl', controller: 'RecordHistoryCtrl',
}).state('vipcustomers.edit', { resolve:{
url: '/{vip_code}/edit', record:['$http','$stateParams', function ($http,$stateParams) {
templateUrl: '/static/payment/vipcustomer/templates/vipcustomer_edit.html', return $http.get('/sys/risk/records/'+$stateParams.record_id).then(function (res) {
controller: 'vipCustomerEditCtrl', return res.data;
resolve: { });
vipcustomer: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/partner/vip/' + $stateParams.vip_code);
}] }]
} }
}) });
}]); }]);
app.controller('RiskManageCtrl', ['$scope', '$http','$state', function ($scope, $http,$state){ app.controller('RiskManageCtrl', ['$scope', '$http', function ($scope, $http){
$scope.params = {}; $scope.params = {};
$scope.loadRecords = function () { $scope.pagination = {};
$scope.loadRecords = function (page) {
var params = angular.copy($scope.params); var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/sys/risk/records', {params: params}).then(function (resp) { $http.get('/sys/risk/records', {params: params}).then(function (resp) {
$scope.records = resp.data; $scope.records = resp.data.data;
$scope.pagination = resp.data.pagination;
}); });
}; };
$scope.loadRecords(1); $scope.loadRecords(1);
$scope.edit = function () { }]);
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_new_rate.html', app.controller('RiskOrderCtrl', ['$scope', '$http', 'record', function ($scope, $http,record) {
controller: 'RiskRecordEditCtrl', $scope.params = {record_id: record.id};
resolve: { $scope.historyParams = {client_id:record.client_id};
rate: function () { $scope.pagination = {};
return {rate_name: name, clean_days: 3}; $scope.historyPagination = {};
}, $scope.record = record;
sys_common_rate: function () { $scope.loadOrders = function (page) {
return $http.get('/sys/partners/sys_rates'); var params = angular.copy($scope.params);
}, params.page = page || $scope.pagination.page || 1;
clientMoniker: function () { $http.get('/sys/risk/orders',{params: params}).then(function (resp) {
return $scope.partner.client_moniker; $scope.orders = resp.data.data;
} $scope.pagination = resp.data.pagination;
} $scope.historyParams.c_end_time = $scope.orders.pop().create_time;
}).result.then(function () { $scope.loadHistoryOrders(1);
$scope.getRates(); });
};
$scope.loadOrders(1);
$scope.loadHistoryOrders = function (page) {
var historyParams = angular.copy($scope.historyParams);
historyParams.page = page || $scope.historyPagination.page || 1;
$http.get('/sys/risk/orders',{params: historyParams}).then(function (resp) {
$scope.historyOrders = resp.data.data;
$scope.historyPagination = resp.data.pagination;
}); });
}; };
$scope.jumpDetail = function (record_id,client_moniker) {
var param = {};
param.client_moniker = client_moniker;
param.record_id = record_id;
$state.go('analysis_monitoring.risk_detail',{param:param});
}
}]); }]);
app.controller('RiskDetailCtrl', ['$scope', '$http', '$stateParams','$uibModal', function ($scope, $http,$stateParams,$uibModal) {
$scope.client_moniker = $stateParams.param.client_moniker;
$scope.params = {};
$scope.loadOrders = function () {
$http.get('/sys/risk/orders/' + $stateParams.param.record_id).then(function (resp) { app.controller('RecordHistoryCtrl', ['$scope', '$http','$uibModal', 'commonDialog','record', function ($scope, $http,$uibModal,commonDialog,record) {
$scope.orders = resp.data; $scope.record = record;
$scope.pagination = {};
$scope.params = {client_id:record.client_id,c_end_time:record.create_time};
$scope.listHistory = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/sys/risk/records',{params:params}).then(function (res) {
$scope.histories = res.data.data;
$scope.pagination = res.data.pagination;
})
};
$scope.listHistory(1);
$scope.edit = function () {
$uibModal.open({
templateUrl: '/static/risk/templates/risk_edit.html',
controller: 'RiskRecordHandleCtrl',
resolve:{record_id:function () {
return record.id;
}}
}).result.then(function () {
commonDialog.alert({
title: 'Success',
type: 'success'
}); });
})
}; };
$scope.loadOrders(1);
$scope.noop = function () {
commonDialog.confirm({
title: 'Confirm',
content: '确定放弃这次预警'
}).then(function () {
$http.put('/sys/risk/records/'+ record.id+'/noop', $scope.params).then(function () {
}).then(function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'Error'
});
})
})
}
}]); }]);
app.controller('RiskRecordEditCtrl', ['$scope', '$http', function ($scope, $http) { app.controller('RiskRecordHandleCtrl', ['$scope', '$http','record_id','commonDialog', function ($scope, $http,record_id,commonDialog) {
$scope.params= {};
$scope.handle = function () {
$http.put('/sys/risk/records/'+ record_id+'/deal', $scope.params).then(function () {
$scope.$close();
}).then(function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'Error'
});
})
}
}]); }]);
app.filter('risk_type', function (typeString) {
var sArr = typeString.split(",");
var result = "";
angular.forEach(sArr, function (s) {
angular.forEach(riskType,function (type) {
if (type==s){
result+=type;
result+=",";
}
})
});
result = result.substr(0,result.length-2);
return result;
});
return app; return app;
}); });

@ -15,8 +15,9 @@
<tr> <tr>
<th>Client Moniker</th> <th>Client Moniker</th>
<th>Create Time</th> <th>Create Time</th>
<th>Expiry Time</th> <th>Waring Time</th>
<th>Risk Types</th> <th>Risk Types</th>
<th>Status</th>
<th>Risk Counts</th> <th>Risk Counts</th>
<th>Operation</th> <th>Operation</th>
</tr> </tr>
@ -26,19 +27,31 @@
<td>{{record.client_moniker}}</td> <td>{{record.client_moniker}}</td>
<td>{{record.create_time}}</td> <td>{{record.create_time}}</td>
<td>{{record.expiry_time}}</td> <td>{{record.expiry_time}}</td>
<td>{{record.risk_types}}</td> <td>{{record.status}}</td>
<td>{{record.risk_types|risk_type}}</td>
<td>{{record.risk_counts}}</td> <td>{{record.risk_counts}}</td>
<td> <td>
<a class="text-primary" role="button" title="Detail" ng-click="jumpDetail(record.id,record.client_moniker)"> <a class="text-primary" role="button" title="Detail" ui-sref="analysis_monitoring.risk_orders({'record_id':record.id})">
<i class="fa fa-search" ></i> <i class="fa fa-search" ></i>
</a> </a>
<a class="text-primary" role="button" title="Detail" ng-click="edit()">
<i class="fa fa-edit"></i>
</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="modal-footer">
<uib-pagination ng-if="records.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadRecords()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
</div>
</div> </div>
</div> </div>
</section> </section>

@ -1,170 +0,0 @@
<div class="modal-header">
<h4>New Client Rate</h4>
</div>
<div class="modal-body">
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
<div class="row">
<div class="col-sm-12">
<form class="form-horizontal" novalidate name="rate_form">
<div class="form-group">
<label class="control-label col-sm-4">Clean Days</label>
<div class="col-sm-6">
<div class="input-group">
<select class="form-control" ng-model="rate.clean_days" id="citySelect" ng-change="changeDays()">
<option value="1">T+1</option>
<option value="2">T+2</option>
<option value="3">T+3</option>
</select>
<div>{{rateConfig}}</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.wechat_rate_value.$invalid && rate_form.wechat_rate_value.$dirty}">
<label class="control-label col-sm-4" for="wechat_rate_value_input">Wechat Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="wechat_rate_value" stringToNumber2 class="form-control" ng-model="rate.wechat_rate_value"
min="0.6" max="2.2" step="0.1" id="wechat_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.wechat_rate_value.$error" ng-if="rate_form.wechat_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.alipay_rate_value.$invalid && rate_form.alipay_rate_value.$dirty}">
<label class="control-label col-sm-4" for="alipay_rate_value_input">Alipay Rate Value(Retail)</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="alipay_rate_value" stringToNumber2 class="form-control" ng-model="rate.alipay_rate_value"
min="0.6" max="2.2" step="0.1" id="alipay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.alipay_rate_value.$error" ng-if="rate_form.alipay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.alipayonline_rate_value.$invalid && rate_form.alipayonline_rate_value.$dirty}">
<label class="control-label col-sm-4" for="alipayonline_rate_value_input">Alipay Rate Value(Online)</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="alipayonline_rate_value" stringToNumber2 class="form-control" ng-model="rate.alipayonline_rate_value"
min="0.6" max="2.2" step="0.1" id="alipayonline_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.alipayonline_rate_value.$error" ng-if="rate_form.alipayonline_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.bestpay_rate_value.$invalid && rate_form.bestpay_rate_value.$dirty}">
<label class="control-label col-sm-4" for="bestpay_rate_value_input">Bestpay Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="bestpay_rate_value" stringToNumber2 class="form-control" ng-model="rate.bestpay_rate_value"
min="0.6" max="2.2" step="0.1" id="bestpay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.bestpay_rate_value.$error" ng-if="rate_form.bestpay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':rate_form.jd_rate_value.$invalid && rate_form.jd_rate_value.$dirty}">
<label class="control-label col-sm-4" for="jd_rate_value_input">JD Rate Value</label>
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="jd_rate_value" stringToNumber2 class="form-control" ng-model="rate.jd_rate_value"
min="0.6" max="2.2" step="0.1" id="jd_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.bestpay_rate_value.$error" ng-if="rate_form.jd_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 2.2%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
</div>
<div class="small text-danger" ng-message="required">
<i class="glyphicon glyphicon-alert"></i> Required Field
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="active_time_input">Active Date</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.active_time" id="active_time_input"
uib-datepicker-popup size="10" placeholder="Active Date"
is-open="activeDate.open" ng-click="activeDate.open=true"
datepicker-options="{maxDate:rate.expiry_time}" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="expire_time_input">Expire Date</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.expiry_time" id="expire_time_input"
uib-datepicker-popup size="10" placeholder="Expire Date"
is-open="expireDate.open" ng-click="expireDate.open=true"
datepicker-options="{minDate:rate.active_time}" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="remark_text">Remark</label>
<div class="col-sm-6">
<input class="form-control" ng-model="rate.remark" id="remark_text" type="text">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="saveRate(rate_form)" ng-disabled="ctrl.sending">Submit</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>

@ -1,35 +0,0 @@
<div ui-view>
<section class="content-header">
<h1>Risk Manager</h1>
<ol class="breadcrumb">
<li><i class="fa fa-gift"></i> Risk</li>
<li class="fa fa-gift">Risk Manager</li>
<li class="active">Risk records</li>
</ol>
</section>
<section class="content">
<div class="box box-default">
<div class="box-header">Records Orders(Partner Code:{{client_moniker}})</div>
<div class="box-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Order Id</th>
<th>Amount</th>
<th>Channel</th>
<th>Risk Types</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="order in orders">
<td>{{order.order_id}}</td>
<td>{{order.amount}}</td>
<td>{{order.channel}}</td>
<td>{{order.risk_types}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>

@ -0,0 +1,31 @@
<section class="content-header">
<h1>Phone Top Up</h1>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<form role="form" style="margin:0px auto;width: 50%">
<div class="form-group">
<label>Limit Amount</label>
<input ng-model="params.limitAmount" name="code" class="form-control" type="text"/>
</div>
<div class="form-group">
<label>
<input type="checkbox" ng-model="params.disableMerchat" class="ng-pristine ng-untouched ng-valid">
Disable Merchant
</label>
</div>
<div class="form-group">
<button class="btn btn-primary btn-block" ng-click="handle()">commit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,115 @@
<div ui-view>
<section class="content-header">
<h1>Risk Manager</h1>
<ol class="breadcrumb">
<li><i class="fa fa-gift"></i> Risk</li>
<li class="fa fa-gift">Risk Manager</li>
<li class="active">Risk records</li>
</ol>
</section>
<section class="content">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="analysis_monitoring.risk_orders({'record_id':record.id})">Record Orders</a>
</li>
<li ui-sref-active="active">
<a ui-sref="analysis_monitoring.risk_history({'record_id':record.id})">Record history</a>
</li>
</ul>
<div class="box box-default">
<div class="box-header">Record History</div>
<div class="box-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Create Time</th>
<th>Waring Time</th>
<th>Risk Types</th>
<th>Status</th>
<th>Risk Counts</th>
<th>Operation</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{record.client_moniker}}</td>
<td>{{record.create_time}}</td>
<td>{{record.expiry_time}}</td>
<td>{{record.status}}</td>
<td>{{record.risk_types|risk_type}}</td>
<td>{{record.risk_counts}}</td>
<td>
<a class="text-primary" role="button" title="Detail" ng-if="record.status==0" ng-click="edit()">
<i class="fa fa-edit"></i>
</a>
<a class="text-primary" role="button" title="Detail" ng-if="record.status==0" ng-click="noop()">
<i class="fa fa-arrows"></i>
</a>
</td>
</tr>
</tbody>
</table>
<div class="modal-footer">
<uib-pagination ng-if="histories.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="listHistory()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Latest Record</div>
<div class="box-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Create Time</th>
<th>Waring Time</th>
<th>Risk Types</th>
<th>Status</th>
<th>Risk Counts</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in histories">
<td>{{record.client_moniker}}</td>
<td>{{record.create_time}}</td>
<td>{{record.expiry_time}}</td>
<td>{{record.status}}</td>
<td>{{record.risk_types|risk_type}}</td>
<td>{{record.risk_counts}}</td>
</tr>
</tbody>
</table>
<div class="modal-footer">
<uib-pagination ng-if="histories.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="listHistory()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
</div>
</div>
</div>
</section>
</div>

@ -0,0 +1,96 @@
<div ui-view>
<section class="content-header">
<h1>Risk Manager</h1>
<ol class="breadcrumb">
<li><i class="fa fa-gift"></i> Risk</li>
<li class="fa fa-gift">Risk Manager</li>
<li class="active">Risk records</li>
</ol>
</section>
<section class="content">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="analysis_monitoring.risk_orders({'record_id':record.id})">Record Orders</a>
</li>
<li ui-sref-active="active">
<a ui-sref="analysis_monitoring.risk_history({'record_id':record.id})">Record history</a>
</li>
</ul>
<div class="box box-default">
<div class="box-header">Reference Orders</div>
<div class="box-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Order Id</th>
<th>Amount</th>
<th>Channel</th>
<th>Risk Types</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="order in orders">
<td>{{order.order_id}}</td>
<td>{{order.amount}}</td>
<td>{{order.channel}}</td>
<td>{{order.risk_types|risk_type}}</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<uib-pagination ng-if="orders.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadOrders()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
</div>
</div>
<div class="box box-default">
<div class="box-header">Waring Orders History</div>
<div class="box-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Order Id</th>
<th>Amount</th>
<th>Channel</th>
<th>Risk Types</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="order in historyOrders">
<td>{{order.order_id}}</td>
<td>{{order.amount}}</td>
<td>{{order.channel}}</td>
<td>{{order.risk_types|risk_type}}</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<uib-pagination ng-if="historyOrders.length"
class="pagination"
total-items="historyPagination.totalCount"
boundary-links="true"
ng-model="historyPagination.page"
items-per-page="historyPagination.limit"
max-size="10"
ng-change="loadHistorysOrders()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
</div>
</div>
</section>
</div>
Loading…
Cancel
Save