|
|
|
@ -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
|
|
|
|
|