package com.nova.sankuai.controller.v1;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.nova.sankuai.domain.dto.*;
|
import com.nova.sankuai.domain.entity.ChannelInfo;
|
import com.nova.sankuai.domain.enums.vipservice.VipCardTypeEnum;
|
import com.nova.sankuai.domain.vo.*;
|
import com.nova.sankuai.domain.vo.channel.ChannelExportReportVo;
|
import com.nova.sankuai.domain.vo.channel.ChannelImportReportVo;
|
import com.nova.sankuai.domain.vo.channel.ChannelReportTotalVo;
|
import com.nova.sankuai.infra.config.CommonException;
|
import com.nova.sankuai.infra.utils.PageRequest;
|
import com.nova.sankuai.infra.utils.ResultJson;
|
import com.nova.sankuai.security.UserDetail;
|
import com.nova.sankuai.service.IChannelLogService;
|
import com.nova.sankuai.service.IVipCardOrderLogService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
/**
|
* @author weikangdi
|
* @create 2021/11/25
|
*/
|
@Api(tags = "统计报表")
|
@RestController
|
@RequestMapping(value = "/api/v1/channelLog")
|
@AllArgsConstructor
|
public class ChannelLogController {
|
|
private final IChannelLogService channelLogService;
|
|
|
private final IVipCardOrderLogService vipCardOrderLogService;
|
|
@GetMapping(value = "/importTotal")
|
@ApiOperation(value = "入口流量总览")
|
@PreAuthorize("hasAuthority('channelLog.importTotal')")
|
public ResultJson<List<ChannelReportTotalVo>> importTotal(ChannelReportDto reportDto) {
|
List<ChannelReportTotalVo> result = channelLogService.importTotal(reportDto);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/importDetail")
|
@ApiOperation(value = "入口流量明细")
|
@PreAuthorize("hasAuthority('channelLog.importDetail')")
|
public ResultJson<IPage<ChannelImportReportVo>> importDetail(ChannelReportDetailDto reportDto, PageRequest pageRequest) {
|
if (reportDto.getChannelCode() == null) {
|
throw new CommonException("渠道编码不能为空");
|
}
|
IPage<ChannelImportReportVo> result = channelLogService.importDetail(reportDto, pageRequest);
|
return ResultJson.ok(result);
|
}
|
|
|
@GetMapping(value = "/exportTotal")
|
@ApiOperation(value = "出口流量总览")
|
@PreAuthorize("hasAuthority('channelLog.exportTotal')")
|
public ResultJson<List<ChannelReportTotalVo>> exportTotal(ChannelReportDto reportDto) {
|
List<ChannelReportTotalVo> result = channelLogService.exportTotal(reportDto);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/exportDetail")
|
@ApiOperation(value = "出口流量明细")
|
@PreAuthorize("hasAuthority('channelLog.exportDetail')")
|
public ResultJson<IPage<ChannelExportReportVo>> exportDetail(ChannelReportDetailDto reportDto, PageRequest pageRequest) {
|
if (reportDto.getChannelCode() == null) {
|
throw new CommonException("渠道编码不能为空");
|
}
|
IPage<ChannelExportReportVo> result = channelLogService.exportDetail(reportDto, pageRequest);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/channelList")
|
@ApiOperation(value = "获取渠道列表")
|
@PreAuthorize("hasAuthority('channelLog.channelList')")
|
public ResultJson<List<ChannelInfo>> channelList(Integer type) {
|
List<ChannelInfo> result = channelLogService.channelList(type);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/addVipCardOrderLog")
|
@ApiOperation(value = "新增渠道会员订单购买日志")
|
public ResultJson<Void> addVipCardOrderLog(@AuthenticationPrincipal UserDetail userDetail, VipCardOrderLogDto logDto) {
|
vipCardOrderLogService.addVipCardOrderLog(userDetail, logDto);
|
return ResultJson.success();
|
}
|
|
@GetMapping(value = "/getVipStatisticsList")
|
@ApiOperation(value = "查看会员转化率")
|
@PreAuthorize("hasAuthority('conversionRate.getVipStatisticsList')")
|
public ResultJson<IPage<VipStatisticsVo>> getVipStatisticsList(PageRequest pageRequest, ChannelVisitDto visitDto) {
|
visitDto.setVipType(VipCardTypeEnum.MEMBER_SERVICE.getCode());
|
IPage<VipStatisticsVo> result = vipCardOrderLogService.getVipStatisticsList(pageRequest, visitDto);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/getVipStatisticsDetail")
|
@ApiOperation(value = "查看会员转化率明细")
|
@PreAuthorize("hasAuthority('conversionRate.getVipStatisticsDetail')")
|
public ResultJson<IPage<VipStatisticsDetailVo>> getVipStatisticsDetail(PageRequest pageRequest, VipStatisticsDetailDto detailDto) {
|
detailDto.setVipType(VipCardTypeEnum.MEMBER_SERVICE.getCode());
|
IPage<VipStatisticsDetailVo> result = vipCardOrderLogService.getVipStatisticsDetail(pageRequest, detailDto);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/getQueueVipStatistics")
|
@ApiOperation(value = "查看审批加速会员转化率")
|
@PreAuthorize("hasAuthority('conversionRate.getQueueVipStatisticsList')")
|
public ResultJson<IPage<VipStatisticsVo>> getQueueVipStatistics(PageRequest pageRequest, ChannelVisitDto visitDto) {
|
visitDto.setVipType(VipCardTypeEnum.AUDIT_QUEUE.getCode());
|
IPage<VipStatisticsVo> result = vipCardOrderLogService.getVipStatisticsList(pageRequest, visitDto);
|
return ResultJson.ok(result);
|
}
|
|
@GetMapping(value = "/getQueueVipStatisticsDetail")
|
@ApiOperation(value = "查看审批加速会员转化率明细")
|
@PreAuthorize("hasAuthority('conversionRate.getQueueVipStatisticsDetail')")
|
public ResultJson<IPage<VipStatisticsDetailVo>> getQueueVipStatisticsDetail(PageRequest pageRequest, VipStatisticsDetailDto detailDto) {
|
detailDto.setVipType(VipCardTypeEnum.AUDIT_QUEUE.getCode());
|
IPage<VipStatisticsDetailVo> result = vipCardOrderLogService.getVipStatisticsDetail(pageRequest, detailDto);
|
return ResultJson.ok(result);
|
}
|
|
@PostMapping(value = "/getChannelProportion")
|
@ApiOperation(value = "查看渠道占比")
|
@PreAuthorize("hasAuthority('channelProportion.getChannelProportion')")
|
public ResultJson<List<ChannelProportionListVo>> getChannelProportion(@RequestBody ChannelProportionDto channelProportionDto) {
|
List<ChannelProportionListVo> channelProportion = channelLogService.getChannelProportion(channelProportionDto);
|
return ResultJson.ok(channelProportion);
|
}
|
|
@PostMapping(value = "/getLoanSupermarketStatistics")
|
@ApiOperation(value = "查看贷超统计报表")
|
@PreAuthorize("hasAuthority('loanSupermarketStatistics.getLoanSupermarketStatistics')")
|
public ResultJson getLoanSupermarketStatistics(@RequestBody LoanSupermarketStatisticsDto supermarketStatisticsDto) {
|
List<LoanSupermarketStatisticsVo> loanSupermarketStatistics = channelLogService.getLoanSupermarketStatistics(supermarketStatisticsDto);
|
return ResultJson.ok(loanSupermarketStatistics);
|
}
|
|
@PostMapping(value = "/getAutoStatistics")
|
@ApiOperation(value = "查看联登渠道统计报表")
|
@PreAuthorize("hasAuthority('autoStatistics.getAutoStatistics')")
|
public ResultJson<List<AutoStatisticsVo>> getAutoStatistics(@RequestBody AutoStatisticsDto autoStatisticsDto) {
|
List<AutoStatisticsVo> autoStatistics = channelLogService.getAutoStatistics(autoStatisticsDto);
|
return ResultJson.ok(autoStatistics);
|
}
|
|
@PostMapping(value = "/getWholeProcessStatistics")
|
@ApiOperation(value = "查看全流程报表")
|
@PreAuthorize("hasAuthority('wholeProcessStatistics.getWholeProcessStatistics')")
|
public ResultJson<List<WholeProcessStatisticsListVo>> getWholeProcessStatistics(@RequestBody WholeProcessStatisticsDto wholeProcessStatisticsDto) {
|
List<WholeProcessStatisticsListVo> wholeProcessStatistics = channelLogService.getWholeProcessStatistics(wholeProcessStatisticsDto);
|
return ResultJson.ok(wholeProcessStatistics);
|
}
|
|
@PostMapping(value = "/inletFlowProportionExport")
|
@ApiOperation(value = "入口流量会员购买率Excel导出")
|
@PreAuthorize("hasAuthority('inletFlowProportion.getInletFlowProportionExport')")
|
public void inletFlowProportionExport(HttpServletResponse response, @RequestBody InletFlowProportionDto inletFlowProportionDto) {
|
channelLogService.inletFlowProportionExport(response, inletFlowProportionDto);
|
}
|
|
@PostMapping(value = "/getChannelProportionExport")
|
@ApiOperation(value = "渠道占比导出excel")
|
@PreAuthorize("hasAuthority('channelProportion.getChannelProportionExport')")
|
public void getChannelProportionExport(HttpServletResponse response, @RequestBody ChannelProportionDto channelProportionDto) {
|
channelLogService.getChannelProportionExport(response, channelProportionDto);
|
}
|
|
@PostMapping(value = "/getLoanSupermarketStatisticsExport")
|
@ApiOperation(value = "贷超统计报表导出excel")
|
@PreAuthorize("hasAuthority('loanSupermarketStatistics.loanSupermarketStatisticsExport')")
|
public void getLoanSupermarketStatisticsExport(HttpServletResponse response, @RequestBody LoanSupermarketStatisticsDto supermarketStatisticsDto) {
|
channelLogService.getLoanSupermarketStatisticsExport(response, supermarketStatisticsDto);
|
}
|
|
@PostMapping(value = "/autoStatisticsExport")
|
@ApiOperation(value = "联登统计报表导出excel")
|
@PreAuthorize("hasAuthority('autoStatistics.autoStatisticsExport')")
|
public void autoStatisticsExport(HttpServletResponse response, @RequestBody AutoStatisticsDto autoStatisticsDto) {
|
channelLogService.autoStatisticsExport(response, autoStatisticsDto);
|
}
|
|
@PostMapping(value = "/channelStatistics")
|
@ApiOperation(value = "多渠道统计报表")
|
@PreAuthorize("hasAuthority('inletFlowProportion.getChannelStatistics')")
|
public ResultJson<List<ChannelStatisticsVo>> channelStatistics(@RequestBody ChannelStatisticsDto channelStatisticsDto) {
|
List<ChannelStatisticsVo> channelStatisticsVos = channelLogService.channelStatistics(channelStatisticsDto);
|
return ResultJson.ok(channelStatisticsVos);
|
}
|
|
@PostMapping(value = "/profitAnalysisReport")
|
@ApiOperation(value = "盈利分析报表")
|
@PreAuthorize("hasAuthority('profitAnalysis.profitAnalysisReport')")
|
public ResultJson<List<ProfitAnalysisReportVo>> profitAnalysisReport(@RequestBody ProfitAnalysisReportDto profitAnalysisReportDto) {
|
List<ProfitAnalysisReportVo> profitAnalysisReportVos = channelLogService.profitAnalysisReport(profitAnalysisReportDto);
|
return ResultJson.ok(profitAnalysisReportVos);
|
}
|
}
|