数据统计相关接口
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.order.param.DataSummaryProductSaleParam;
|
||||
import com.czg.order.param.DataSummaryTradeParam;
|
||||
import com.czg.order.service.DataSummaryService;
|
||||
import com.czg.order.vo.DataSummaryDateAmountVo;
|
||||
import com.czg.order.vo.DataSummaryPayTypeVo;
|
||||
import com.czg.order.vo.DataSummaryProductSaleVo;
|
||||
import com.czg.order.vo.DataSummaryTradeVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 数据统计
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-07 15:25
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/data/summary")
|
||||
public class DataSummaryController {
|
||||
private final DataSummaryService dataSummaryService;
|
||||
|
||||
/**
|
||||
* 营业板块-上半部分
|
||||
*/
|
||||
@GetMapping("trade")
|
||||
@OperationLog("营业板块-上半部分")
|
||||
//@SaAdminCheckPermission("dataSummary:trade")
|
||||
public CzgResult<DataSummaryTradeVo> getTradeData(DataSummaryTradeParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
DataSummaryTradeVo data = dataSummaryService.getTradeData(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品销售 右下
|
||||
*/
|
||||
@GetMapping("productSaleDate")
|
||||
@OperationLog("商品销售-右下")
|
||||
//@SaAdminCheckPermission("dataSummary:productSaleData")
|
||||
private CzgResult<DataSummaryProductSaleVo> getProductSaleData(DataSummaryProductSaleParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
DataSummaryProductSaleVo data = dataSummaryService.getProductSaleData(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售趋势柱状图 左下
|
||||
*
|
||||
* @param day 天数
|
||||
*/
|
||||
@GetMapping("dateAmount")
|
||||
@OperationLog("销售趋势柱状图 左下")
|
||||
//@SaAdminCheckPermission("dataSummary:dateAmount")
|
||||
private CzgResult<DataSummaryDateAmountVo> getDateAmount(@RequestParam Integer day) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
DataSummaryDateAmountVo data = dataSummaryService.getSummaryAmountData(shopId, day);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付占比饼图 左下
|
||||
*
|
||||
* @param day 天数
|
||||
*/
|
||||
@GetMapping("datePayType")
|
||||
//@SaAdminCheckPermission("dataSummary:datePayType")
|
||||
private Object shopSummaryPayType(@RequestParam Integer day) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
DataSummaryPayTypeVo data = dataSummaryService.getSummaryPayTypeData(shopId, day);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.order.param.SaleSummaryCountParam;
|
||||
import com.czg.order.service.SaleSummaryService;
|
||||
import com.czg.order.vo.SaleSummaryCountVo;
|
||||
import com.czg.order.vo.SaleSummaryInfoVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销量统计
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-07 15:25
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/sale/summary")
|
||||
public class SaleSummaryController {
|
||||
private final SaleSummaryService saleSummaryService;
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*/
|
||||
@GetMapping("count")
|
||||
@OperationLog("统计")
|
||||
//@SaAdminCheckPermission("saleSummary:count")
|
||||
public CzgResult<SaleSummaryCountVo> summaryCount(SaleSummaryCountParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
SaleSummaryCountVo data = saleSummaryService.summaryCount(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
@OperationLog("分页")
|
||||
//@SaAdminCheckPermission("saleSummary:page")
|
||||
public CzgResult<Page<SaleSummaryInfoVo>> summaryPage(SaleSummaryCountParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
Page<SaleSummaryInfoVo> page = saleSummaryService.summaryPage(param);
|
||||
return CzgResult.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@ResponseExcel(name = "销售统计明细")
|
||||
@GetMapping("/export")
|
||||
@OperationLog("导出")
|
||||
//@SaAdminCheckPermission("saleSummary:export")
|
||||
public List<SaleSummaryInfoVo> summaryExport(SaleSummaryCountParam param) {
|
||||
return saleSummaryService.summaryList(param);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.order.param.TableSummaryParam;
|
||||
import com.czg.order.service.TableSummaryService;
|
||||
import com.czg.order.vo.TableSummaryExportVo;
|
||||
import com.czg.order.vo.TableSummaryInfoVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 台桌统计
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-07 15:25
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/admin/table/summary")
|
||||
public class TableSummaryController {
|
||||
private final TableSummaryService tableSummaryService;
|
||||
|
||||
/**
|
||||
* 统计
|
||||
*/
|
||||
@GetMapping("list")
|
||||
@OperationLog("统计")
|
||||
//@SaAdminCheckPermission("tableSummary:list")
|
||||
public CzgResult<List<TableSummaryInfoVo>> summaryList(TableSummaryParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
List<TableSummaryInfoVo> data = tableSummaryService.summaryList(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@ResponseExcel(name = "台桌统计")
|
||||
@GetMapping("export")
|
||||
@OperationLog("导出")
|
||||
//@SaAdminCheckPermission("tableSummary:export")
|
||||
public List<TableSummaryExportVo> summaryExport(TableSummaryParam param) {
|
||||
return tableSummaryService.summaryExport(param);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user