数据报表

This commit is contained in:
2024-04-08 11:33:44 +08:00
parent 05e1acaef2
commit 8cbe957833
5 changed files with 202 additions and 67 deletions

View File

@@ -1,6 +1,7 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.dto.ShopSummaryDto;
import cn.ysk.cashier.service.SummaryService;
import cn.ysk.cashier.vo.TbOrderPayCountVo;
import io.swagger.annotations.ApiOperation;
@@ -8,13 +9,12 @@ import lombok.RequiredArgsConstructor;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
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;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
@@ -29,30 +29,23 @@ public class SummaryByDayController {
@Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "download")
public void exportTbOrderInfo(HttpServletResponse response,
@RequestParam String shopId,
@RequestParam(required = false) Integer type,
@RequestParam(required = false) Long startTime,
@RequestParam(required = false) Long endTime) throws IOException {
summaryService.download(type, shopId, startTime, endTime,response);
@PostMapping(value = "download")
public void exportTbOrderInfo(HttpServletResponse response, @RequestBody ShopSummaryDto exportRequest) throws IOException {
summaryService.download(exportRequest,response);
}
@GetMapping
public Page<T> shopSummary(@RequestParam String shopId,
@RequestParam(required = false) Integer type,
@RequestParam(required = false) Long startTime,
@RequestParam(required = false) Long endTime,
public Page<T> shopSummary(ShopSummaryDto summaryDto,
@RequestParam(required = false, defaultValue = "0") Integer page,
@RequestParam(required = false, defaultValue = "10") Integer size) {
return summaryService.selectSummaryByDay(type, shopId, startTime, endTime, page, size);
return summaryService.selectSummaryByDay(summaryDto, page, size);
}
@GetMapping(value = "count")
public List<TbOrderPayCountVo> summaryCount(@RequestParam String shopId,
@RequestParam(required = false) Long startTime,
@RequestParam(required = false) Long endTime) {
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
return summaryService.summaryCount(shopId, startTime, endTime);
}