Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
3a4fe055
提交
3a4fe055
authored
5月 13, 2026
作者:
窦馨雨
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dxy' 到 'qa'
增加抽奖记录获取功能 查看合并请求
!126
上级
b762ebe1
f8d704cf
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
40 行增加
和
13 行删除
+40
-13
LotteryController.java
...iaolu/promotion/controller/lottery/LotteryController.java
+6
-0
LotteryCoreDao.java
...ngxiaolu/promotion/domain/lottery/dao/LotteryCoreDao.java
+4
-0
LotteryCoreDaoImpl.java
...promotion/domain/lottery/dao/impl/LotteryCoreDaoImpl.java
+18
-13
LotteryCoreService.java
...gxiaolu/promotion/service/lottery/LotteryCoreService.java
+4
-0
LotteryCoreServiceImpl.java
...romotion/service/lottery/impl/LotteryCoreServiceImpl.java
+8
-0
没有找到文件。
src/main/java/com/wangxiaolu/promotion/controller/lottery/LotteryController.java
浏览文件 @
3a4fe055
...
@@ -41,4 +41,9 @@ public class LotteryController {
...
@@ -41,4 +41,9 @@ public class LotteryController {
public
R
getLotteryUserInfo
(
@RequestBody
LotteryRecordVo
lotteryRecordVo
)
{
public
R
getLotteryUserInfo
(
@RequestBody
LotteryRecordVo
lotteryRecordVo
)
{
return
R
.
success
(
lotteryService
.
getLotteryUserInfo
(
lotteryRecordVo
.
getWxOpenId
()));
return
R
.
success
(
lotteryService
.
getLotteryUserInfo
(
lotteryRecordVo
.
getWxOpenId
()));
}
}
@PostMapping
(
"/getRecordInfo"
)
public
R
getLotteryRecordInfo
(
@RequestBody
LotteryRecordVo
lotteryRecordVo
)
{
return
R
.
success
(
lotteryService
.
getLotteryRecordInfo
(
lotteryRecordVo
.
getWxOpenId
()));
}
}
}
\ No newline at end of file
src/main/java/com/wangxiaolu/promotion/domain/lottery/dao/LotteryCoreDao.java
浏览文件 @
3a4fe055
...
@@ -4,6 +4,8 @@ import com.wangxiaolu.promotion.domain.lottery.entity.LotteryUserInfo;
...
@@ -4,6 +4,8 @@ import com.wangxiaolu.promotion.domain.lottery.entity.LotteryUserInfo;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryRecordDto
;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryRecordDto
;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryUserInfoDto
;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryUserInfoDto
;
import
java.util.List
;
/**
/**
* @Author: DouXinYu
* @Author: DouXinYu
* @Date: 2026-04-07 17:41
* @Date: 2026-04-07 17:41
...
@@ -15,4 +17,6 @@ public interface LotteryCoreDao {
...
@@ -15,4 +17,6 @@ public interface LotteryCoreDao {
LotteryRecordDto
initLottery
(
Double
longitude
,
Double
latitude
,
String
receiptImage
,
String
wxOpenId
);
LotteryRecordDto
initLottery
(
Double
longitude
,
Double
latitude
,
String
receiptImage
,
String
wxOpenId
);
LotteryUserInfoDto
getLotteryUserInfo
(
String
wxOpenId
);
LotteryUserInfoDto
getLotteryUserInfo
(
String
wxOpenId
);
List
<
LotteryRecordDto
>
getLotteryRecordInfo
(
String
wxOpenId
);
}
}
src/main/java/com/wangxiaolu/promotion/domain/lottery/dao/impl/LotteryCoreDaoImpl.java
浏览文件 @
3a4fe055
...
@@ -87,22 +87,10 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
...
@@ -87,22 +87,10 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
}
}
if
(
record
.
getWxOpenId
()
!=
null
&&
record
.
getPrizeLevel
()
!=
null
)
{
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
);
throw
new
ParamException
(
RCode
.
LOTTERY_RECORD_ERROR
);
}
}
LotteryUserInfo
user
=
lotteryUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
LotteryUserInfo
>().
eq
(
LotteryUserInfo:
:
getOpenId
,
record
.
getWxOpenId
()));
LotteryUserInfo
user
=
lotteryUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
LotteryUserInfo
>().
eq
(
LotteryUserInfo:
:
getOpenId
,
record
.
getWxOpenId
()));
if
(
Objects
.
isNull
(
user
))
{
if
(
Objects
.
isNull
(
user
))
{
LotteryUserInfo
lotteryUserInfo
=
new
LotteryUserInfo
();
LotteryUserInfo
lotteryUserInfo
=
new
LotteryUserInfo
();
...
@@ -128,6 +116,23 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
...
@@ -128,6 +116,23 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
return
BeanUtils
.
transitionDto
(
lotteryUserInfo
,
LotteryUserInfoDto
.
class
);
return
BeanUtils
.
transitionDto
(
lotteryUserInfo
,
LotteryUserInfoDto
.
class
);
}
}
/**
* 获取抽奖记录详情
* @param wxOpenId 微信openid
* @return 抽奖记录详情
*/
@Override
public
List
<
LotteryRecordDto
>
getLotteryRecordInfo
(
String
wxOpenId
)
{
LambdaQueryWrapper
<
LotteryRecord
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
LotteryRecord:
:
getWxOpenId
,
wxOpenId
);
queryWrapper
.
isNotNull
(
LotteryRecord:
:
getPrizeLevel
);
queryWrapper
.
orderByDesc
(
LotteryRecord:
:
getId
);
queryWrapper
.
last
(
"limit 100"
);
List
<
LotteryRecord
>
lotteryRecordList
=
lotteryMapper
.
selectList
(
queryWrapper
);
return
BeanUtils
.
transitionDtos
(
lotteryRecordList
,
LotteryRecordDto
.
class
);
}
/**
/**
* 简单动态概率
* 简单动态概率
*/
*/
...
...
src/main/java/com/wangxiaolu/promotion/service/lottery/LotteryCoreService.java
浏览文件 @
3a4fe055
...
@@ -3,6 +3,8 @@ package com.wangxiaolu.promotion.service.lottery;
...
@@ -3,6 +3,8 @@ package com.wangxiaolu.promotion.service.lottery;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryRecordDto
;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryRecordDto
;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryUserInfoDto
;
import
com.wangxiaolu.promotion.pojo.lottery.dto.LotteryUserInfoDto
;
import
java.util.List
;
/**
/**
* @Author: DouXinYu
* @Author: DouXinYu
* @Date: 2026-04-07 17:38
* @Date: 2026-04-07 17:38
...
@@ -12,4 +14,6 @@ public interface LotteryCoreService {
...
@@ -12,4 +14,6 @@ public interface LotteryCoreService {
LotteryRecordDto
initLottery
(
Double
longitude
,
Double
latitude
,
String
receiptImage
,
String
wxOpenId
);
LotteryRecordDto
initLottery
(
Double
longitude
,
Double
latitude
,
String
receiptImage
,
String
wxOpenId
);
LotteryRecordDto
doDraw
(
Long
recordId
,
LotteryUserInfoDto
userInfo
);
LotteryRecordDto
doDraw
(
Long
recordId
,
LotteryUserInfoDto
userInfo
);
List
<
LotteryRecordDto
>
getLotteryRecordInfo
(
String
wxOpenId
);
}
}
src/main/java/com/wangxiaolu/promotion/service/lottery/impl/LotteryCoreServiceImpl.java
浏览文件 @
3a4fe055
...
@@ -13,6 +13,7 @@ import com.wangxiaolu.promotion.service.lottery.LotteryCoreService;
...
@@ -13,6 +13,7 @@ import com.wangxiaolu.promotion.service.lottery.LotteryCoreService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Random
;
import
java.util.Random
;
@Service
@Service
...
@@ -55,7 +56,13 @@ public class LotteryCoreServiceImpl implements LotteryCoreService {
...
@@ -55,7 +56,13 @@ public class LotteryCoreServiceImpl implements LotteryCoreService {
return
lotteryCoreDao
.
doDraw
(
recordId
,
userInfo
);
return
lotteryCoreDao
.
doDraw
(
recordId
,
userInfo
);
}
}
public
LotteryUserInfoDto
getLotteryUserInfo
(
String
wxOpenId
)
{
public
LotteryUserInfoDto
getLotteryUserInfo
(
String
wxOpenId
)
{
return
lotteryCoreDao
.
getLotteryUserInfo
(
wxOpenId
);
return
lotteryCoreDao
.
getLotteryUserInfo
(
wxOpenId
);
}
}
@Override
public
List
<
LotteryRecordDto
>
getLotteryRecordInfo
(
String
wxOpenId
)
{
return
lotteryCoreDao
.
getLotteryRecordInfo
(
wxOpenId
);
}
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论