|
|
|
@ -231,6 +231,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
|
|
|
|
|
public JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean) {
|
|
|
|
|
String timezone = partner.getJSONObject("client").getString("timezone");
|
|
|
|
|
JSONObject params = partnerAnalysisBean.toParams(timezone);
|
|
|
|
|
JSONObject params1 = partnerAnalysisBean.toParams(timezone);
|
|
|
|
|
try {
|
|
|
|
|
clientManager.validateClients(partner.getIntValue("client_id"), params);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -240,15 +241,15 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
params.put("client_id", partner.getIntValue("client_id"));
|
|
|
|
|
JSONObject today = getTransJSONO(params);
|
|
|
|
|
params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
|
|
|
|
|
params.put("end",DateUtils.addDays(params.getDate("end"),-1));
|
|
|
|
|
JSONObject yes = getTransJSONO(params);
|
|
|
|
|
params1.put("begin",DateUtils.addDays(params1.getDate("begin"),-1));
|
|
|
|
|
params1.put("end",DateUtils.addDays(params1.getDate("end"),-1));
|
|
|
|
|
JSONObject yes = getTransJSONO(params1);
|
|
|
|
|
res.put("today",today);
|
|
|
|
|
res.put("yes",yes);
|
|
|
|
|
res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
|
res.put("trade_amount_rise",yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"), 4, BigDecimal.ROUND_HALF_UP):BigDecimal.ZERO);
|
|
|
|
|
res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getBigDecimal("trade_count").subtract(yes.getBigDecimal("trade_count"))).divide(yes.getBigDecimal("trade_count"), 4, BigDecimal.ROUND_HALF_UP) : 0);
|
|
|
|
|
res.put("new_customers_rise", yes.getIntValue("new_customers") > 0 ? (today.getBigDecimal("new_customers").subtract(yes.getBigDecimal("new_customers"))).divide(yes.getBigDecimal("new_customers"), 4, BigDecimal.ROUND_HALF_UP) : 0);
|
|
|
|
|
res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, BigDecimal.ROUND_HALF_UP) : 0);
|
|
|
|
|
params.remove("begin");
|
|
|
|
|
params.remove("end");
|
|
|
|
|
List<JSONObject> logs = transactionMapper.listSettlementLogTotal(params);
|
|
|
|
@ -260,7 +261,8 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
|
|
|
|
|
JSONObject object = transactionAnalysisMapper.getClientTransaction(params);
|
|
|
|
|
res.put("trade_amount", object.getBigDecimal("trade_amount"));
|
|
|
|
|
res.put("trade_count", object.getIntValue("trade_count"));
|
|
|
|
|
res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params));
|
|
|
|
|
params.remove("begin");
|
|
|
|
|
res.put("customers", transactionAnalysisMapper.countCustomers(params));
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|