CRM: 完善销售漏斗分析
parent
c4ce9068f9
commit
6c9a3b0e11
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.controller.admin.statistics;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel.CrmStatisticBusinessEndStatusRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel.CrmStatisticFunnelRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel.CrmStatisticsFunnelReqVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.service.statistics.CrmStatisticsFunnelService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - CRM 销售漏斗")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/crm/statistics-funnel")
|
||||||
|
@Validated
|
||||||
|
public class CrmStatisticsFunnelController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CrmStatisticsFunnelService crmStatisticsFunnelService;
|
||||||
|
|
||||||
|
@GetMapping("/get-funnel-summary")
|
||||||
|
@Operation(summary = "获取销售漏斗统计数据", description = "用于【销售漏斗】页面")
|
||||||
|
@PreAuthorize("@ss.hasPermission('crm:statistics-funnel:query')")
|
||||||
|
public CommonResult<CrmStatisticFunnelRespVO> getFunnelSummary(@Valid CrmStatisticsFunnelReqVO reqVO) {
|
||||||
|
return success(crmStatisticsFunnelService.getFunnelSummary(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/get-business-end-status-summary")
|
||||||
|
@Operation(summary = "获取商机结束状态统计", description = "用于【销售漏斗】页面")
|
||||||
|
@PreAuthorize("@ss.hasPermission('crm:statistics-funnel:query')")
|
||||||
|
public CommonResult<List<CrmStatisticBusinessEndStatusRespVO>> getBusinessEndStatusSummary(@Valid CrmStatisticsFunnelReqVO reqVO) {
|
||||||
|
return success(crmStatisticsFunnelService.getBusinessEndStatusSummary(reqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - CRM 商机结束状态统计 Response VO")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class CrmStatisticBusinessEndStatusRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "结束状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Integer endStatus;
|
||||||
|
|
||||||
|
@Schema(description = "商机数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long businessCount;
|
||||||
|
|
||||||
|
@Schema(description = "商机总金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - CRM 销售漏斗 Response VO")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class CrmStatisticFunnelRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "客户数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long customerCount;
|
||||||
|
|
||||||
|
@Schema(description = "商机数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long businessCount;
|
||||||
|
|
||||||
|
@Schema(description = "赢单数", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long winCount;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.dal.mysql.statistics;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 销售漏斗 Mapper
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CrmStatisticsFunnelMapper {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.service.statistics;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel.CrmStatisticBusinessEndStatusRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel.CrmStatisticFunnelRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.funnel.CrmStatisticsFunnelReqVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 销售漏斗分析 Service
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
public interface CrmStatisticsFunnelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得销售漏斗数据
|
||||||
|
*
|
||||||
|
* @param reqVO 请求
|
||||||
|
* @return 销售漏斗数据
|
||||||
|
*/
|
||||||
|
CrmStatisticFunnelRespVO getFunnelSummary(CrmStatisticsFunnelReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得商机结束状态统计
|
||||||
|
*
|
||||||
|
* @param reqVO 请求
|
||||||
|
* @return 商机结束状态统计
|
||||||
|
*/
|
||||||
|
List<CrmStatisticBusinessEndStatusRespVO> getBusinessEndStatusSummary(CrmStatisticsFunnelReqVO reqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.statistics.CrmStatisticsFunnelMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue