Commit dbde0fdc by zhouhaibao

[+]督导团队业绩和个人业绩查询

1 parent 246fcf22
......@@ -62,4 +62,16 @@ public class DashboardQueryReq implements Serializable {
@ApiModelProperty(value = "门店ID列表", notes = "门店ID列表")
private List<Integer> merchantIds;
/**
* 排序字段:1.产值 2.客单价 3.转化率 4.成交数 5.战败数 6.录音数
*/
@ApiModelProperty(value = "排序字段", example = "1", notes = "排序字段:1.产值 2.客单价 3.转化率 4.成交数 5.战败数 6.录音数")
private Integer sortField;
/**
* 排序方向:0.升序 1.降序
*/
@ApiModelProperty(value = "排序方向", example = "1", notes = "排序方向:0.升序 1.降序")
private Integer sortDirection;
}
\ No newline at end of file
......@@ -91,4 +91,10 @@ public class EmployeeBasicInfoDTO implements Serializable {
@ApiModelProperty(value = "性别", example = "女")
private String gender;
/**
* 政治面貌
*/
@ApiModelProperty(value = "政治面貌", example = "党员")
private String politicalStatus;
}
......@@ -59,22 +59,46 @@ public class EmployeePerformanceDTO implements Serializable {
private Integer totalValue;
/**
* 总产值环比
*/
@ApiModelProperty(value = "总产值环比", example = "10%")
private String totalValueRate;
/**
* 客单价(指标A076)
*/
@ApiModelProperty(value = "客单价(指标A076)", example = "12000")
private Integer averagePrice;
/**
* 客单价环比
*/
@ApiModelProperty(value = "客单价环比", example = "5%")
private String averagePriceRate;
/**
* 总触客数(指标A084)
*/
@ApiModelProperty(value = "总触客数(指标A084)", example = "129")
private Integer totalCustomers;
/**
* 总触客数环比
*/
@ApiModelProperty(value = "总触客数环比", example = "8%")
private String totalCustomersRate;
/**
* 总成交数(指标A075)
*/
@ApiModelProperty(value = "总成交数(指标A075)", example = "101")
private Integer totalDeals;
/**
* 总成交数环比
*/
@ApiModelProperty(value = "总成交数环比", example = "12%")
private String totalDealsRate;
}
/**
......@@ -90,12 +114,24 @@ public class EmployeePerformanceDTO implements Serializable {
private Integer totalValue;
/**
* 总产值环比
*/
@ApiModelProperty(value = "总产值环比", example = "15%")
private String totalValueRate;
/**
* 客单价
*/
@ApiModelProperty(value = "客单价", example = "11649.5")
private Double averagePrice;
/**
* 客单价环比
*/
@ApiModelProperty(value = "客单价环比", example = "8%")
private String averagePriceRate;
/**
* 日报完成率
*/
@ApiModelProperty(value = "日报完成率", example = "100%")
......
......@@ -2,6 +2,7 @@ package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serializable;
......@@ -33,10 +34,17 @@ public class EmployeePerformanceReq implements Serializable {
private Long supervisorId;
/**
* 场景
* 日期类型:0,按指定时段;1,按周;2,按月;3,按年;4,全部
*/
@ApiModelProperty(value = "场景", example = "sales")
private String scene;
@ApiModelProperty(value = "日期类型", example = "0", required = true, notes = "日期类型:0,按指定时段;1,按周;2,按月;3,按年;4,全部")
@NotNull
private Integer dateType;
/**
* 业务类型:1.延保 2.轻改 3.权益 4.二手车 必传
*/
@ApiModelProperty(value = "业务类型", example = "1", notes = "业务类型:1.延保 2.轻改 3.权益 4.二手车 必传")
private Integer bizs;
/**
* 开始日期
......@@ -56,4 +64,5 @@ public class EmployeePerformanceReq implements Serializable {
@ApiModelProperty(value = "门店ID", example = "1001")
private Integer merchantId;
}
......@@ -42,4 +42,7 @@ public class EmployeeRanking implements Serializable {
private BigDecimal dealRate; // 成交率 = 成交/(成交 + 战败)
private BigDecimal avgRecordPerDeal; // 平均单产录音数 = 录音/成交
@ApiModelProperty(notes = "业务类型")
private String bussinessType;
}
......@@ -64,6 +64,12 @@
<artifactId>hutool-all</artifactId>
<version>5.8.38</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.7.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package cn.com.glsx.dj.supervisor.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* 业务场景Mapper
* <p>
* 用于查询员工的业务场景标签
* </p>
*
* @author fanfr
* @since 2026-03-16
*/
@Mapper
public interface BusinessSceneMapper {
/**
* 根据手机号查询业务场景标签
*
* @param phoneNumber 手机号
* @return 业务场景标签,格式为逗号分隔的字符串
*/
@Select("SELECT COALESCE(GROUP_CONCAT(DISTINCT CASE WHEN go.scene_type = 1 THEN '1' WHEN go.scene_type = 0 THEN CASE WHEN go.business_type = 1 THEN '2' WHEN go.business_type = 2 THEN '3' END END ORDER BY CASE WHEN go.scene_type = 1 THEN '1' WHEN go.scene_type = 0 AND go.business_type = 1 THEN '2' WHEN go.scene_type = 0 AND go.business_type = 2 THEN '3' END SEPARATOR ', '), '') AS staff_scene_label FROM dj_car_life_staff_info si LEFT JOIN dj_car_life_goods_order go ON si.staff_uuid = go.seller_user_id AND go.install_upgrade_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) WHERE si.phone_number = #{phoneNumber} GROUP BY si.phone_number")
String getBusinessSceneByPhoneNumber(@Param("phoneNumber") String phoneNumber);
}
\ No newline at end of file
package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.model.BehaviorDataDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 录音统计Mapper
* <p>
* 用于查询录音相关数据
* </p>
*
* @author fanfr
* @since 2026-03-16
*/
@Mapper
public interface RecordingStatsMapper {
/**
* 查询录音统计数据
*
* @param bizs 场景
* @param merchantIds 商户号列表
* @param startDate 开始时间
* @param endDate 结束时间
* @return 录音统计数据列表
*/
List<BehaviorDataDTO> getRecordingStats(
@Param("bizs") Integer bizs,
@Param("merchantIds") List<Integer> merchantIds,
@Param("startDate") String startDate,
@Param("endDate") String endDate
);
}
\ No newline at end of file
......@@ -257,4 +257,32 @@ public class GetDataStatsService {
return resultMap;
}
/**
* 根据场景、门店、员工id、开始时间、结束时间从指标系统获取数据
* @param bizs 场景
* @param merchantIds 门店ID列表,多个用逗号分隔
* @param staffIds 员工ID列表,多个用逗号分隔
* @param startDate 开始时间
* @param endDate 结束时间
* @param itemCodes 指标编码列表,多个用逗号分隔
* @return 数据响应
*/
public DataResp<List<DataBusinessDTO>> getIndicatorData(Integer bizs, String merchantIds, String staffIds, String startDate, String endDate, String itemCodes) {
// 创建查询参数
DataBizQueryParamsDTO queryParams = new DataBizQueryParamsDTO();
queryParams.setBizs(bizs);
queryParams.setMerchantIds(merchantIds);
queryParams.setStaffIds(staffIds);
queryParams.setStartDate(startDate);
queryParams.setEndDate(endDate);
queryParams.setItemCodes(itemCodes);
// 转换为JSON
String jsonBody = JSONUtil.toJsonStr(queryParams);
log.info("getIndicatorData jsonBody: {}", jsonBody);
// 调用指标系统
return getListDataResp(jsonBody);
}
}
<?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.com.glsx.dj.supervisor.mapper.RecordingStatsMapper">
<resultMap id="BehaviorDataDTOMap" type="cn.com.glsx.dj.supervisor.model.BehaviorDataDTO">
<result property="staffPhone" column="staffPhone"/>
<result property="staffName" column="staffName"/>
<result property="recordingCount" column="recordingCount"/>
</resultMap>
<select id="getRecordingStats" resultMap="BehaviorDataDTOMap">
select t3.phone_number as staffPhone, t3.staff_name as staffName, count(1) as recordingCount
from reception_customer_info t1
left join inspection_badge_recordings t2 on t2.reception_id = t1.id
left join dj_car_life_staff_info t3 on t1.staff_uuid = t3.staff_uuid
where 1=1
<if test="bizs != null">
and t2.check_type = #{bizs}
</if>
<if test="merchantIds != null and merchantIds.size() > 0">
and t1.merchant_id in
<foreach item="merchantId" collection="merchantIds" open="(" separator="," close=")">
#{merchantId}
</foreach>
</if>
<if test="startDate != null and startDate != ''">
and date(t1.reception_start_time) >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and date(t1.reception_start_time) <= #{endDate}
</if>
and t3.phone_number is not null
group by t3.phone_number
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!