fix(aihr): align fallback scoring with BRD dimensions
This commit is contained in:
+24
-20
@@ -717,18 +717,19 @@ public class AihrPracticeSeedService {
|
||||
}
|
||||
|
||||
private PracticeResult seedPracticeResult(ActiveSession activeSession, ScenarioSeed scenario) {
|
||||
int compliance = scoreValue(scenario.scores(), "合规", scenario.total());
|
||||
int communication = scoreValue(scenario.scores(), "沟通", scenario.total());
|
||||
int emotion = scoreValue(scenario.scores(), "情绪", scenario.total());
|
||||
int marketing = scoreValue(scenario.scores(), "营销", scenario.total());
|
||||
Integer response = responseTimelinessScore(activeSession);
|
||||
int taskCompletion = scoreValue(scenario.scores(), "任务完成度", scenario.total());
|
||||
int standardization = scoreValue(scenario.scores(), "话术规范性", taskCompletion);
|
||||
int emotion = scoreValue(scenario.scores(), "情绪管理能力", scenario.total());
|
||||
int marketing = scoreValue(scenario.scores(), "增值转化潜力", scenario.total());
|
||||
Integer response = scoreValue(scenario.scores(), "响应时效");
|
||||
response = response == null ? responseTimelinessScore(activeSession) : response;
|
||||
int total = response == null
|
||||
? scenario.total()
|
||||
: weightedPracticeScore(compliance, average(compliance, communication), emotion, response, marketing);
|
||||
: weightedPracticeScore(taskCompletion, standardization, emotion, response, marketing);
|
||||
return new PracticeResult(
|
||||
total,
|
||||
brdDimensions(compliance, average(compliance, communication), emotion, response, marketing),
|
||||
scenario.rewrite(), scenario.summary(), compliance, communication, compliance, response,
|
||||
brdDimensions(taskCompletion, standardization, emotion, response, marketing),
|
||||
scenario.rewrite(), scenario.summary(), standardization, standardization, taskCompletion, response,
|
||||
averageResponseLatencyMs(activeSession)
|
||||
);
|
||||
}
|
||||
@@ -3957,10 +3958,11 @@ public class AihrPracticeSeedService {
|
||||
private List<DimensionResponse> defaultScores(String scenarioCode) {
|
||||
boolean feeScenario = !isBlank(scenarioCode) && scenarioCode.contains("fee");
|
||||
return List.of(
|
||||
new DimensionResponse("合规", feeScenario ? 82 : 84, "SOP关键点覆盖"),
|
||||
new DimensionResponse("沟通", 84, "承诺与表达清晰度"),
|
||||
new DimensionResponse("情绪", 82, "安抚与承接能力"),
|
||||
new DimensionResponse("营销", feeScenario ? 80 : 76, "政策解释与办理引导")
|
||||
new DimensionResponse("任务完成度", feeScenario ? 82 : 84, "SOP关键点覆盖;训练回退代理"),
|
||||
new DimensionResponse("话术规范性", 84, "承诺与表达清晰度;训练回退代理"),
|
||||
new DimensionResponse("情绪管理能力", 82, "安抚与承接能力;训练回退代理"),
|
||||
new DimensionResponse("响应时效", "待采集", "无真实回合耗时证据时不回填"),
|
||||
new DimensionResponse("增值转化潜力", feeScenario ? 80 : 76, "政策解释与办理引导;训练回退代理")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3998,10 +4000,11 @@ public class AihrPracticeSeedService {
|
||||
)
|
||||
),
|
||||
List.of(
|
||||
new DimensionResponse("合规", 84, "有升级路径"),
|
||||
new DimensionResponse("沟通", 88, "承诺清楚"),
|
||||
new DimensionResponse("情绪", 82, "先承接诉求"),
|
||||
new DimensionResponse("错题", "1条", "补费用争议")
|
||||
new DimensionResponse("任务完成度", 84, "有升级路径;训练回退代理"),
|
||||
new DimensionResponse("话术规范性", 86, "承诺清楚;训练回退代理"),
|
||||
new DimensionResponse("情绪管理能力", 82, "先承接诉求"),
|
||||
new DimensionResponse("响应时效", "待采集", "无真实回合耗时证据时不回填"),
|
||||
new DimensionResponse("增值转化潜力", 76, "训练回退代理")
|
||||
),
|
||||
86,
|
||||
"建议表达为:“我先确认责任人和到场时间,10 分钟内回复您;如果今天无法完成,我同步主管给您替代方案和下一次反馈时间。”",
|
||||
@@ -4032,10 +4035,11 @@ public class AihrPracticeSeedService {
|
||||
)
|
||||
),
|
||||
List.of(
|
||||
new DimensionResponse("合规", 80, "复核明确"),
|
||||
new DimensionResponse("沟通", 83, "拆分得当"),
|
||||
new DimensionResponse("情绪", 78, "安抚一般"),
|
||||
new DimensionResponse("错题", "2条", "补开场安抚")
|
||||
new DimensionResponse("任务完成度", 80, "复核明确;训练回退代理"),
|
||||
new DimensionResponse("话术规范性", 82, "拆分得当;训练回退代理"),
|
||||
new DimensionResponse("情绪管理能力", 78, "安抚一般"),
|
||||
new DimensionResponse("响应时效", "待采集", "无真实回合耗时证据时不回填"),
|
||||
new DimensionResponse("增值转化潜力", 80, "训练回退代理")
|
||||
),
|
||||
81,
|
||||
"建议先承接情绪:“您觉得服务不到位,我先把问题负责跟到底。”再说明缴费和整改并行,最后给出主管复核与反馈时间。",
|
||||
|
||||
+15
@@ -2,6 +2,7 @@ package org.dromara.aihr.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.dromara.aihr.domain.AihrPracticeDto.CompetencyResponse;
|
||||
import org.dromara.aihr.domain.AihrPracticeDto.DimensionResponse;
|
||||
import org.dromara.aihr.domain.AihrPracticeDto.FinishRequest;
|
||||
import org.dromara.aihr.domain.AihrPracticeDto.PracticeAssignmentRequest;
|
||||
import org.dromara.aihr.domain.AihrPracticeDto.ReviewAdviceRequest;
|
||||
@@ -131,6 +132,20 @@ public class AihrPracticeSeedServiceTest {
|
||||
assertTrue(result.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void seedFallbackScoresUseBrdFiveDimensions() throws Exception {
|
||||
AihrPracticeSeedService service = new AihrPracticeSeedService(new ObjectMapper(), null, null, null);
|
||||
Method method = AihrPracticeSeedService.class.getDeclaredMethod("defaultScores", String.class);
|
||||
method.setAccessible(true);
|
||||
|
||||
List<DimensionResponse> scores = (List<DimensionResponse>) method.invoke(service, "fee-collection");
|
||||
|
||||
assertEquals(List.of("任务完成度", "话术规范性", "情绪管理能力", "响应时效", "增值转化潜力"),
|
||||
scores.stream().map(DimensionResponse::label).toList());
|
||||
assertEquals("待采集", scores.get(3).value());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void supervisorAssignmentSourceIsServerOwned() throws Exception {
|
||||
String source = Files.readString(Path.of("src/main/java/org/dromara/aihr/service/AihrPracticeSeedService.java"));
|
||||
|
||||
Reference in New Issue
Block a user