提交 5d0ce452 authored 作者: 窦馨雨's avatar 窦馨雨

合并分支 'dxy' 到 'qa'

修改重客抽奖小程序,用户信息存储逻辑 查看合并请求 !110
package com.wangxiaolu.promotion.domain.lottery.dao.impl;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wangxiaolu.promotion.common.util.BeanUtils;
import com.wangxiaolu.promotion.domain.lottery.dao.LotteryCoreDao;
......@@ -13,7 +12,6 @@ import com.wangxiaolu.promotion.pojo.lottery.dto.LotteryRecordDto;
import com.wangxiaolu.promotion.pojo.lottery.dto.LotteryUserInfoDto;
import com.wangxiaolu.promotion.result.basedata.RCode;
import com.wangxiaolu.promotion.utils.TencentMapUtil;
import org.apache.poi.ss.formula.functions.Now;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -91,12 +89,15 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
}
if (Objects.nonNull(userInfo)) {
LotteryUserInfo user = lotteryUserInfoMapper.selectOne(new LambdaQueryWrapper<LotteryUserInfo>().eq(LotteryUserInfo::getOpenId, userInfo.getOpenId()));
if (Objects.isNull(user)) {
LotteryUserInfo lotteryUserInfo = new LotteryUserInfo();
lotteryUserInfo = BeanUtils.transitionDto(userInfo, LotteryUserInfo.class);
lotteryUserInfo.setOpenId(record.getWxOpenId());
lotteryUserInfoMapper.insert(lotteryUserInfo);
}
// 动态概率
int prizeLevel = simpleDynamicPrize();
record.setPrizeLevel(prizeLevel);
......@@ -126,4 +127,4 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
return 3;
}
}
}
\ No newline at end of file
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论