|
|
|
@ -128,8 +128,20 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
kpi.put("kpi_percent", p.getBigDecimal("month_amount").divide(kpi_amount, 4, BigDecimal.ROUND_HALF_DOWN).multiply(BigDecimal.valueOf(100)).toString().substring(0, 5) + "%");
|
|
|
|
|
for (JSONObject clientAmount : clientsAmount) {
|
|
|
|
|
if (clientAmount.getString("bd_group").equals(kpi.getString("bd_group"))) {
|
|
|
|
|
kpi.put("clients_month",clientAmount.getBigDecimal("clients_month"));
|
|
|
|
|
kpi.put("clients_yesterday",clientAmount.getBigDecimal("clients_yesterday"));
|
|
|
|
|
// sys_clients中查询出此bd创建并属于此bd的商户,并且时间是昨天和本月
|
|
|
|
|
JSONObject countByBd = clientMapper.findCountByBd(clientAmount.getString("bd_group"), DateUtils.truncate(dt, Calendar.DATE), DateUtils.truncate(DateUtils.addDays(dt, -1), Calendar.DATE), DateUtils.truncate(dt, Calendar.MONTH));
|
|
|
|
|
if (countByBd.getInteger("month_count") == null){
|
|
|
|
|
kpi.put("clients_month", 0);
|
|
|
|
|
}else {
|
|
|
|
|
kpi.put("clients_month", countByBd.getInteger("month_count"));
|
|
|
|
|
}
|
|
|
|
|
if (countByBd.getInteger("yesterday_count") == null){
|
|
|
|
|
kpi.put("clients_yesterday", 0);
|
|
|
|
|
}else {
|
|
|
|
|
kpi.put("clients_yesterday", countByBd.getInteger("yesterday_count"));
|
|
|
|
|
}
|
|
|
|
|
// kpi.put("clients_month", clientAmount.getBigDecimal("clients_month"));
|
|
|
|
|
// kpi.put("clients_yesterday", clientAmount.getBigDecimal("clients_yesterday"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
total_kpi_amount = total_kpi_amount.add(kpi_amount);
|
|
|
|
|