|
|
@@ -36,8 +36,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/store/store/statistics")
|
|
|
-public class FsStoreStatisticsScrmController extends BaseController
|
|
|
-{
|
|
|
+public class FsStoreStatisticsScrmController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private ICompanyUserService userService;
|
|
|
@@ -51,30 +50,29 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
|
|
|
|
@Autowired
|
|
|
private IFsCourseWatchLogService courseWatchLogService;
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('store:statistics:storeOrder')")
|
|
|
@GetMapping("/storeOrder")
|
|
|
- public R storeOrder(FsStoreStatisticsParam param)
|
|
|
- {
|
|
|
- if(StringUtils.isNotEmpty(param.getUserIds())){
|
|
|
- String[] userIds=param.getUserIds().split(",");
|
|
|
- Long[] ids=new Long[userIds.length];
|
|
|
- for(int i=0;i<ids.length; i++){
|
|
|
- ids[i]=Long.parseLong(userIds[i]);
|
|
|
+ public R storeOrder(FsStoreStatisticsParam param) {
|
|
|
+ if (StringUtils.isNotEmpty(param.getUserIds())) {
|
|
|
+ String[] userIds = param.getUserIds().split(",");
|
|
|
+ Long[] ids = new Long[userIds.length];
|
|
|
+ for (int i = 0; i < ids.length; i++) {
|
|
|
+ ids[i] = Long.parseLong(userIds[i]);
|
|
|
}
|
|
|
param.setUsers(ids);
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
//获取部门下的所有用户
|
|
|
- CompanyUser usermap=new CompanyUser();
|
|
|
+ CompanyUser usermap = new CompanyUser();
|
|
|
usermap.setDeptId(param.getDeptId());
|
|
|
List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
param.setUsers(userIds.toArray(new Long[userIds.size()]));
|
|
|
}
|
|
|
- if(param.getUsers()!=null&¶m.getUsers().length>0){
|
|
|
- List<FsStoreOrderStatisticsVO> list= storeOrderService.selectFsStoreOrderStatisticsList(param);
|
|
|
+ if (param.getUsers() != null && param.getUsers().length > 0) {
|
|
|
+ List<FsStoreOrderStatisticsVO> list = storeOrderService.selectFsStoreOrderStatisticsList(param);
|
|
|
|
|
|
- TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType().toString(),param.getStartTime(),param.getEndTime());
|
|
|
+ TimeUtils.TimeEntity timeEntity = TimeUtils.parseTime(param.getType().toString(), param.getStartTime(), param.getEndTime());
|
|
|
timeEntity.setUserIds(param.getUsers());
|
|
|
Integer cycleNum = timeEntity.getCycleNum();
|
|
|
Integer beginTime = timeEntity.getBeginTime();
|
|
|
@@ -87,34 +85,32 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
|
List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
|
|
|
List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
|
|
|
List<Integer> payPrice = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payPrice")).collect(Collectors.toList());
|
|
|
- return R.ok().put("list",list).put("dates",dates).put("orderCount",orderCount).put("payPrice",payPrice);
|
|
|
- }
|
|
|
- else {
|
|
|
+ return R.ok().put("list", list).put("dates", dates).put("orderCount", orderCount).put("payPrice", payPrice);
|
|
|
+ } else {
|
|
|
return R.ok("未查找到数据");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('store:statistics:exportStoreOrder')")
|
|
|
@GetMapping("/exportStoreOrder")
|
|
|
- public AjaxResult exportStoreOrder(FsStoreStatisticsParam param)
|
|
|
- {
|
|
|
- if(StringUtils.isNotEmpty(param.getUserIds())){
|
|
|
- String[] userIds=param.getUserIds().split(",");
|
|
|
- Long[] ids=new Long[userIds.length];
|
|
|
- for(int i=0;i<ids.length; i++){
|
|
|
- ids[i]=Long.parseLong(userIds[i]);
|
|
|
+ public AjaxResult exportStoreOrder(FsStoreStatisticsParam param) {
|
|
|
+ if (StringUtils.isNotEmpty(param.getUserIds())) {
|
|
|
+ String[] userIds = param.getUserIds().split(",");
|
|
|
+ Long[] ids = new Long[userIds.length];
|
|
|
+ for (int i = 0; i < ids.length; i++) {
|
|
|
+ ids[i] = Long.parseLong(userIds[i]);
|
|
|
}
|
|
|
param.setUsers(ids);
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
//获取所有员工
|
|
|
- CompanyUser usermap=new CompanyUser();
|
|
|
+ CompanyUser usermap = new CompanyUser();
|
|
|
usermap.setDeptId(param.getDeptId());
|
|
|
List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
param.setUsers(userIds.toArray(new Long[userIds.size()]));
|
|
|
}
|
|
|
|
|
|
- List<FsStoreOrderStatisticsVO> list= storeOrderService.selectFsStoreOrderStatisticsList(param);
|
|
|
+ List<FsStoreOrderStatisticsVO> list = storeOrderService.selectFsStoreOrderStatisticsList(param);
|
|
|
|
|
|
ExcelUtil<FsStoreOrderStatisticsVO> util = new ExcelUtil<FsStoreOrderStatisticsVO>(FsStoreOrderStatisticsVO.class);
|
|
|
return util.exportExcel(list, "orderLogs");
|
|
|
@@ -123,27 +119,25 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('store:statistics:storePayment')")
|
|
|
@GetMapping("/storePayment")
|
|
|
- public R storePayment(FsStoreStatisticsParam param)
|
|
|
- {
|
|
|
- if(StringUtils.isNotEmpty(param.getUserIds())){
|
|
|
- String[] userIds=param.getUserIds().split(",");
|
|
|
- Long[] ids=new Long[userIds.length];
|
|
|
- for(int i=0;i<ids.length; i++){
|
|
|
- ids[i]=Long.parseLong(userIds[i]);
|
|
|
+ public R storePayment(FsStoreStatisticsParam param) {
|
|
|
+ if (StringUtils.isNotEmpty(param.getUserIds())) {
|
|
|
+ String[] userIds = param.getUserIds().split(",");
|
|
|
+ Long[] ids = new Long[userIds.length];
|
|
|
+ for (int i = 0; i < ids.length; i++) {
|
|
|
+ ids[i] = Long.parseLong(userIds[i]);
|
|
|
}
|
|
|
param.setUsers(ids);
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
//获取部门下的所有用户
|
|
|
- CompanyUser usermap=new CompanyUser();
|
|
|
+ CompanyUser usermap = new CompanyUser();
|
|
|
usermap.setDeptId(param.getDeptId());
|
|
|
List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
param.setUsers(userIds.toArray(new Long[userIds.size()]));
|
|
|
}
|
|
|
- if(param.getUsers()!=null&¶m.getUsers().length>0){
|
|
|
- List<FsStorePaymentStatisticsVO> list= storePaymentService.selectFsStorePaymentStatisticsList(param);
|
|
|
- TimeUtils.TimeEntity timeEntity=TimeUtils.parseTime(param.getType().toString(),param.getStartTime(),param.getEndTime());
|
|
|
+ if (param.getUsers() != null && param.getUsers().length > 0) {
|
|
|
+ List<FsStorePaymentStatisticsVO> list = storePaymentService.selectFsStorePaymentStatisticsList(param);
|
|
|
+ TimeUtils.TimeEntity timeEntity = TimeUtils.parseTime(param.getType().toString(), param.getStartTime(), param.getEndTime());
|
|
|
timeEntity.setUserIds(param.getUsers());
|
|
|
Integer cycleNum = timeEntity.getCycleNum();
|
|
|
Integer beginTime = timeEntity.getBeginTime();
|
|
|
@@ -156,34 +150,32 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
|
List<String> dates = jsonObjectList.stream().map(jsonObject -> jsonObject.getString("type")).collect(Collectors.toList());
|
|
|
List<Integer> orderCount = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("orderCount")).collect(Collectors.toList());
|
|
|
List<Integer> payMoney = jsonObjectList.stream().map(jsonObject -> jsonObject.getInteger("payMoney")).collect(Collectors.toList());
|
|
|
- return R.ok().put("list",list).put("dates",dates).put("orderCount",orderCount).put("payMoney",payMoney);
|
|
|
- }
|
|
|
- else {
|
|
|
+ return R.ok().put("list", list).put("dates", dates).put("orderCount", orderCount).put("payMoney", payMoney);
|
|
|
+ } else {
|
|
|
return R.ok("未查找到数据");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('store:statistics:exportStorePayment')")
|
|
|
@GetMapping("/exportStorePayment")
|
|
|
- public AjaxResult exportStorePayment(FsStoreStatisticsParam param)
|
|
|
- {
|
|
|
- if(StringUtils.isNotEmpty(param.getUserIds())){
|
|
|
- String[] userIds=param.getUserIds().split(",");
|
|
|
- Long[] ids=new Long[userIds.length];
|
|
|
- for(int i=0;i<ids.length; i++){
|
|
|
- ids[i]=Long.parseLong(userIds[i]);
|
|
|
+ public AjaxResult exportStorePayment(FsStoreStatisticsParam param) {
|
|
|
+ if (StringUtils.isNotEmpty(param.getUserIds())) {
|
|
|
+ String[] userIds = param.getUserIds().split(",");
|
|
|
+ Long[] ids = new Long[userIds.length];
|
|
|
+ for (int i = 0; i < ids.length; i++) {
|
|
|
+ ids[i] = Long.parseLong(userIds[i]);
|
|
|
}
|
|
|
param.setUsers(ids);
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
//获取所有员工
|
|
|
- CompanyUser usermap=new CompanyUser();
|
|
|
+ CompanyUser usermap = new CompanyUser();
|
|
|
usermap.setDeptId(param.getDeptId());
|
|
|
List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
param.setUsers(userIds.toArray(new Long[userIds.size()]));
|
|
|
}
|
|
|
|
|
|
- List<FsStorePaymentStatisticsVO> list= storePaymentService.selectFsStorePaymentStatisticsList(param);
|
|
|
+ List<FsStorePaymentStatisticsVO> list = storePaymentService.selectFsStorePaymentStatisticsList(param);
|
|
|
|
|
|
ExcelUtil<FsStorePaymentStatisticsVO> util = new ExcelUtil<FsStorePaymentStatisticsVO>(FsStorePaymentStatisticsVO.class);
|
|
|
return util.exportExcel(list, "paymentLogs");
|
|
|
@@ -194,10 +186,18 @@ public class FsStoreStatisticsScrmController extends BaseController
|
|
|
* 会员统计报表
|
|
|
*/
|
|
|
@GetMapping("/userReport")
|
|
|
- public TableDataInfo userReport(FsCourseWatchLogStatisticsListParam param){
|
|
|
+ public TableDataInfo userReport(FsCourseWatchLogStatisticsListParam param) {
|
|
|
startPage();
|
|
|
- return getDataTable(courseWatchLogService.selectFsUserReportVO( param));
|
|
|
+ return getDataTable(courseWatchLogService.selectFsUserReportVO(param));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 看课统计报表
|
|
|
+ */
|
|
|
+ @GetMapping("/watchLogReport")
|
|
|
+ public TableDataInfo watchLogReport(FsCourseWatchLogStatisticsListParam param) {
|
|
|
+ startPage();
|
|
|
+ return getDataTable(courseWatchLogService.selectWatchLogReportVO(param));
|
|
|
+ }
|
|
|
|
|
|
}
|