统计模块隔离业务,重构统计模块
This commit is contained in:
@@ -5,7 +5,7 @@ import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.entity.dto.GoodsStatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.entity.vo.GoodsStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.service.GoodsStatisticsDataService;
|
||||
import cn.lili.modules.statistics.service.StoreFlowStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -31,13 +31,13 @@ public class GoodsStatisticsStoreController {
|
||||
* 商品统计
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsStatisticsDataService goodsStatisticsDataService;
|
||||
private StoreFlowStatisticsService storeFlowStatisticsService;
|
||||
|
||||
@ApiOperation(value = "获取统计列表,排行前一百的数据")
|
||||
@GetMapping
|
||||
public ResultMessage<List<GoodsStatisticsDataVO>> getByPage(GoodsStatisticsQueryParam statisticsQueryParam) {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
statisticsQueryParam.setStoreId(storeId);
|
||||
return ResultUtil.data(goodsStatisticsDataService.getGoodsStatisticsData(statisticsQueryParam, 100));
|
||||
return ResultUtil.data(storeFlowStatisticsService.getGoodsStatisticsData(statisticsQueryParam, 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.entity.dto.GoodsStatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.entity.vo.GoodsStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.entity.vo.StoreIndexStatisticsVO;
|
||||
import cn.lili.modules.statistics.service.GoodsStatisticsDataService;
|
||||
import cn.lili.modules.statistics.service.IndexStatisticsService;
|
||||
import cn.lili.modules.statistics.service.StoreFlowStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -33,7 +33,7 @@ public class IndexStatisticsStoreController {
|
||||
* 热卖商品统计
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsStatisticsDataService goodsStatisticsDataService;
|
||||
private StoreFlowStatisticsService storeFlowStatisticsService;
|
||||
/**
|
||||
* 首页统计
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public class IndexStatisticsStoreController {
|
||||
public ResultMessage<List<GoodsStatisticsDataVO>> getByPage(GoodsStatisticsQueryParam statisticsQueryParam) {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
statisticsQueryParam.setStoreId(storeId);
|
||||
return ResultUtil.data(goodsStatisticsDataService.getGoodsStatisticsData(statisticsQueryParam, 100));
|
||||
return ResultUtil.data(storeFlowStatisticsService.getGoodsStatisticsData(statisticsQueryParam, 100));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取首页查询数据")
|
||||
|
||||
@@ -11,7 +11,7 @@ import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.statistics.entity.dto.StatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.entity.vo.OrderOverviewVO;
|
||||
import cn.lili.modules.statistics.entity.vo.OrderStatisticsDataVO;
|
||||
import cn.lili.modules.statistics.service.OrderStatisticsDataService;
|
||||
import cn.lili.modules.statistics.service.OrderStatisticsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -50,7 +50,7 @@ public class OrderStatisticsStoreController {
|
||||
* 订单统计
|
||||
*/
|
||||
@Autowired
|
||||
private OrderStatisticsDataService orderStatisticsDataService;
|
||||
private OrderStatisticsService orderStatisticsService;
|
||||
|
||||
@ApiOperation(value = "订单概览统计")
|
||||
@GetMapping("/overview")
|
||||
@@ -58,7 +58,7 @@ public class OrderStatisticsStoreController {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
try {
|
||||
statisticsQueryParam.setStoreId(storeId);
|
||||
return ResultUtil.data(orderStatisticsDataService.overview(statisticsQueryParam));
|
||||
return ResultUtil.data(orderStatisticsService.overview(statisticsQueryParam));
|
||||
} catch (Exception e) {
|
||||
log.error("订单概览统计错误", e);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class OrderStatisticsStoreController {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
try {
|
||||
statisticsQueryParam.setStoreId(storeId);
|
||||
return ResultUtil.data(orderStatisticsDataService.statisticsChart(statisticsQueryParam));
|
||||
return ResultUtil.data(orderStatisticsService.statisticsChart(statisticsQueryParam));
|
||||
} catch (Exception e) {
|
||||
log.error("订单图表统计错误", e);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.statistics.entity.dto.StatisticsQueryParam;
|
||||
import cn.lili.modules.statistics.entity.vo.PlatformViewVO;
|
||||
import cn.lili.modules.statistics.service.PlatformViewDataService;
|
||||
import cn.lili.modules.statistics.service.PlatformViewService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -27,13 +27,13 @@ import java.util.Objects;
|
||||
@RequestMapping("/store/statistics/view")
|
||||
public class ViewStatisticsStoreController {
|
||||
@Autowired
|
||||
private PlatformViewDataService platformViewDataService;
|
||||
private PlatformViewService platformViewService;
|
||||
|
||||
@ApiOperation(value = "流量数据 表单获取")
|
||||
@GetMapping("/list")
|
||||
public ResultMessage<List<PlatformViewVO>> getByPage(StatisticsQueryParam queryParam) {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
queryParam.setStoreId(storeId);
|
||||
return ResultUtil.data(platformViewDataService.list(queryParam));
|
||||
return ResultUtil.data(platformViewService.list(queryParam));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user