数据统计修改

master
dalong306 4 years ago
parent 3e691e214f
commit 968c9b39c3

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.88</version> <version>2.3.88-SNAPSHOT</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -591,10 +591,9 @@ public class DashboardServiceImpl implements DashboardService, DashboardAnalysis
} }
params.put("channel", record.getString("channel")); params.put("channel", record.getString("channel"));
int newCustomers = 0; int newCustomers = 0;
int oldCustomers = transactionAnalysisMapper.countOldCustomers(params); int oldCustomers=0;
if (client.getIntValue("client_id") == 0) { if (client.getIntValue("client_id") != 0) {
newCustomers = record.getIntValue("customers") - oldCustomers; oldCustomers = transactionAnalysisMapper.countOldCustomers(params);
} else {
newCustomers = transactionAnalysisMapper.countNewCustomers(params); newCustomers = transactionAnalysisMapper.countNewCustomers(params);
} }
record.put("new_customers", newCustomers); record.put("new_customers", newCustomers);

@ -23,7 +23,7 @@ public class DashboardTaskManager {
@Resource @Resource
private SynchronizedScheduler synchronizedScheduler; private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 30 1 * * ?")
public void analysisDashboard() { public void analysisDashboard() {
synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000, synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000,
() -> dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new Date(), -1))); () -> dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new Date(), -1)));

Loading…
Cancel
Save