新增店员等级排序功能
Some checks failed
Build and Push Backend / docker (push) Failing after 6s

- 添加数据库迁移脚本,为 play_clerk_level_info 表新增 order_number 字段
- 更新测试数据种子,设置默认等级的排序号
- 新增店员用户API测试,验证按等级排序号和在线状态的排序逻辑
This commit is contained in:
irving
2025-11-04 21:20:42 -05:00
parent d961e62cc2
commit a8cdb27e8e
3 changed files with 343 additions and 0 deletions

View File

@@ -259,6 +259,7 @@ public class ApiTestDataSeeder implements CommandLineRunner {
entity.setNotFirstRandomRadio(45);
entity.setFirstRewardRatio(40);
entity.setNotFirstRewardRatio(35);
entity.setOrderNumber(1L);
clerkLevelInfoService.save(entity);
log.info("Inserted API test clerk level {}", DEFAULT_CLERK_LEVEL_ID);
}

View File

@@ -0,0 +1,20 @@
SET @column_exists := (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'play_clerk_level_info'
AND COLUMN_NAME = 'order_number'
);
SET @ddl := IF(
@column_exists = 0,
'ALTER TABLE `play_clerk_level_info` ADD COLUMN `order_number` bigint NULL COMMENT ''等级排序号''',
'SELECT 1'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
UPDATE `play_clerk_level_info`
SET `order_number` = COALESCE(`order_number`, `level`);