dashboard交易额增加缓存

master
yuan 7 years ago
parent 015e1e388d
commit 631f705000

@ -23,6 +23,7 @@ import org.apache.commons.lang3.time.DurationFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -35,6 +36,7 @@ import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
@ -60,12 +62,22 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
@Resource
private TransactionMapper transactionMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Override
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);
// 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("traded_partners", clientAnalysisMapper.countTradedPartners(params));
// 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("new_customers", transactionAnalysisMapper.countNewCustomers(params));
// res.put("old_customers", transactionAnalysisMapper.countOldCustomers(params));
return res;
}
@Override

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

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

Loading…
Cancel
Save