fix(practice): restore scenario content updates

This commit is contained in:
2026-07-25 13:39:23 +08:00
parent 2b3c37677d
commit 7ced39b03b
4 changed files with 13 additions and 1 deletions
@@ -504,7 +504,7 @@ public class AihrPracticeSeedService {
customer_persona, opening_text, explicit_need, hidden_need, irritants, delights, sop_refs,
success_criteria, strategy, goal, trainee_name, trust_start, trust_end, rounds_json, content_version, content_hash,
enabled, sort_order, create_time, update_time)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '张三', 60, 80, ?, ?, ?, ?, 100, ?, ?)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '张三', 60, 80, ?, ?, ?, ?, 100, ?, ?)
ON DUPLICATE KEY UPDATE
scenario_name = VALUES(scenario_name),
position = VALUES(position),
@@ -201,6 +201,16 @@ public class AihrPracticeSeedServiceTest {
assertTrue(migration.contains("repair-leak-followup"));
}
@Test
public void scenarioUpsertKeepsAllValuePlaceholders() throws Exception {
String source = Files.readString(Path.of("src/main/java/org/dromara/aihr/service/AihrPracticeSeedService.java"));
int insertStart = source.indexOf("INSERT INTO aihr_practice_scenario");
int updateStart = source.indexOf("ON DUPLICATE KEY UPDATE", insertStart);
String insertSql = source.substring(insertStart, updateStart);
assertEquals(29, insertSql.chars().filter(value -> value == '?').count());
}
@Test
public void batchAssignmentUsesPerEmployeeTransactionsAndDatabaseIdempotency() throws Exception {
String serviceSource = Files.readString(Path.of("src/main/java/org/dromara/aihr/service/AihrPracticeSeedService.java"));