|
|
@@ -59,6 +59,9 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
|
|
|
@Resource
|
|
|
private UserMapper userMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private PlatformPointsService platformPointsService;
|
|
|
+
|
|
|
public Result<Map<String, Object>> list(String dimensionCode, Integer page, Integer size, Long userId) {
|
|
|
autoEndExpiredActivities();
|
|
|
LambdaQueryWrapper<Activity> query = new LambdaQueryWrapper<Activity>()
|
|
|
@@ -373,6 +376,17 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
|
|
|
memberId, activityId, e.getMessage());
|
|
|
}
|
|
|
|
|
|
+ // 9b. 活动下发 CF 值(平台积分)
|
|
|
+ if (activity.getPlatformPoints() != null && activity.getPlatformPoints() > 0 && userId != null) {
|
|
|
+ try {
|
|
|
+ platformPointsService.earn(userId, activity.getPlatformPoints(),
|
|
|
+ "activity", activityId, "活动签到: " + activity.getTitle());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("活动CF值发放失败: userId={}, activityId={}, error={}",
|
|
|
+ userId, activityId, e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 10. Return result
|
|
|
result.put("taskId", task.getId());
|
|
|
result.put("pointsEarned", points);
|