|
|
@@ -1065,13 +1065,16 @@ log.info("已添加template_id列到tasks表");
|
|
|
try {
|
|
|
insertActivitySeed("亲子户外徒步探险", "周末亲子徒步活动,在自然中锻炼体魄、增进亲子关系,全程约5公里。",
|
|
|
"body", "offline", "published",
|
|
|
- "2026-08-15 09:00:00", "2026-08-15 16:00:00", "北京奥林匹克森林公园", 50, 0, 0);
|
|
|
+ "2026-08-15 09:00:00", "2026-08-15 16:00:00", "北京奥林匹克森林公园", 50, 0, 0,
|
|
|
+ "{\"body\":80,\"mind\":0,\"wisdom\":0,\"action\":20,\"wealth\":0}");
|
|
|
insertActivitySeed("家庭正念静心工作坊", "专业导师带领的正念冥想体验,学习情绪调节和家庭沟通技巧。",
|
|
|
"mind", "offline", "published",
|
|
|
- "2026-08-22 14:00:00", "2026-08-22 17:00:00", "北京市朝阳区心理成长中心", 30, 9900, 7900);
|
|
|
+ "2026-08-22 14:00:00", "2026-08-22 17:00:00", "北京市朝阳区心理成长中心", 30, 9900, 7900,
|
|
|
+ "{\"body\":0,\"mind\":80,\"wisdom\":10,\"action\":10,\"wealth\":0}");
|
|
|
insertActivitySeed("少儿科学思维探索营", "通过动手实验激发孩子对科学的兴趣,培养逻辑思维与创造力。",
|
|
|
"wisdom", "online", "published",
|
|
|
- "2026-09-05 10:00:00", "2026-09-05 12:00:00", "线上直播", 200, 19900, 15900);
|
|
|
+ "2026-09-05 10:00:00", "2026-09-05 12:00:00", "线上直播", 200, 19900, 15900,
|
|
|
+ "{\"body\":0,\"mind\":0,\"wisdom\":70,\"action\":30,\"wealth\":0}");
|
|
|
log.info("Activity 种子数据已加载");
|
|
|
} catch (Exception e) {
|
|
|
log.warn("Activity 种子数据初始化失败: {}", e.getMessage());
|
|
|
@@ -4730,16 +4733,17 @@ try {
|
|
|
private void insertActivitySeed(String title, String desc, String dimensionCode,
|
|
|
String activityType, String status,
|
|
|
String startTime, String endTime, String location,
|
|
|
- int maxParticipants, int price, int memberPrice) {
|
|
|
+ int maxParticipants, int price, int memberPrice,
|
|
|
+ String dimensionWeights) {
|
|
|
Integer count = jdbcTemplate.queryForObject(
|
|
|
"SELECT COUNT(*) FROM activities WHERE title = ?", Integer.class, title);
|
|
|
if (count == null || count == 0) {
|
|
|
jdbcTemplate.update(
|
|
|
- "INSERT INTO activities (title, description, dimension_code, activity_type, status, " +
|
|
|
+ "INSERT INTO activities (title, description, dimension_code, dimension_weights, activity_type, status, " +
|
|
|
"start_time, end_time, location, max_participants, current_participants, price, member_price, " +
|
|
|
"require_registration, checkin_points, created_at, updated_at) " +
|
|
|
- "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, 1, 10, NOW(), NOW())",
|
|
|
- title, desc, dimensionCode, activityType, status,
|
|
|
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, 1, 10, NOW(), NOW())",
|
|
|
+ title, desc, dimensionCode, dimensionWeights, activityType, status,
|
|
|
startTime, endTime, location, maxParticipants, price, memberPrice);
|
|
|
}
|
|
|
}
|