|
@@ -1,11 +1,11 @@
|
|
package com.yiqi.admin.controller.settlement;
|
|
package com.yiqi.admin.controller.settlement;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.yiqi.common.constant.UrlConstants;
|
|
import com.yiqi.common.constant.UrlConstants;
|
|
import com.yiqi.common.core.controller.BaseController;
|
|
import com.yiqi.common.core.controller.BaseController;
|
|
import com.yiqi.common.core.domain.AjaxResult;
|
|
import com.yiqi.common.core.domain.AjaxResult;
|
|
import com.yiqi.common.core.page.TableDataInfo;
|
|
import com.yiqi.common.core.page.TableDataInfo;
|
|
import com.yiqi.common.utils.DateUtils;
|
|
import com.yiqi.common.utils.DateUtils;
|
|
-import com.yiqi.common.utils.SecurityUtils;
|
|
|
|
import com.yiqi.common.utils.poi.ExcelUtil;
|
|
import com.yiqi.common.utils.poi.ExcelUtil;
|
|
import com.yiqi.core.domain.SettlementStoreStatistics;
|
|
import com.yiqi.core.domain.SettlementStoreStatistics;
|
|
import com.yiqi.core.service.ISettlementStoreStatisticsService;
|
|
import com.yiqi.core.service.ISettlementStoreStatisticsService;
|
|
@@ -87,7 +87,7 @@ public class SettlementStoreStatisticsController extends BaseController {
|
|
Long storeId = getLoginUser().getStoreId();
|
|
Long storeId = getLoginUser().getStoreId();
|
|
|
|
|
|
// 获取订单统计趋势
|
|
// 获取订单统计趋势
|
|
- List<SettlementStoreStatistics> orderTrend = settlementStoreStatisticsService.generateStoreStatisticsByDate(storeId, start, end);
|
|
|
|
|
|
+ List<SettlementStoreStatistics> orderTrend = settlementStoreStatisticsService.queryStoreStatisticsByDate(storeId, start, end);
|
|
|
|
|
|
// 获取充值统计趋势
|
|
// 获取充值统计趋势
|
|
List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByDate(storeId, start, end);
|
|
List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByDate(storeId, start, end);
|
|
@@ -114,7 +114,7 @@ public class SettlementStoreStatisticsController extends BaseController {
|
|
Long storeId = getLoginUser().getStoreId();
|
|
Long storeId = getLoginUser().getStoreId();
|
|
|
|
|
|
List<SettlementStoreStatistics> list = settlementStoreStatisticsService
|
|
List<SettlementStoreStatistics> list = settlementStoreStatisticsService
|
|
- .generateStoreStatisticsByDate(storeId, start, end);
|
|
|
|
|
|
+ .queryStoreStatisticsByDate(storeId, start, end);
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -152,14 +152,13 @@ public class SettlementStoreStatisticsController extends BaseController {
|
|
*/
|
|
*/
|
|
@GetMapping("/charge/bystore")
|
|
@GetMapping("/charge/bystore")
|
|
public TableDataInfo chargeByStore(@RequestParam(required = false) String startDate,
|
|
public TableDataInfo chargeByStore(@RequestParam(required = false) String startDate,
|
|
|
|
+ @RequestParam(required = false) Integer storeType,
|
|
@RequestParam(required = false) Long storeId,
|
|
@RequestParam(required = false) Long storeId,
|
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
|
@RequestParam(defaultValue = "1") Integer pageNum,
|
|
- @RequestParam(defaultValue = "15") Integer pageSize) {
|
|
|
|
-
|
|
|
|
- startPage();
|
|
|
|
|
|
+ @RequestParam(defaultValue = "10") Integer pageSize) {
|
|
Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -1);
|
|
Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -1);
|
|
- List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, start);
|
|
|
|
- return getDataTable(chargeTrend);
|
|
|
|
|
|
+ Page<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, storeType, start, pageSize, pageNum);
|
|
|
|
+ return getDataTable(chargeTrend.getRecords(), chargeTrend.getTotal());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -167,12 +166,12 @@ public class SettlementStoreStatisticsController extends BaseController {
|
|
*/
|
|
*/
|
|
@PostMapping("/charge/export/bystore")
|
|
@PostMapping("/charge/export/bystore")
|
|
public void chargeExport(HttpServletResponse response, @RequestParam(required = false) String startDate,
|
|
public void chargeExport(HttpServletResponse response, @RequestParam(required = false) String startDate,
|
|
|
|
+ @RequestParam(required = false) Integer storeType,
|
|
@RequestParam(required = false) Long storeId) {
|
|
@RequestParam(required = false) Long storeId) {
|
|
-
|
|
|
|
Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -1);
|
|
Date start = startDate != null ? DateUtils.parseDate(startDate) : DateUtils.addDays(new Date(), -1);
|
|
- List<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, start);
|
|
|
|
|
|
+ Page<StoreChargeStatistics> chargeTrend = settlementStoreStatisticsService.generateChargeStatisticsByStore(storeId, storeType, start, 500, 1);
|
|
ExcelUtil<StoreChargeStatistics> util = new ExcelUtil<>(StoreChargeStatistics.class);
|
|
ExcelUtil<StoreChargeStatistics> util = new ExcelUtil<>(StoreChargeStatistics.class);
|
|
- util.exportExcel(response, chargeTrend, "门店每日充值统计");
|
|
|
|
|
|
+ util.exportExcel(response, chargeTrend.getRecords(), "门店每日充值统计");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -217,8 +216,8 @@ public class SettlementStoreStatisticsController extends BaseController {
|
|
*/
|
|
*/
|
|
@PostMapping("/list/bystore/export")
|
|
@PostMapping("/list/bystore/export")
|
|
public void storeExport(@RequestParam(required = false) String startDate,
|
|
public void storeExport(@RequestParam(required = false) String startDate,
|
|
- @RequestParam(required = false) String endDate,
|
|
|
|
- @RequestParam(required = false) Long storeId,
|
|
|
|
|
|
+ @RequestParam(required = false) String endDate,
|
|
|
|
+ @RequestParam(required = false) Long storeId,
|
|
HttpServletResponse response) {
|
|
HttpServletResponse response) {
|
|
|
|
|
|
if (getStoreId() != null) {
|
|
if (getStoreId() != null) {
|
|
@@ -244,7 +243,7 @@ public class SettlementStoreStatisticsController extends BaseController {
|
|
Long storeId = getLoginUser().getStoreId();
|
|
Long storeId = getLoginUser().getStoreId();
|
|
|
|
|
|
List<SettlementStoreStatistics> list = settlementStoreStatisticsService
|
|
List<SettlementStoreStatistics> list = settlementStoreStatisticsService
|
|
- .generateStoreStatisticsByDate(storeId, start, end);
|
|
|
|
|
|
+ .queryStoreStatisticsByDate(storeId, start, end);
|
|
|
|
|
|
ExcelUtil<SettlementStoreStatistics> util = new ExcelUtil<>(SettlementStoreStatistics.class);
|
|
ExcelUtil<SettlementStoreStatistics> util = new ExcelUtil<>(SettlementStoreStatistics.class);
|
|
util.exportExcel(response, list, "门店按日期交易统计");
|
|
util.exportExcel(response, list, "门店按日期交易统计");
|