数据报表

This commit is contained in:
2024-04-07 18:12:15 +08:00
parent a11b7ebd2e
commit 05e1acaef2
8 changed files with 463 additions and 87 deletions

View File

@@ -0,0 +1,59 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.service.SummaryService;
import cn.ysk.cashier.vo.TbOrderPayCountVo;
import io.swagger.annotations.ApiOperation;
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 javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @author lyf
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/summary/day")
public class SummaryByDayController {
@Autowired
private SummaryService summaryService;
@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);
}
@GetMapping
public Page<T> shopSummary(@RequestParam String shopId,
@RequestParam(required = false) Integer type,
@RequestParam(required = false) Long startTime,
@RequestParam(required = false) Long endTime,
@RequestParam(required = false, defaultValue = "0") Integer page,
@RequestParam(required = false, defaultValue = "10") Integer size) {
return summaryService.selectSummaryByDay(type, shopId, startTime, endTime, page, size);
}
@GetMapping(value = "count")
public List<TbOrderPayCountVo> summaryCount(@RequestParam String shopId,
@RequestParam(required = false) Long startTime,
@RequestParam(required = false) Long endTime) {
return summaryService.summaryCount(shopId, startTime, endTime);
}
}