Commit 3975f1b7 by zhouhaibao

[+]优秀案例审核

1 parent 92524519
......@@ -324,6 +324,68 @@ public class EmployeePerformanceDTO implements Serializable {
*/
@ApiModelProperty(value = "售后转化率(指标A0105)", example = "65%")
private String postSaleConversionRate;
// 新增字段
/**
* 触客数(指标A084)
*/
@ApiModelProperty(value = "触客数(指标A084)", example = "100")
private Integer customerCount;
/**
* 成交数(指标A075)
*/
@ApiModelProperty(value = "成交数(指标A075)", example = "80")
private Integer dealCount;
/**
* 整车延保-成交数(指标A066)
*/
@ApiModelProperty(value = "整车延保-成交数(指标A066)", example = "20")
private Integer vehicleWarrantyDealCount;
/**
* 电池-成交数(指标A070)
*/
@ApiModelProperty(value = "电池-成交数(指标A070)", example = "15")
private Integer batteryDealCount;
/**
* 安心包-成交数(指标A086)
*/
@ApiModelProperty(value = "安心包-成交数(指标A086)", example = "10")
private Integer safetyPackDealCount;
/**
* 轮胎成交数(指标A087)
*/
@ApiModelProperty(value = "轮胎成交数(指标A087)", example = "8")
private Integer tireDealCount;
// 新增字段
/**
* 售前触客数(指标A063)
*/
@ApiModelProperty(value = "售前触客数(指标A063)", example = "50")
private Integer preSaleCustomerCount;
/**
* 售后触客数(指标A096)
*/
@ApiModelProperty(value = "售后触客数(指标A096)", example = "50")
private Integer postSaleCustomerCount;
/**
* 售前成交数(指标A097)
*/
@ApiModelProperty(value = "售前成交数(指标A097)", example = "40")
private Integer preSaleDealCount;
/**
* 售后成交数(指标A098)
*/
@ApiModelProperty(value = "售后成交数(指标A098)", example = "40")
private Integer postSaleDealCount;
}
/**
......
......@@ -14,14 +14,8 @@ public class ExcellentCaseDetailDTO implements Serializable {
@ApiModelProperty(notes = "主键ID")
private Long id;
@ApiModelProperty(notes = "案例标题")
private String caseTitle;
@ApiModelProperty(notes = "驻店人员姓名")
private String staffName;
@ApiModelProperty(notes = "驻店人员手机号")
private String staffPhone;
@ApiModelProperty(notes = "录音ID")
private Long recordingId;
@ApiModelProperty(notes = "门店ID")
private Integer merchantId;
......@@ -29,20 +23,71 @@ public class ExcellentCaseDetailDTO implements Serializable {
@ApiModelProperty(notes = "门店名称")
private String merchantName;
@ApiModelProperty(notes = "客户类别")
private String customerCategory;
@ApiModelProperty(notes = "客户姓名")
private String customerName;
@ApiModelProperty(notes = "客户手机号")
private String phoneNumber;
@ApiModelProperty(notes = "销售UUID")
private String salesUuid;
@ApiModelProperty(notes = "销售姓名")
private String salesName;
@ApiModelProperty(notes = "车辆品牌")
private String carBrand;
@ApiModelProperty(notes = "车辆型号")
private String carModel;
@ApiModelProperty(notes = "接待开始时间")
private Date receptionStartTime;
@ApiModelProperty(notes = "接待结束时间")
private Date receptionEndTime;
@ApiModelProperty(notes = "接待状态")
private Integer receptionStatus;
@ApiModelProperty(notes = "案例描述")
private String caseDescription;
@ApiModelProperty(notes = "员工UUID")
private String staffUuid;
@ApiModelProperty(notes = "录音URL")
private String recordingUrl;
@ApiModelProperty(notes = "录音时长(秒)")
private Integer recordingDuration;
@ApiModelProperty(notes = "购车方式")
private Integer carPurchaseMethod;
@ApiModelProperty(notes = "检查历史标志")
private Integer checkHistoryFlag;
@ApiModelProperty(notes = "批次ID")
private Long batchId;
@ApiModelProperty(notes = "评分")
private Integer score;
@ApiModelProperty(notes = "模型类型")
private String modelType;
@ApiModelProperty(notes = "检查类型")
private String checkType;
@ApiModelProperty(notes = "订单完成标志")
private Boolean orderFinishFlag;
@ApiModelProperty(notes = "一车品牌")
private String oneCarBrand;
@ApiModelProperty(notes = "攻防评分")
private Integer gfScroe;
@ApiModelProperty(notes = "客户类型")
private String customerType;
@ApiModelProperty(notes = "提交人ID")
private Long submitterId;
private String submitterId;
@ApiModelProperty(notes = "提交人姓名")
private String submitterName;
......@@ -54,7 +99,7 @@ public class ExcellentCaseDetailDTO implements Serializable {
private Integer reviewStatus;
@ApiModelProperty(notes = "审核人ID")
private Long reviewerId;
private String reviewerId;
@ApiModelProperty(notes = "审核人姓名")
private String reviewerName;
......
......@@ -13,11 +13,11 @@ public class ExcellentCaseReviewQueryDTO implements Serializable {
@ApiModelProperty(notes = "驻店人员姓名,模糊匹配")
private String staffName;
@ApiModelProperty(notes = "接待门店名称,模糊匹配")
private String merchantName;
@ApiModelProperty(notes = "商户号")
private Integer merchantId;
@ApiModelProperty(notes = "客户类别")
private String customerCategory;
@ApiModelProperty(notes = "客户类型")
private String customerType;
@ApiModelProperty(notes = "提交人姓名,模糊匹配")
private String submitterName;
......
......@@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
......@@ -12,38 +11,7 @@ import java.io.Serializable;
@ToString
public class ExcellentCaseSubmitDTO implements Serializable {
@NotBlank(message = "案例标题不能为空")
@ApiModelProperty(notes = "案例标题", required = true)
private String caseTitle;
@NotBlank(message = "驻店人员姓名不能为空")
@ApiModelProperty(notes = "驻店人员姓名", required = true)
private String staffName;
@NotBlank(message = "驻店人员手机号不能为空")
@ApiModelProperty(notes = "驻店人员手机号", required = true)
private String staffPhone;
@NotNull(message = "门店ID不能为空")
@ApiModelProperty(notes = "门店ID", required = true)
private Integer merchantId;
@NotBlank(message = "门店名称不能为空")
@ApiModelProperty(notes = "门店名称", required = true)
private String merchantName;
@NotBlank(message = "客户类别不能为空")
@ApiModelProperty(notes = "客户类别", required = true)
private String customerCategory;
@NotBlank(message = "案例描述不能为空")
@ApiModelProperty(notes = "案例描述", required = true)
private String caseDescription;
@NotBlank(message = "录音URL不能为空")
@ApiModelProperty(notes = "录音URL", required = true)
private String recordingUrl;
@ApiModelProperty(notes = "录音时长(秒)")
private Integer recordingDuration;
@NotNull(message = "录音ID不能为空")
@ApiModelProperty(notes = "录音ID", required = true)
private Long recordingId;
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ import javax.persistence.*;
/**
* 优秀案例审核实体类
* <p>
* 用于存储督导提交的优秀案例信息,包括案例详情、驻店人员信息、门店信息、录音资料等
* 用于存储督导提交的优秀案例信息,只保存录音ID和操作人信息
* 支持审核流程:待审核 -> 通过/驳回
* </p>
*
......@@ -33,58 +33,10 @@ public class ExcellentCaseReview implements Serializable {
private Long id;
/**
* 案例标题
* 录音ID
*/
@Column(name = "case_title")
private String caseTitle;
/**
* 驻店人员姓名
*/
@Column(name = "staff_name")
private String staffName;
/**
* 驻店人员手机号
*/
@Column(name = "staff_phone")
private String staffPhone;
/**
* 门店ID
*/
@Column(name = "merchant_id")
private Integer merchantId;
/**
* 门店名称
*/
@Column(name = "merchant_name")
private String merchantName;
/**
* 客户类别
*/
@Column(name = "customer_category")
private String customerCategory;
/**
* 案例描述
*/
@Column(name = "case_description")
private String caseDescription;
/**
* 录音URL
*/
@Column(name = "recording_url")
private String recordingUrl;
/**
* 录音时长(秒)
*/
@Column(name = "recording_duration")
private Integer recordingDuration;
@Column(name = "recording_id")
private Long recordingId;
/**
* 提交人ID
......
......@@ -118,4 +118,15 @@ public interface ExcellentCaseReviewRemote {
@ApiMethod("查询客户类别列表")
@ApiResponse("客户类别列表")
RpcResponse<List<String>> queryCustomerCategories();
/**
* 查询所有客户类型
* <p>
* 从 inspection_defence 表中获取所有去重的客户类型
* </p>
*/
@interface QueryAllCustomerTypes {}
@ApiMethod("查询所有客户类型")
@ApiResponse("客户类型列表")
RpcResponse<List<String>> queryAllCustomerTypes();
}
......@@ -16,6 +16,7 @@ import java.util.List;
* - 案例列表分页查询(支持多条件筛选)
* - 案例详情查询
* - 客户类别列表查询
* - 录音ID重复检查
* </p>
*
* @author zhouhb
......@@ -28,9 +29,7 @@ public interface ExcellentCaseReviewMapper extends OreMapper<ExcellentCaseReview
* 查询优秀案例列表
* <p>
* 支持多条件筛选查询,包括:
* - 驻店人员姓名(模糊匹配)
* - 门店名称(模糊匹配)
* - 客户类别(精确匹配)
* - 提交人姓名(模糊匹配)
* - 审核状态(精确匹配)
* </p>
......@@ -61,4 +60,25 @@ public interface ExcellentCaseReviewMapper extends OreMapper<ExcellentCaseReview
* @return 客户类别列表
*/
List<String> queryCustomerCategories();
/**
* 根据录音ID检查是否已提交
* <p>
* 检查指定录音ID是否已经被提交为优秀案例
* </p>
*
* @param recordingId 录音ID
* @return 存在数量(0表示未提交,大于0表示已提交)
*/
Integer countByRecordingId(@Param("recordingId") Long recordingId);
/**
* 查询所有客户类型
* <p>
* 从 inspection_defence 表中获取所有去重的客户类型
* </p>
*
* @return 客户类型列表
*/
List<String> queryAllCustomerTypes();
}
......@@ -199,4 +199,26 @@ public class ExcellentCaseReviewRemoteImpl implements ExcellentCaseReviewRemote
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
/**
* 查询所有客户类型
* <p>
* 接收远程调用请求,调用Service层查询所有客户类型
* </p>
*
* @return RPC响应,包含客户类型列表
*/
@Override
public RpcResponse<List<String>> queryAllCustomerTypes() {
try {
List<String> result = excellentCaseReviewService.queryAllCustomerTypes();
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("cn.com.glsx.dj.supervisor.remote.ExcellentCaseReviewRemoteImpl.queryAllCustomerTypes error {}", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error("cn.com.glsx.dj.supervisor.remote.ExcellentCaseReviewRemoteImpl.queryAllCustomerTypes system error {}", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
}
......@@ -45,7 +45,7 @@ public class ExcellentCaseReviewService {
* 提交优秀案例
* <p>
* 督导提交优秀案例信息,案例初始状态为"待审核"
* 包含案例标题、驻店人员信息、门店信息、客户类别、案例描述、录音资料等
* 只保存录音ID和操作人信息,其他信息通过关联查询获取
* </p>
*
* @param request 案例提交信息
......@@ -58,6 +58,13 @@ public class ExcellentCaseReviewService {
public Boolean submitExcellentCase(ExcellentCaseSubmitDTO request, String currentUser, String currentUserId) {
log.info("开始提交优秀案例,请求参数:{}", request);
// 检查录音ID是否已经提交过
Integer existingCount = excellentCaseReviewMapper.countByRecordingId(request.getRecordingId());
if (existingCount != null && existingCount > 0) {
log.error("录音ID已提交过,录音ID:{}", request.getRecordingId());
throw new RpcServiceException("录音ID已提交过");
}
ExcellentCaseReview excellentCase = new ExcellentCaseReview();
BeanUtils.copyProperties(request, excellentCase);
......@@ -248,19 +255,19 @@ public class ExcellentCaseReviewService {
log.info("开始下载优秀案例录音,案例ID:{}", id);
RpcAssert.assertNotNull(id, DefaultErrorEnum.PARAMETER_NULL, "案例ID不能为空");
ExcellentCaseReview excellentCase = excellentCaseReviewMapper.selectByPrimaryKey(id);
if (excellentCase == null) {
ExcellentCaseDetailDTO detail = getExcellentCaseDetail(id);
if (detail == null) {
log.error("根据ID查询优秀案例不存在,案例ID:{}", id);
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "根据ID查询优秀案例不存在");
}
if (excellentCase.getRecordingUrl() == null || excellentCase.getRecordingUrl().isEmpty()) {
if (detail.getRecordingUrl() == null || detail.getRecordingUrl().isEmpty()) {
log.error("优秀案例录音URL为空,案例ID:{}", id);
throw new RpcServiceException("优秀案例录音URL为空");
}
log.info("下载优秀案例录音成功,案例ID:{},录音URL:{}", id, excellentCase.getRecordingUrl());
return excellentCase.getRecordingUrl();
log.info("下载优秀案例录音成功,案例ID:{},录音URL:{}", id, detail.getRecordingUrl());
return detail.getRecordingUrl();
}
/**
......@@ -280,4 +287,21 @@ public class ExcellentCaseReviewService {
log.info("查询客户类别列表成功,数据条数:{}", categories != null ? categories.size() : 0);
return categories;
}
/**
* 查询所有客户类型
* <p>
* 从 inspection_defence 表中获取所有去重的客户类型
* </p>
*
* @return 客户类型列表
*/
public List<String> queryAllCustomerTypes() {
log.info("开始查询所有客户类型");
List<String> types = excellentCaseReviewMapper.queryAllCustomerTypes();
log.info("查询所有客户类型成功,数据条数:{}", types != null ? types.size() : 0);
return types;
}
}
......@@ -1134,7 +1134,7 @@ public class SupervisorDashboardService {
// 一次请求所有指标,用逗号隔开
java.util.Map<String, java.math.BigDecimal> employeeMetrics = new java.util.HashMap<>();
java.util.Map<String, String> employeeRates = new java.util.HashMap<>(); // 环比数据
String employeeItemCodes = "A036,A076,A064,A085,A077,A095,A0100,A099,A0103,A091,A0101,A089,A0102,A090,A0104,A0105"; // 指标编码:总产值、客单价、触客率、转化率、渗透率、平均客单价、整车延保-渗透率(员工)、整车延保-转化率、电池-渗透率(员工)、电池-转化率、安心包-渗透率(员工)、安心包-转化率、轮胎渗透率(员工)、轮胎转化率、售前转化率、售后转化率
String employeeItemCodes = "A036,A076,A064,A085,A077,A095,A0100,A099,A0103,A091,A0101,A089,A0102,A090,A0104,A0105,A084,A075,A066,A070,A086,A087,A063,A096,A097,A098"; // 指标编码:总产值、客单价、触客率、转化率、渗透率、平均客单价、整车延保-渗透率(员工)、整车延保-转化率、电池-渗透率(员工)、电池-转化率、安心包-渗透率(员工)、安心包-转化率、轮胎渗透率(员工)、轮胎转化率、售前转化率、售后转化率、触客数、成交数、整车延保-成交数、电池-成交数、安心包-成交数、轮胎成交数、售前触客数、售后触客数、售前成交数、售后成交数
cn.com.glsx.dj.supervisor.service.DataBizQueryParamsDTO employeeQueryParams = new cn.com.glsx.dj.supervisor.service.DataBizQueryParamsDTO();
employeeQueryParams.setBizs(req.getBizs()); // 业务类型:1.延保
......@@ -1188,7 +1188,39 @@ public class SupervisorDashboardService {
employeePerformanceData.setPreSaleConversionRate(employeeRates.get("A0104"));
// 售后转化率(指标A0105)
employeePerformanceData.setPostSaleConversionRate(employeeRates.get("A0105"));
employeePerformanceData.setDailyPerformanceRate("100%"); // 暂时硬编码,后续从其他系统获取
// 触客数(指标A084)
employeePerformanceData.setCustomerCount(employeeMetrics.get("A084") != null ? employeeMetrics.get("A084").intValue() : 0);
// 成交数(指标A075)
employeePerformanceData.setDealCount(employeeMetrics.get("A075") != null ? employeeMetrics.get("A075").intValue() : 0);
// 整车延保-成交数(指标A066)
employeePerformanceData.setVehicleWarrantyDealCount(employeeMetrics.get("A066") != null ? employeeMetrics.get("A066").intValue() : 0);
// 电池-成交数(指标A070)
employeePerformanceData.setBatteryDealCount(employeeMetrics.get("A070") != null ? employeeMetrics.get("A070").intValue() : 0);
// 安心包-成交数(指标A086)
employeePerformanceData.setSafetyPackDealCount(employeeMetrics.get("A086") != null ? employeeMetrics.get("A086").intValue() : 0);
// 轮胎成交数(指标A087)
employeePerformanceData.setTireDealCount(employeeMetrics.get("A087") != null ? employeeMetrics.get("A087").intValue() : 0);
// 售前触客数(指标A063)
employeePerformanceData.setPreSaleCustomerCount(employeeMetrics.get("A063") != null ? employeeMetrics.get("A063").intValue() : 0);
// 售后触客数(指标A096)
employeePerformanceData.setPostSaleCustomerCount(employeeMetrics.get("A096") != null ? employeeMetrics.get("A096").intValue() : 0);
// 售前成交数(指标A097)
employeePerformanceData.setPreSaleDealCount(employeeMetrics.get("A097") != null ? employeeMetrics.get("A097").intValue() : 0);
// 售后成交数(指标A098)
employeePerformanceData.setPostSaleDealCount(employeeMetrics.get("A098") != null ? employeeMetrics.get("A098").intValue() : 0);
// 日报填写率:从 getEmployeeBehaviorData 获取日报完成率
cn.com.glsx.dj.supervisor.dto.EmployeeBehaviorReq behaviorReq = new cn.com.glsx.dj.supervisor.dto.EmployeeBehaviorReq();
behaviorReq.setEmployeeId(req.getEmployeeId());
behaviorReq.setMerchantId(req.getMerchantId());
behaviorReq.setBizs(req.getBizs());
behaviorReq.setStartDate(req.getStartDate());
behaviorReq.setEndDate(req.getEndDate());
cn.com.glsx.dj.supervisor.dto.EmployeeBehaviorDTO behaviorData = getEmployeeBehaviorData(behaviorReq);
String dailyPerformanceRate = "0%";
if (behaviorData != null && behaviorData.getDailyReport() != null) {
dailyPerformanceRate = behaviorData.getDailyReport().getCompletionRate();
}
employeePerformanceData.setDailyPerformanceRate(dailyPerformanceRate);
performanceData.setEmployeeData(employeePerformanceData);
// 3. 获取产值趋势数据(返回聚合的时间数据)
......@@ -1209,7 +1241,7 @@ public class SupervisorDashboardService {
if (trendDataResp != null && trendDataResp.getContent() != null && !trendDataResp.getContent().isEmpty()) {
for (cn.com.glsx.dj.supervisor.model.DataBusinessDTO trendItem : trendDataResp.getContent()) {
cn.com.glsx.dj.supervisor.dto.EmployeePerformanceDTO.TrendData trend = new cn.com.glsx.dj.supervisor.dto.EmployeePerformanceDTO.TrendData();
trend.setDate(trendItem.getDate()); // 日期
trend.setDate(trendItem.getStartDate()); // 日期
trend.setValue(trendItem.getItemValue() != null ? trendItem.getItemValue().intValue() : 0); // 产值
trendData.add(trend);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!