| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.dao.dto.DataBoardQueryDTO; |
| | | import com.doumee.dao.dto.FinanceQueryDTO; |
| | | import com.doumee.dao.dto.TrendQueryDTO; |
| | | import com.doumee.dao.vo.*; |
| | | import com.doumee.service.business.DataBoardService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "数据看板") |
| | |
| | | return ApiResponse.success(dataBoardService.overview(query)); |
| | | } |
| | | |
| | | @ApiOperation("近30天会员注册趋势") |
| | | @ApiOperation("会员注册趋势") |
| | | @PostMapping("/memberTrend") |
| | | public ApiResponse<List<MemberTrendVO>> memberTrend() { |
| | | return ApiResponse.success(dataBoardService.memberTrend()); |
| | | public ApiResponse<List<MemberTrendVO>> memberTrend(@RequestBody TrendQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.memberTrend(query)); |
| | | } |
| | | |
| | | @ApiOperation("近30天订单趋势") |
| | | @ApiOperation("订单趋势") |
| | | @PostMapping("/orderTrend") |
| | | public ApiResponse<List<OrderTrendVO>> orderTrend() { |
| | | return ApiResponse.success(dataBoardService.orderTrend()); |
| | | public ApiResponse<List<OrderTrendVO>> orderTrend(@RequestBody TrendQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.orderTrend(query)); |
| | | } |
| | | |
| | | @ApiOperation("近30天营收趋势") |
| | | @ApiOperation("营收趋势") |
| | | @PostMapping("/revenueTrend") |
| | | public ApiResponse<List<RevenueTrendVO>> revenueTrend() { |
| | | return ApiResponse.success(dataBoardService.revenueTrend()); |
| | | public ApiResponse<List<RevenueTrendVO>> revenueTrend(@RequestBody TrendQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.revenueTrend(query)); |
| | | } |
| | | |
| | | @ApiOperation("门店业绩统计") |
| | |
| | | public ApiResponse<ShopPerformanceVO> shopPerformance(@RequestBody DataBoardQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.shopPerformance(query)); |
| | | } |
| | | |
| | | @ApiOperation("行李类型占比导出") |
| | | @PostMapping("/luggageTypeExport") |
| | | public void luggageTypeExport(@RequestBody DataBoardQueryDTO query, HttpServletResponse response) { |
| | | ExcelExporter.build(LuggageTypeItem.class) |
| | | .export(dataBoardService.luggageTypeList(query), "行李类型占比", response); |
| | | } |
| | | |
| | | @ApiOperation("平台财务总览") |
| | | @PostMapping("/financeOverview") |
| | | public ApiResponse<List<FinanceOverviewVO>> financeOverview(@RequestBody FinanceQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.financeOverview(query)); |
| | | } |
| | | |
| | | @ApiOperation("平台财务总览导出") |
| | | @PostMapping("/financeOverviewExport") |
| | | public void financeOverviewExport(@RequestBody FinanceQueryDTO query, HttpServletResponse response) { |
| | | String fileName = "平台财务数据报表_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
| | | ExcelExporter.build(FinanceOverviewVO.class) |
| | | .export(dataBoardService.financeOverview(query), fileName, response); |
| | | } |
| | | |
| | | @ApiOperation("门店业绩Top10") |
| | | @PostMapping("/shopTop") |
| | | public ApiResponse<List<ShopTopVO>> shopTop(@RequestBody TrendQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.shopTop(query)); |
| | | } |
| | | |
| | | @ApiOperation("司机业绩Top10") |
| | | @PostMapping("/driverTop") |
| | | public ApiResponse<List<DriverTopVO>> driverTop(@RequestBody TrendQueryDTO query) { |
| | | return ApiResponse.success(dataBoardService.driverTop(query)); |
| | | } |
| | | } |