diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java index 823285900..f68e87375 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/core/impls/DailyReportImp.java @@ -102,7 +102,7 @@ public class DailyReportImp implements DailyReport { List kpiList =new ArrayList<>(); List prizeAmountAndBdTypeList = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH)); List prizeAmountAndBdTypeListYesterDay = financialBDPrizeLogMapper.findBdPrizeAmountMonth(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.MONTH)); - List clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(DateUtils.addDays(dt,-1), Calendar.DATE),DateUtils.truncate(dt, Calendar.DATE)); + List clientsAmount = clientMapper.createClientsByGroup(DateUtils.truncate(dt, Calendar.DATE),DateUtils.truncate(DateUtils.addDays(dt,1), Calendar.DATE),DateUtils.truncate(dt, Calendar.MONTH)); //BD团队总KPI BigDecimal total_kpi_amount = BigDecimal.ZERO; //BD团队当月总销售额 @@ -128,7 +128,7 @@ 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_history",clientAmount.getIntValue("clients_history")); + kpi.put("clients_month",clientAmount.getIntValue("clients_month")); kpi.put("clients_yesterday",clientAmount.getIntValue("clients_yesterday")); } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 50c765812..28b157084 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -119,5 +119,5 @@ public interface ClientMapper { @Select("select client_id from sys_clients where parent_client_id=#{parent_client_id}") List childClientId(@Param("parent_client_id") int parent_client_id); - List createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date); + List createClientsByGroup(@Param("start_date") Date start_date,@Param("end_date") Date end_date,@Param("start_date_month") Date start_date_month); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index 9efbb7400..de3f5474c 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -553,7 +553,7 @@ fbc.bd_name, fbc.bd_group, fbc.bd_type, - count( * ) clients_history + count( * ) clients_month FROM sys_clients sc INNER JOIN sys_client_bd d ON sc.client_id = d.client_id @@ -561,7 +561,7 @@ INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group WHERE sc.org_id = 1 - AND sc.create_time < #{start_date} + AND sc.create_time >= #{start_date_month} AND d.is_valid = 1 AND c.bd_group IS NOT NULL AND d.start_date <= now( ) AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date > now( ) diff --git a/src/main/resources/templates/reports/daily_report.html b/src/main/resources/templates/reports/daily_report.html index 713c403be..8130f4909 100644 --- a/src/main/resources/templates/reports/daily_report.html +++ b/src/main/resources/templates/reports/daily_report.html @@ -183,7 +183,7 @@
-
昨日开户数(历史开户数)
+
昨日开户数(当月开户数)
@@ -192,7 +192,7 @@
+ th:text="${kpi.clients_yesterday}+'('+${kpi.clients_month}+')'">