chore: commit all changes (2025-11-04)

This commit is contained in:
irving
2025-11-04 22:00:31 -05:00
parent a8cdb27e8e
commit 0b7e86cfa3
4 changed files with 72 additions and 21 deletions

View File

@@ -55,4 +55,7 @@ public class PlayClerkLevelAddVo {
@ApiModelProperty(value = "非首次随机单比例", example = "65", notes = "非首次随机单提成比例范围0-100%")
private Integer notFirstRandomRadio;
@ApiModelProperty(value = "排序号", example = "1", notes = "越小的等级在列表越靠前")
private Long orderNumber;
}

View File

@@ -118,6 +118,9 @@ public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInf
}
playClerkLevelInfo.setCreatedTime(new Date());
playClerkLevelInfo.setStyleType(playClerkLevelInfo.getLevel());
if (playClerkLevelInfo.getOrderNumber() == null) {
playClerkLevelInfo.setOrderNumber(playClerkLevelInfo.getLevel().longValue());
}
return save(playClerkLevelInfo);
}

View File

@@ -1,20 +1,7 @@
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;
ALTER TABLE `play_clerk_level_info`
ADD COLUMN `order_number` BIGINT NULL COMMENT '等级排序号'
AFTER `style_image_url`;
UPDATE `play_clerk_level_info`
SET `order_number` = COALESCE(`order_number`, `level`);
SET `order_number` = `level`
WHERE `order_number` IS NULL;