|
|
@@ -1,13 +1,10 @@
|
|
|
package com.goafanti.report.service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import com.goafanti.admin.service.DepartmentService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -38,6 +35,8 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
|
|
|
DailySalesReportMapper dailySalesReportMapper;
|
|
|
@Autowired
|
|
|
UserMapper userMapper;
|
|
|
+ @Autowired
|
|
|
+ DepartmentService departmentService;
|
|
|
|
|
|
public int insertDailyReports(Date startTime, Date endTime) {
|
|
|
List<DailySalesReport> list = dailySalesReportMapper.selectAdmins();
|
|
|
@@ -250,12 +249,12 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public List<marketingESBo> marketingStatistics(String depId) {
|
|
|
ReportDate rd = new ReportDate(new Date());
|
|
|
List<marketingESBo> list=dailySalesReportMapper.findmarketingStatisticsList(depId,rd.getStringDailyStart(),rd.getStringDailyEnd(),rd.getStringWeeklyStart(),rd.getStringWeeklyEnd(),
|
|
|
rd.getStringMonthStart(),rd.getStringMonthEnd(),rd.getStringYearStart(),rd.getStringYearEnd());
|
|
|
-
|
|
|
+
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -264,7 +263,7 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
|
|
|
ReportDate rd = new ReportDate(new Date());
|
|
|
List<marketingESBo> list=dailySalesReportMapper.marketingDepStatisticsList(depId,rd.getStringDailyStart(),rd.getStringDailyEnd(),rd.getStringWeeklyStart(),rd.getStringWeeklyEnd(),
|
|
|
rd.getStringMonthStart(),rd.getStringMonthEnd(),rd.getStringYearStart(),rd.getStringYearEnd());
|
|
|
-
|
|
|
+
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -279,7 +278,7 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
|
|
|
ReportDate rd = new ReportDate(new Date());
|
|
|
CountMarketingStatisticsBo count=dailySalesReportMapper.privateCustomersDepCount(depId,rd.getStringDailyStart(),rd.getStringDailyEnd(),rd.getStringWeeklyStart(),rd.getStringWeeklyEnd(),
|
|
|
rd.getStringMonthStart(),rd.getStringMonthEnd(),rd.getStringYearStart(),rd.getStringYearEnd());
|
|
|
-
|
|
|
+
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
@@ -388,13 +387,21 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public List<userDataListBo> userDataStatistics(String depId) {
|
|
|
- return userMapper.userDataStatistics(depId);
|
|
|
+ public List<userDataListBo> userDataStatistics(String deps) {
|
|
|
+ List<String> listDep=new ArrayList<>();
|
|
|
+ if (deps!=null){
|
|
|
+ listDep=departmentService.parseArray(deps);
|
|
|
+ }
|
|
|
+ return userMapper.userDataStatistics(listDep);
|
|
|
}
|
|
|
|
|
|
- public userDataListBo userDataStatisticsCount(String depId) {
|
|
|
- return userMapper.userDataStatisticsCount(depId);
|
|
|
+ public userDataListBo userDataStatisticsCount(String deps) {
|
|
|
+ List<String> listDep=new ArrayList<>();
|
|
|
+ if (deps!=null){
|
|
|
+ listDep=departmentService.parseArray(deps);
|
|
|
+ }
|
|
|
+ return userMapper.userDataStatisticsCount(listDep);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|