mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
CRM:完善【排行版】功能
This commit is contained in:
parent
a8bec19196
commit
8266fb8f94
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.rank;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - CRM 排行榜统计 Response VO")
|
@Schema(description = "管理后台 - CRM 排行榜统计 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ -17,14 +19,15 @@ public class CrmStatisticsRankRespVO {
|
|||||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
// TODO @芋艿:需要改下,金额是 bigdecimal
|
|
||||||
/**
|
/**
|
||||||
* 数量是个特别“抽象”的概念,在不同排行下,代表不同含义
|
* 数量是个特别“抽象”的概念,在不同排行下,代表不同含义
|
||||||
* <p>
|
*
|
||||||
* 1. 金额:合同金额排行、回款金额排行
|
* 1. 金额:合同金额排行、回款金额排行
|
||||||
* 2. 个数:签约合同排行、产品销量排行、产品销量排行、新增客户数排行、新增联系人排行、跟进次数排行、跟进客户数排行
|
* 2. 个数:签约合同排行、产品销量排行、产品销量排行、新增客户数排行、新增联系人排行、跟进次数排行、跟进客户数排行
|
||||||
|
*
|
||||||
|
* 为什么使用 BigDecimal 的原因:
|
||||||
*/
|
*/
|
||||||
@Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private Integer count;
|
private BigDecimal count;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and
|
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY owner_user_id
|
GROUP BY owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -27,8 +26,7 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND return_time between #{times[0],javaType=java.time.LocalDateTime} and
|
AND return_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY owner_user_id
|
GROUP BY owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -42,25 +40,23 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and
|
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY owner_user_id
|
GROUP BY owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- TODO 待定 这里是否需要关联 crm_contract_product 表,计算销售额 -->
|
|
||||||
<select id="selectProductSalesRank"
|
<select id="selectProductSalesRank"
|
||||||
resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.rank.CrmStatisticsRankRespVO">
|
resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.rank.CrmStatisticsRankRespVO">
|
||||||
SELECT COUNT(1) AS count, owner_user_id
|
SELECT COUNT(product.count) AS count, contract.owner_user_id
|
||||||
FROM crm_contract
|
FROM crm_contract_product product
|
||||||
WHERE deleted = 0
|
INNER JOIN crm_contract contract ON product.contract_id = contract.id
|
||||||
AND audit_status = 20
|
WHERE contract.deleted = 0 AND contract.deleted = 0
|
||||||
AND owner_user_id in
|
AND contract.audit_status = ${@cn.iocoder.yudao.module.crm.enums.common.CrmAuditStatusEnum@APPROVE.status}
|
||||||
|
AND contract.owner_user_id in
|
||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and
|
AND contract.order_date between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
GROUP BY contract.owner_user_id
|
||||||
GROUP BY owner_user_id
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCustomerCountRank"
|
<select id="selectCustomerCountRank"
|
||||||
@ -72,8 +68,7 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND create_time between #{times[0],javaType=java.time.LocalDateTime} and
|
AND create_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY owner_user_id
|
GROUP BY owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -86,8 +81,7 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND create_time between #{times[0],javaType=java.time.LocalDateTime} and
|
AND create_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY owner_user_id
|
GROUP BY owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -102,8 +96,7 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND cfur.create_time between #{times[0],javaType=java.time.LocalDateTime} and
|
AND cfur.create_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY cc.owner_user_id
|
GROUP BY cc.owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -118,8 +111,7 @@
|
|||||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
</foreach>
|
</foreach>
|
||||||
AND cfur.create_time between #{times[0],javaType=java.time.LocalDateTime} and
|
AND cfur.create_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
#{times[1],javaType=java.time.LocalDateTime}
|
|
||||||
GROUP BY cc.owner_user_id
|
GROUP BY cc.owner_user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user