master
wangning 7 years ago
commit f592cb4a7a

@ -23,6 +23,7 @@ import org.apache.commons.lang3.time.DurationFormatUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -35,6 +36,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -60,12 +62,22 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
@Resource @Resource
private TransactionMapper transactionMapper; private TransactionMapper transactionMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Override @Override
public JSONObject getCommonAnalysis1(JSONObject params) { public JSONObject getCommonAnalysis1(JSONObject params) {
String jsonStr = stringRedisTemplate.boundValueOps("org_commonAnalysis1"+ params.getString("org_id")+ params.getString("begin")).get();
JSONObject commonAnalysis1 = JSONObject.parseObject(jsonStr);
if(commonAnalysis1 != null){
return commonAnalysis1;
}
JSONObject res = transactionAnalysisMapper.getClientTransaction(params); JSONObject res = transactionAnalysisMapper.getClientTransaction(params);
// res.put("new_partners", clientAnalysisMapper.countNewClients(params)); stringRedisTemplate.boundValueOps("org_commonAnalysis1"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res;
// res.put("new_partners", clientAnalysisMapper.countNewClients(params));
// res.put("total_partners", clientAnalysisMapper.countClients(params)); // res.put("total_partners", clientAnalysisMapper.countClients(params));
// res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params)); // res.put("traded_partners", clientAnalysisMapper.countTradedPartners(params));
// List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc"))); // List<JSONObject> topOrders = transactionAnalysisMapper.getTopOrders(params, new PageBounds(1, 1, Order.formString("aud_fee.desc")));
@ -75,7 +87,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
// res.put("total_customers", transactionAnalysisMapper.countCustomers(params)); // res.put("total_customers", transactionAnalysisMapper.countCustomers(params));
// //res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params)); // //res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params));
// res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params)); // res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params));
return res;
} }
@Override @Override

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.risk.bean;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import java.text.ParseException; import java.text.ParseException;
@ -19,10 +20,18 @@ public class QueryRiskRecord {
public JSONObject toParams() { public JSONObject toParams() {
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();
params.put("status", this.status); if(StringUtils.isNotEmpty(status)){
params.put("client_moniker", this.client_moniker); params.put("status", this.status);
params.put("record_id", this.record_id); }
params.put("client_id", this.client_id); if(StringUtils.isNotEmpty(client_moniker)){
params.put("client_moniker", this.client_moniker);
}
if(StringUtils.isNotEmpty(record_id)){
params.put("record_id", this.record_id);
}
if(StringUtils.isNotEmpty(String.valueOf(client_id))){
params.put("client_id", this.client_id);
}
try { try {
if (c_end_time != null) { if (c_end_time != null) {
params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" })); params.put("c_end_time", DateUtils.parseDate(this.c_end_time, new String[] { "yyyy-MM-dd HH:mm:ss" }));

@ -30,7 +30,7 @@ public class CustomerImpressionTask {
private ThreadPoolExecutor generatePool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); private ThreadPoolExecutor generatePool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
@Scheduled(cron = "0 0 4 * * ?") @Scheduled(cron = "0 30 3 * * ?")
public void generateTags() { public void generateTags() {
List<JSONObject> clients = clientMapper.listValidClient(); List<JSONObject> clients = clientMapper.listValidClient();
List<List<JSONObject>> splitList = new ArrayList<>(); List<List<JSONObject>> splitList = new ArrayList<>();

@ -415,7 +415,7 @@ define(['angular', 'uiRouter', 'uiBootstrap', 'angularEcharts'], function (angul
}) })
} }
function loadFeeAnalysis(params) { /*function loadFeeAnalysis(params) {
var analysisConfig = { var analysisConfig = {
chart: { chart: {
tooltip: { tooltip: {
@ -473,7 +473,7 @@ define(['angular', 'uiRouter', 'uiBootstrap', 'angularEcharts'], function (angul
}) })
} }
loadFeeAnalysis($scope.scales[2].params()) loadFeeAnalysis($scope.scales[2].params())*/
function getMaxRecord() { function getMaxRecord() {
if ($scope.currentUser.org_id == null) { if ($scope.currentUser.org_id == null) {

@ -232,7 +232,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <!-- <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header with-border">交易时间分布</div> <div class="box-header with-border">交易时间分布</div>
@ -242,7 +242,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>-->
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="box box-warning"> <div class="box box-warning">

@ -7,7 +7,37 @@
</ol> </ol>
</section> </section>
<section class="content"> <section class="content">
<div class="box box-default"> <div class="box box-warning">
<div class="box-header">
<div class="form-inline">
<div class="form-group">
<label class="control-label" for="partner-code-search">Partner Code</label>
<input type="text" class="form-control" id="partner-code-search"
ng-enter="loadRecords(1)"
ng-model="params.client_moniker">
</div>
&nbsp;&nbsp;
<div class="form-group">
<label class="control-label" for="status-search">Status</label>
<select ng-model="params.status" id="status-search"
ng-change="loadRecords(1)"
class="form-control" style="min-width: 200px;">
<option value="">All</option>
<option value="0">未处理</option>
<option value="1">已处理</option>
<option value="2">处理中</option>
</select>
<!--<input type="text" class="form-control" id="status-search"
ng-model="params.status">-->
</div>
<div class="form-group">
<button class="btn btn-primary" type="button" ng-click="loadRecords(1)"><i
class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
<div class="box box-warning">
<div class="box-header">Records</div> <div class="box-header">Records</div>
<div class="box-body table-responsive"> <div class="box-body table-responsive">
<table class="table table-hover"> <table class="table table-hover">

Loading…
Cancel
Save