|
|
@@ -10,6 +10,7 @@ import shop.alien.entity.store.StoreInfo;
|
|
|
import shop.alien.entity.storePlatform.StoreOperationalActivity;
|
|
|
import shop.alien.entity.storePlatform.StoreOperationalActivitySignup;
|
|
|
import shop.alien.entity.storePlatform.vo.StoreOperationalActivityDetailVo;
|
|
|
+import shop.alien.entity.storePlatform.vo.StoreOperationalActivityMySignupVo;
|
|
|
import shop.alien.entity.storePlatform.vo.StoreOperationalActivitySignupCheckVo;
|
|
|
import shop.alien.mapper.LifeDiscountCouponMapper;
|
|
|
import shop.alien.mapper.StoreImgMapper;
|
|
|
@@ -23,7 +24,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import shop.alien.util.common.JwtUtil;
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 用户端运营活动服务实现
|
|
|
@@ -102,6 +105,24 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public List<StoreOperationalActivityMySignupVo> listMySignups(Integer userId) {
|
|
|
+ if (userId == null) {
|
|
|
+ throw new IllegalArgumentException("用户ID不能为空");
|
|
|
+ }
|
|
|
+ List<StoreOperationalActivityMySignupVo> list = signupMapper.selectMySignups(userId);
|
|
|
+ if (list == null || list.isEmpty()) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ for (StoreOperationalActivityMySignupVo item : list) {
|
|
|
+ if (item == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ item.setStatusLabel(resolveSignupStatusLabel(item.getSignupStatus(), item.getActivityStatus()));
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public boolean signup(StoreOperationalActivitySignupDto dto) {
|
|
|
if (dto == null) {
|
|
|
throw new IllegalArgumentException("报名参数不能为空");
|
|
|
@@ -246,4 +267,28 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
Integer signupCount = signupMapper.countSignedUpByActivityAndUser(activity.getId(), currentUserId);
|
|
|
vo.setSignedUp(signupCount != null && signupCount > 0);
|
|
|
}
|
|
|
+
|
|
|
+ private String resolveSignupStatusLabel(Integer signupStatus, Integer activityStatus) {
|
|
|
+ if (signupStatus == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (signupStatus == 0) {
|
|
|
+ return "审核中";
|
|
|
+ }
|
|
|
+ if (signupStatus == 1) {
|
|
|
+ return "报名已拒绝";
|
|
|
+ }
|
|
|
+ if (signupStatus == 2) {
|
|
|
+ if (activityStatus != null) {
|
|
|
+ if (activityStatus == 5) {
|
|
|
+ return "活动已开始";
|
|
|
+ }
|
|
|
+ if (activityStatus == 7) {
|
|
|
+ return "活动已结束";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "报名成功";
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|