Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
6da8849e
Commit
6da8849e
authored
Nov 25, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序增加奖品列表,转盘游戏返回对象增加奖品列表
parent
0950b7ac
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
6 deletions
+81
-6
PrizeController.java
...ain/java/share/web/controller/system/PrizeController.java
+35
-0
WheelGameController.java
...java/share/web/controller/system/WheelGameController.java
+6
-6
WheelGameVo.java
...tem/src/main/java/share/system/domain/vo/WheelGameVo.java
+12
-0
WheelGameService.java
.../src/main/java/share/system/service/WheelGameService.java
+3
-0
WheelGameServiceImpl.java
.../java/share/system/service/impl/WheelGameServiceImpl.java
+25
-0
No files found.
share-front/src/main/java/share/web/controller/system/PrizeController.java
0 → 100644
View file @
6da8849e
package
share
.
web
.
controller
.
system
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.R
;
import
share.system.domain.vo.PrizeVo
;
import
share.system.service.PrizeService
;
import
java.util.List
;
/**
* 奖品Controller
*
* @author wuwenlong
* @date 2024-11-12
*/
@RestController
@RequestMapping
(
"/prize"
)
public
class
PrizeController
extends
BaseController
{
@Autowired
private
PrizeService
prizeService
;
/**
* 查询奖品列表
*/
@GetMapping
(
"/list"
)
public
R
<
List
<
PrizeVo
>>
list
(
PrizeVo
prize
)
{
List
<
PrizeVo
>
list
=
prizeService
.
selectPrizeList
(
prize
);
return
R
.
ok
(
list
);
}
}
share-front/src/main/java/share/web/controller/system/WheelGameController.java
View file @
6da8849e
...
...
@@ -5,10 +5,11 @@ import org.springframework.web.bind.annotation.*;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.
page.TableDataInfo
;
import
share.common.core.
domain.R
;
import
share.common.enums.BusinessType
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.WheelGame
;
import
share.system.domain.vo.WheelGameVo
;
import
share.system.service.WheelGameService
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -29,11 +30,10 @@ public class WheelGameController extends BaseController {
/**
* 查询转盘游戏列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
WheelGame
wheelGame
)
{
startPage
();
List
<
WheelGame
>
list
=
wheelGameService
.
selectWheelGameList
(
wheelGame
);
return
getDataTable
(
list
);
@GetMapping
(
"/query"
)
public
R
<
List
<
WheelGameVo
>>
query
(
WheelGame
wheelGame
)
{
List
<
WheelGameVo
>
list
=
wheelGameService
.
query
(
wheelGame
);
return
R
.
ok
(
list
);
}
/**
...
...
share-system/src/main/java/share/system/domain/vo/WheelGameVo.java
0 → 100644
View file @
6da8849e
package
share
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
share.system.domain.Prize
;
import
share.system.domain.WheelGame
;
import
java.util.List
;
@Data
public
class
WheelGameVo
extends
WheelGame
{
private
List
<
Prize
>
prizeList
;
}
share-system/src/main/java/share/system/service/WheelGameService.java
View file @
6da8849e
...
...
@@ -3,6 +3,7 @@ package share.system.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.Prize
;
import
share.system.domain.WheelGame
;
import
share.system.domain.vo.WheelGameVo
;
import
java.util.List
;
...
...
@@ -29,6 +30,8 @@ public interface WheelGameService extends IService<WheelGame> {
*/
public
List
<
WheelGame
>
selectWheelGameList
(
WheelGame
wheelGame
);
public
List
<
WheelGameVo
>
query
(
WheelGame
wheelGame
);
/**
* 新增转盘游戏
*
...
...
share-system/src/main/java/share/system/service/impl/WheelGameServiceImpl.java
View file @
6da8849e
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.RandomUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -17,6 +18,7 @@ import share.common.enums.YesNoEnum;
import
share.common.exception.base.BaseException
;
import
share.common.utils.DateUtils
;
import
share.system.domain.*
;
import
share.system.domain.vo.WheelGameVo
;
import
share.system.mapper.WheelGameMapper
;
import
share.system.service.*
;
...
...
@@ -73,6 +75,17 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
return
wheelGameMapper
.
selectWheelGameList
(
wheelGame
);
}
@Override
public
List
<
WheelGameVo
>
query
(
WheelGame
wheelGame
)
{
List
<
WheelGame
>
wheelGames
=
wheelGameMapper
.
selectWheelGameList
(
wheelGame
);
List
<
WheelGameVo
>
wheelGameVos
=
convertDoListToVoList
(
wheelGames
);
List
<
Prize
>
list
=
prizeService
.
list
();
wheelGameVos
.
stream
().
forEach
(
item
->
{
item
.
setPrizeList
(
list
.
stream
().
filter
(
prize
->
prize
.
getGameId
().
equals
(
item
.
getId
())).
collect
(
Collectors
.
toList
()));
});
return
wheelGameVos
;
}
/**
* 新增转盘游戏
*
...
...
@@ -319,4 +332,16 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
redisUtil
.
unLock
(
Constants
.
LOTTERY_LOCK_KEY
+
gameId
,
keyValue
,
2
);
}
}
public
List
<
WheelGameVo
>
convertDoListToVoList
(
List
<
WheelGame
>
gameList
)
{
List
<
WheelGameVo
>
voList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
gameList
))
{
gameList
.
stream
().
forEach
(
o
->
{
WheelGameVo
vo
=
new
WheelGameVo
();
BeanUtils
.
copyProperties
(
o
,
vo
);
voList
.
add
(
vo
);
});
}
return
voList
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment