|
@@ -23,6 +23,7 @@ import shop.alien.mapper.storePlantform.StoreOperationalActivitySignupMapper;
|
|
|
import shop.alien.store.config.BaseRedisService;
|
|
import shop.alien.store.config.BaseRedisService;
|
|
|
import shop.alien.store.dto.StoreOperationalActivitySignupDto;
|
|
import shop.alien.store.dto.StoreOperationalActivitySignupDto;
|
|
|
import shop.alien.store.service.StoreOperationalActivityService;
|
|
import shop.alien.store.service.StoreOperationalActivityService;
|
|
|
|
|
+import shop.alien.util.common.DateUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -271,11 +272,11 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
if (status == null || (status != 2 && status != 5)) {
|
|
if (status == null || (status != 2 && status != 5)) {
|
|
|
throw new IllegalArgumentException("活动状态不允许报名");
|
|
throw new IllegalArgumentException("活动状态不允许报名");
|
|
|
}
|
|
}
|
|
|
- Date now = new Date();
|
|
|
|
|
- if (activity.getSignupStartTime() != null && now.before(activity.getSignupStartTime())) {
|
|
|
|
|
|
|
+ Date nowDay = DateUtils.toDateOnly(new Date());
|
|
|
|
|
+ if (activity.getSignupStartTime() != null && nowDay.before(DateUtils.toDateOnly(activity.getSignupStartTime()))) {
|
|
|
throw new IllegalArgumentException("未到报名时间");
|
|
throw new IllegalArgumentException("未到报名时间");
|
|
|
}
|
|
}
|
|
|
- if (activity.getSignupEndTime() != null && now.after(activity.getSignupEndTime())) {
|
|
|
|
|
|
|
+ if (activity.getSignupEndTime() != null && nowDay.after(DateUtils.toDateOnly(activity.getSignupEndTime()))) {
|
|
|
throw new IllegalArgumentException("报名已结束");
|
|
throw new IllegalArgumentException("报名已结束");
|
|
|
}
|
|
}
|
|
|
// if (activity.getStartTime() != null && status == 5 && now.before(activity.getStartTime())) {
|
|
// if (activity.getStartTime() != null && status == 5 && now.before(activity.getStartTime())) {
|
|
@@ -376,13 +377,13 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
if (activity == null) {
|
|
if (activity == null) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- Date now = new Date();
|
|
|
|
|
- Date start = activity.getSignupStartTime();
|
|
|
|
|
- Date end = activity.getSignupEndTime();
|
|
|
|
|
- if (start != null && now.before(start)) {
|
|
|
|
|
|
|
+ Date nowDay = DateUtils.toDateOnly(new Date());
|
|
|
|
|
+ Date start = DateUtils.toDateOnly(activity.getSignupStartTime());
|
|
|
|
|
+ Date end = DateUtils.toDateOnly(activity.getSignupEndTime());
|
|
|
|
|
+ if (start != null && nowDay.before(start)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (end != null && now.after(end)) {
|
|
|
|
|
|
|
+ if (end != null && nowDay.after(end)) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
@@ -392,11 +393,11 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
if (activity == null) {
|
|
if (activity == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- Date now = new Date();
|
|
|
|
|
|
|
+ Date nowDay = DateUtils.toDateOnly(new Date());
|
|
|
if (activity.getStatus() != null && activity.getStatus() == 7) {
|
|
if (activity.getStatus() != null && activity.getStatus() == 7) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
- if (activity.getEndTime() != null && now.after(activity.getEndTime())) {
|
|
|
|
|
|
|
+ if (activity.getEndTime() != null && nowDay.after(DateUtils.toDateOnly(activity.getEndTime()))) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
Integer status = activity.getStatus();
|
|
Integer status = activity.getStatus();
|
|
@@ -404,10 +405,10 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|
|
|
if (signupStatus != null && signupStatus == 2
|
|
if (signupStatus != null && signupStatus == 2
|
|
|
- && activity.getStartTime() != null && now.before(activity.getStartTime())) {
|
|
|
|
|
|
|
+ && activity.getStartTime() != null && nowDay.before(DateUtils.toDateOnly(activity.getStartTime()))) {
|
|
|
return 2;
|
|
return 2;
|
|
|
}
|
|
}
|
|
|
- if (activity.getSignupEndTime() != null && now.after(activity.getSignupEndTime())) {
|
|
|
|
|
|
|
+ if (activity.getSignupEndTime() != null && nowDay.after(DateUtils.toDateOnly(activity.getSignupEndTime()))) {
|
|
|
if (status != null && status == 5 && signupStatus != null && signupStatus == 2) {
|
|
if (status != null && status == 5 && signupStatus != null && signupStatus == 2) {
|
|
|
return 3;
|
|
return 3;
|
|
|
}
|
|
}
|
|
@@ -421,7 +422,7 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
return 4;
|
|
return 4;
|
|
|
}
|
|
}
|
|
|
if (signupStatus == 1) {
|
|
if (signupStatus == 1) {
|
|
|
- if (activity.getSignupEndTime() != null && now.before(activity.getSignupEndTime())) {
|
|
|
|
|
|
|
+ if (activity.getSignupEndTime() != null && nowDay.before(DateUtils.toDateOnly(activity.getSignupEndTime()))) {
|
|
|
return 5;
|
|
return 5;
|
|
|
}
|
|
}
|
|
|
return 1;
|
|
return 1;
|
|
@@ -467,14 +468,14 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
if (item == null) {
|
|
if (item == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- Date now = new Date();
|
|
|
|
|
|
|
+ Date nowDay = DateUtils.toDateOnly(new Date());
|
|
|
Integer activityStatus = item.getActivityStatus();
|
|
Integer activityStatus = item.getActivityStatus();
|
|
|
boolean hasAchievement = item.getHasAchievement() != null && item.getHasAchievement() == 1;
|
|
boolean hasAchievement = item.getHasAchievement() != null && item.getHasAchievement() == 1;
|
|
|
Integer auditStatus = item.getSignupAuditStatus();
|
|
Integer auditStatus = item.getSignupAuditStatus();
|
|
|
Date startTime = item.getStartTime();
|
|
Date startTime = item.getStartTime();
|
|
|
Date endTime = item.getEndTime();
|
|
Date endTime = item.getEndTime();
|
|
|
boolean ended = (activityStatus != null && (activityStatus == 7 || activityStatus == 6))
|
|
boolean ended = (activityStatus != null && (activityStatus == 7 || activityStatus == 6))
|
|
|
- || (endTime != null && now.after(endTime));
|
|
|
|
|
|
|
+ || (endTime != null && nowDay.after(DateUtils.toDateOnly(endTime)));
|
|
|
if (ended) {
|
|
if (ended) {
|
|
|
return hasAchievement ? 2 : 1;
|
|
return hasAchievement ? 2 : 1;
|
|
|
}
|
|
}
|
|
@@ -490,7 +491,7 @@ public class StoreOperationalActivityServiceImpl implements StoreOperationalActi
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (auditStatus != null && auditStatus == 0
|
|
if (auditStatus != null && auditStatus == 0
|
|
|
- && startTime != null && now.before(startTime)) {
|
|
|
|
|
|
|
+ && startTime != null && nowDay.before(DateUtils.toDateOnly(startTime))) {
|
|
|
return 7;
|
|
return 7;
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|