|
|
@@ -9125,6 +9125,22 @@ private void runMigration100() {
|
|
|
log.warn("初始化sys_menu种子数据失败: " + e.getMessage());
|
|
|
}
|
|
|
|
|
|
+ // 迁移245: product_skus 存量价格 ×100(元→分),sys_config 幂等标记
|
|
|
+ try {
|
|
|
+ Integer migrated = jdbcTemplate.queryForObject(
|
|
|
+ "SELECT COUNT(*) FROM sys_config WHERE config_key = 'sku_price_to_cents_done'",
|
|
|
+ Integer.class);
|
|
|
+ if (migrated == null || migrated == 0) {
|
|
|
+ jdbcTemplate.update("UPDATE product_skus SET price = IFNULL(price, 0) * 100, original_price = IFNULL(original_price, 0) * 100");
|
|
|
+ jdbcTemplate.update("INSERT INTO sys_config (config_key, config_value, description) VALUES ('sku_price_to_cents_done', '1', 'SKU价格已迁移为分单位')");
|
|
|
+ log.info("迁移245: product_skus 价格已×100(元→分)");
|
|
|
+ } else {
|
|
|
+ log.info("迁移245: product_skus 价格已迁移过,跳过");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("迁移245失败: {}", e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|