fix(aihr): bind assignment completion to session
This commit is contained in:
+1
-1
@@ -656,7 +656,7 @@ public class AihrPracticeSeedService {
|
||||
String extPartyId = activeSession == null ? trainee : activeSession.extPartyId();
|
||||
RecordResponse record = new RecordResponse(null, sessionId, formatNow(), trainee, scenario.name(), result.total(), "待复盘", result.summary(), extPartyId);
|
||||
savePracticeRecord(sessionId, activeSession, scenario, record, result);
|
||||
markAssignmentCompleted(request == null ? null : request.assignmentId(), activeSession);
|
||||
markAssignmentCompleted(activeSession == null ? null : activeSession.assignmentId(), activeSession);
|
||||
return new FinishResponse(
|
||||
result.total(),
|
||||
result.scores(),
|
||||
|
||||
+7
@@ -149,6 +149,13 @@ public class AihrPracticeSeedServiceTest {
|
||||
assertTrue(method.contains("训练任务场景与请求不一致"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void finishUsesAssignmentBoundToActiveSession() throws Exception {
|
||||
String source = Files.readString(Path.of("src/main/java/org/dromara/aihr/service/AihrPracticeSeedService.java"));
|
||||
assertTrue(source.contains("markAssignmentCompleted(activeSession == null ? null : activeSession.assignmentId(), activeSession)"));
|
||||
assertFalse(source.contains("markAssignmentCompleted(request == null ? null : request.assignmentId(), activeSession)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mobilePracticeSessionRejectsForeignAndUnknownOwner() {
|
||||
JdbcTemplate jdbcTemplate = mock(JdbcTemplate.class);
|
||||
|
||||
Reference in New Issue
Block a user