|
|
@ -335,13 +335,13 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
|
|
|
|
JSONObject yes = getTransJSONO(params);
|
|
|
|
JSONObject yes = getTransJSONO(params);
|
|
|
|
res.put("today",today);
|
|
|
|
res.put("today",today);
|
|
|
|
res.put("yes",yes);
|
|
|
|
res.put("yes",yes);
|
|
|
|
res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
// res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
params.put("channel", "system");
|
|
|
|
// params.put("channel", "system");
|
|
|
|
res.put("sys_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
// res.put("sys_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
params.put("channel", "rpaypmt_card");
|
|
|
|
// params.put("channel", "rpaypmt_card");
|
|
|
|
res.put("rpaypmt_card_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
// res.put("rpaypmt_card_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
params.put("channel", "rpaypmt_dd");
|
|
|
|
// params.put("channel", "rpaypmt_dd");
|
|
|
|
res.put("rpaypmt_dd_not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
// res.put("rpaypmt_dd_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, RoundingMode.HALF_UP):BigDecimal.ZERO);
|
|
|
|
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, RoundingMode.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, RoundingMode.HALF_UP) : 0);
|
|
|
|
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, RoundingMode.HALF_UP) : 0);
|
|
|
|
res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, RoundingMode.HALF_UP) : 0);
|
|
|
|
res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, RoundingMode.HALF_UP) : 0);
|
|
|
@ -351,6 +351,38 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
|
|
|
|
res.put("latest_settle",logs.isEmpty()?BigDecimal.ZERO:logs.get(0).getBigDecimal("income"));
|
|
|
|
res.put("latest_settle",logs.isEmpty()?BigDecimal.ZERO:logs.get(0).getBigDecimal("income"));
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据渠道号分别加载未清算金额
|
|
|
|
|
|
|
|
* @param partner
|
|
|
|
|
|
|
|
* @param partnerAnalysisBean
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public JSONObject getCommonAnalysisByChannel(JSONObject partner, AnalysisBean partnerAnalysisBean) {
|
|
|
|
|
|
|
|
String timezone = partner.getJSONObject("client").getString("timezone");
|
|
|
|
|
|
|
|
JSONObject params = partnerAnalysisBean.toParams(timezone);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
clientManager.validateClients(partner.getIntValue("client_id"), params);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
logger.error("Dashboard analysis request including not permission client_id");
|
|
|
|
|
|
|
|
params.remove("client_ids");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
|
|
|
JSONObject mchConfig = merchantInfoProvider.getMchExtParams(partner.getIntValue("client_id"));
|
|
|
|
|
|
|
|
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
|
|
|
|
|
|
|
|
params.put("client_id", partner.getIntValue("client_id"));
|
|
|
|
|
|
|
|
clientManager.queryModifyClientIds(partner.getIntValue("client_id"), params);
|
|
|
|
|
|
|
|
params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
|
|
|
|
|
|
|
|
params.put("end",DateUtils.addDays(params.getDate("end"),-1));
|
|
|
|
|
|
|
|
String key="not_settled";
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(params.getString("channel"))){
|
|
|
|
|
|
|
|
key=params.getString("channel")+"_not_settled";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.put(key, new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
}
|
|
|
|
private JSONObject getTransJSONO(JSONObject params){
|
|
|
|
private JSONObject getTransJSONO(JSONObject params){
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject object = transactionAnalysisMapper.getClientTransaction(params);
|
|
|
|
JSONObject object = transactionAnalysisMapper.getClientTransaction(params);
|
|
|
|