|
@@ -14,6 +14,7 @@ import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
+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;
|
|
@@ -79,6 +80,7 @@ import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -146,7 +148,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
|
|
|
private IGoodsQuestionRelService iGoodsQuestionRelService;
|
|
|
@Autowired
|
|
|
private IQuestionMerchantService iQuestionMerchantService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private RedisCache redisCache;
|
|
|
|
|
|
|
|
|
|
|
@@ -403,6 +406,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) {
|