提交 4a961de5 authored 作者: douxy's avatar douxy

修改重复抽奖判定

上级 95612f06
......@@ -87,22 +87,10 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
}
if (record.getWxOpenId() != null && record.getPrizeLevel() != null) {
}
LambdaQueryWrapper<LotteryRecord> qw = new LambdaQueryWrapper<>();
qw.eq(LotteryRecord::getWxOpenId,record.getWxOpenId());
qw.eq(LotteryRecord::getCreateDate,FORMAT.format(new Date()));
List<LotteryRecord> lotteryRecordList = lotteryMapper.selectList(qw);
if (CollectionUtils.isEmpty(lotteryRecordList)){
throw new ParamException(RCode.LOTTERY_RECORD_NOT_EXIST);
}
if (lotteryRecordList.size() > 1){
throw new ParamException(RCode.LOTTERY_RECORD_ERROR);
}else if (lotteryRecordList.get(0).getPrizeLevel() != null){
throw new ParamException(RCode.LOTTERY_RECORD_ERROR);
}
LotteryUserInfo user = lotteryUserInfoMapper.selectOne(new LambdaQueryWrapper<LotteryUserInfo>().eq(LotteryUserInfo::getOpenId, record.getWxOpenId()));
if (Objects.isNull(user)) {
LotteryUserInfo lotteryUserInfo = new LotteryUserInfo();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论