|
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.Page;
|
|
|
+import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
@@ -67,6 +68,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -126,7 +128,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
@Autowired
|
|
|
private IUserSubscribeService iUserSubscribeService;
|
|
|
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private RedisCache redisCache;
|
|
|
|
|
|
@Override
|
|
|
public CourseVo queryById(Long courseId){
|
|
|
@@ -381,6 +384,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
if(Validator.isEmpty(bo.getGradeId())||Validator.isEmpty(bo.getUserId())||Validator.isEmpty(bo.getOrderGoodsId())){
|
|
|
throw new CustomException("参数错误");
|
|
|
}
|
|
|
+ String key = "EDIT_REBUILD_Record:"+bo.getOrderGoodsId()+"-"+bo.getUserId();
|
|
|
+ Long keyStatus = redisCache.getCacheObject(key);
|
|
|
+ if(Validator.isNotEmpty(keyStatus)&&keyStatus==100L){
|
|
|
+ throw new CustomException("禁止频繁提交",667);
|
|
|
+ }
|
|
|
+ redisCache.setCacheObject(key, 100L,5, TimeUnit.SECONDS);
|
|
|
//将该班级下的学员作弊的节改成待重修
|
|
|
List<GoodsPeriodStatusVo> goodsPeriodStatusVos = baseMapper.listSection(bo);
|
|
|
for (GoodsPeriodStatusVo goodsPeriodStatusVo : goodsPeriodStatusVos) {
|