|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+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;
|
|
|
@@ -48,6 +49,7 @@ import java.util.Calendar;
|
|
|
import java.util.Collection;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -90,6 +92,9 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
|
|
|
@Autowired
|
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisCache redisCache;
|
|
|
+
|
|
|
private static Logger log = LoggerFactory.getLogger(UserBankRecordServiceImpl.class);
|
|
|
|
|
|
|
|
|
@@ -225,6 +230,12 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
|
|
|
if (Validator.isEmpty(recordPhoto)) {
|
|
|
throw new CustomException("拍照次数不达标", 559);
|
|
|
}
|
|
|
+ String key = "PERIOD_EXAM_Record:"+userBankRecordVo.getOrderGoodsId()+"-"+userBankRecordVo.getExamId();
|
|
|
+ Long keyStatus = redisCache.getCacheObject(key);
|
|
|
+ if(Validator.isNotEmpty(keyStatus)&&keyStatus==100L){
|
|
|
+ throw new CustomException("禁止频繁提交",667);
|
|
|
+ }
|
|
|
+ redisCache.setCacheObject(key, 100L,2, TimeUnit.SECONDS);
|
|
|
//增加一条审核记录
|
|
|
UserPeriod userPeriod = new UserPeriod();
|
|
|
userPeriod.setUserId(userBankRecordVo.getUserId());
|