Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
17fb0f36
提交
17fb0f36
authored
6月 23, 2026
作者:
吕本才
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(lottery): 修正抽奖奖品配置和中奖概率逻辑
1. 调整奖品列表顺序并补充注释说明下标对应关系 2. 更新中奖概率配置:一等奖10%、二等奖20%、三等奖40%、谢谢参与30% 3. 修正概率判断分支逻辑匹配新的奖品配置
上级
6724e4f0
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
4 行删除
+8
-4
WangxiaoluPromotionServiceApplication.java
...aolu/promotion/WangxiaoluPromotionServiceApplication.java
+0
-1
LotteryCoreDaoImpl.java
...promotion/domain/lottery/dao/impl/LotteryCoreDaoImpl.java
+8
-3
没有找到文件。
src/main/java/com/wangxiaolu/promotion/WangxiaoluPromotionServiceApplication.java
浏览文件 @
17fb0f36
...
@@ -3,7 +3,6 @@ package com.wangxiaolu.promotion;
...
@@ -3,7 +3,6 @@ package com.wangxiaolu.promotion;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
...
...
src/main/java/com/wangxiaolu/promotion/domain/lottery/dao/impl/LotteryCoreDaoImpl.java
浏览文件 @
17fb0f36
...
@@ -63,14 +63,16 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
...
@@ -63,14 +63,16 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
LotteryRecordDto
result
=
BeanUtils
.
transitionDto
(
record
,
LotteryRecordDto
.
class
);
LotteryRecordDto
result
=
BeanUtils
.
transitionDto
(
record
,
LotteryRecordDto
.
class
);
ArrayList
<
String
>
prizeList
=
new
ArrayList
<>();
ArrayList
<
String
>
prizeList
=
new
ArrayList
<>();
prizeList
.
add
(
"三等奖"
);
// 下标和抽奖返回的数值有关系,0:一等奖, 1:二等奖, 2:三等奖, -1:未中奖
prizeList
.
add
(
"一等奖"
);
prizeList
.
add
(
"一等奖"
);
prizeList
.
add
(
"二等奖"
);
prizeList
.
add
(
"二等奖"
);
prizeList
.
add
(
"三等奖"
);
prizeList
.
add
(
"三等奖"
);
prizeList
.
add
(
"
二等奖
"
);
prizeList
.
add
(
"
谢谢参与
"
);
prizeList
.
add
(
"三等奖"
);
prizeList
.
add
(
"三等奖"
);
prizeList
.
add
(
"二等奖"
);
prizeList
.
add
(
"二等奖"
);
prizeList
.
add
(
"三等奖"
);
prizeList
.
add
(
"三等奖"
);
prizeList
.
add
(
"谢谢参与"
);
result
.
setPrizes
(
prizeList
);
result
.
setPrizes
(
prizeList
);
return
result
;
return
result
;
...
@@ -135,12 +137,15 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
...
@@ -135,12 +137,15 @@ public class LotteryCoreDaoImpl implements LotteryCoreDao {
/**
/**
* 简单动态概率
* 简单动态概率
* 一等奖:10%,二等奖:20%,三等奖:40%,谢谢参与:30%
*/
*/
private
int
simpleDynamicPrize
()
{
private
int
simpleDynamicPrize
()
{
int
r
=
new
Random
().
nextInt
(
100
);
int
r
=
new
Random
().
nextInt
(
100
);
if
(
r
<
10
)
{
if
(
r
<
10
)
{
return
1
;
return
0
;
}
else
if
(
r
<
30
)
{
}
else
if
(
r
<
30
)
{
return
1
;
}
else
if
(
r
<
70
)
{
return
2
;
return
2
;
}
else
{
}
else
{
return
3
;
return
3
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论