Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
0935422c
Commit
0935422c
authored
Jul 23, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature-reward:增删改分页查询基础功能
parent
8526f66c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
20 deletions
+82
-20
RewardServiceImpl.java
...yudao/module/reward/service/reward/RewardServiceImpl.java
+42
-12
SwaggerRewardConfiguration.java
...d/controller/admin/config/SwaggerRewardConfiguration.java
+27
-0
RewardController.java
...dule/reward/controller/admin/reward/RewardController.java
+8
-8
pom.xml
yudao-server/pom.xml
+5
-0
No files found.
yudao-module-reward/yudao-module-reward-api/src/main/java/cn/iocoder/yudao/module/reward/service/reward/RewardServiceImpl.java
View file @
0935422c
...
...
@@ -76,19 +76,49 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
@Override
public
PageResult
<
RewardDO
>
getPage
(
RewardQueryVO
query
,
PageVO
page
)
{
PageResult
<
RewardDO
>
rewardDOPageResult
=
rewardMapper
.
selectPage
(
page
,
new
LambdaQuery
<
RewardDO
>()
.
eqIfPresent
(
RewardDO:
:
getCode
,
query
.
getCode
())
.
eqIfPresent
(
RewardDO:
:
getTitleZh
,
query
.
getTitle
())
.
eqIfPresent
(
RewardDO:
:
getTitleEn
,
query
.
getTitle
())
.
eqIfPresent
(
RewardDO:
:
getTitleFr
,
query
.
getTitle
())
.
eqIfPresent
(
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
eqIfPresent
(
RewardDO:
:
getNodeId
,
query
.
getNodeId
())
.
eqIfPresent
(
RewardDO:
:
getQuantityRemain
,
query
.
getQuantityRemain
())
LambdaQuery
<
RewardDO
>
lambdaQuery
=
new
LambdaQuery
<>();
//礼品ID
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getCode
,
query
.
getCode
());
//礼品名称,模糊匹配三种语言
if
(
query
.
getTitle
()
!=
null
)
{
lambdaQuery
.
and
(
wrapper
->
wrapper
.
like
(
RewardDO:
:
getTitleZh
,
query
.
getTitle
())
.
or
()
.
like
(
RewardDO:
:
getTitleEn
,
query
.
getTitle
())
.
or
()
.
like
(
RewardDO:
:
getTitleFr
,
query
.
getTitle
())
);
}
//兑换积分
if
(
query
.
getPointsRequireSymbol
()
!=
null
&&
query
.
getPointsRequire
()
!=
null
)
{
lambdaQuery
.
gt
(
query
.
getPointsRequireSymbol
()
==
1
,
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
eq
(
query
.
getPointsRequireSymbol
()
==
2
,
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
lt
(
query
.
getPointsRequireSymbol
()
==
3
,
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
());
}
//兑换网点id,领取方式,状态
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getNodeId
,
query
.
getNodeId
())
.
eqIfPresent
(
RewardDO:
:
getPickMethod
,
query
.
getPickMethod
())
.
eqIfPresent
(
RewardDO:
:
getStatus
,
query
.
getStatus
())
.
betweenIfPresent
(
RewardDO:
:
getCreateTime
,
query
.
getBeginCreateTime
(),
query
.
getEndCreateTime
())
.
orderByDesc
(
RewardDO:
:
getId
));
return
rewardDOPageResult
;
.
eqIfPresent
(
RewardDO:
:
getStatus
,
query
.
getStatus
());
//备注,模糊匹配三种语言
if
(
query
.
getRemark
()
!=
null
)
{
lambdaQuery
.
and
(
wrapper
->
wrapper
.
like
(
RewardDO:
:
getRemarkZh
,
query
.
getRemark
())
.
or
()
.
like
(
RewardDO:
:
getRemarkEn
,
query
.
getRemark
())
.
or
()
.
like
(
RewardDO:
:
getRemarkFr
,
query
.
getRemark
())
);
}
//剩余数量
if
(
query
.
getQuantityRemainSymbol
()
!=
null
&&
query
.
getQuantityRemain
()
!=
null
)
{
lambdaQuery
.
gt
(
query
.
getQuantityRemainSymbol
()
==
1
,
RewardDO:
:
getQuantityRemain
,
query
.
getQuantityRemain
())
.
eq
(
query
.
getQuantityRemainSymbol
()
==
2
,
RewardDO:
:
getQuantityRemain
,
query
.
getQuantityRemain
())
.
lt
(
query
.
getQuantityRemainSymbol
()
==
3
,
RewardDO:
:
getQuantityRemain
,
query
.
getQuantityRemain
());
}
//创建时间
lambdaQuery
.
betweenIfPresent
(
RewardDO:
:
getCreateTime
,
query
.
getBeginCreateTime
(),
query
.
getEndCreateTime
())
.
orderByDesc
(
RewardDO:
:
getId
);
return
rewardMapper
.
selectPage
(
page
,
lambdaQuery
);
}
@Override
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/admin/config/SwaggerRewardConfiguration.java
0 → 100644
View file @
0935422c
package
cn
.
iocoder
.
yudao
.
module
.
reward
.
controller
.
admin
.
config
;
import
cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
javax.annotation.Resource
;
/**
* Swagger2 自动配置类
* @author 捷道源码
*/
@Configuration
public
class
SwaggerRewardConfiguration
{
@Bean
public
Docket
createAdminShipmentApi
()
{
String
title
=
"管理端-礼品管理"
;
String
author
=
"管理端-礼品管理"
;
String
basePackage
=
"cn.iocoder.yudao.module.reward.controller.admin"
;
// 创建 Docket 对象
return
autoConfiguration
.
docket
(
title
,
author
,
basePackage
);
}
@Resource
private
YudaoSwaggerAutoConfiguration
autoConfiguration
;
}
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/admin/reward/RewardController.java
View file @
0935422c
...
...
@@ -24,7 +24,7 @@ import cn.iocoder.yudao.module.reward.service.reward.RewardService;
@Validated
@RestController
@Api
(
tags
=
"管理后台 - 礼品"
)
@Api
(
tags
=
"管理后台 - 礼品
管理
"
)
@RequestMapping
(
"/ecw/reward/"
)
public
class
RewardController
{
...
...
@@ -33,14 +33,14 @@ public class RewardController {
@PostMapping
(
"/create"
)
@ApiOperation
(
"创建礼品"
)
@PreAuthorize
(
"@ss.hasPermission('reward::create')"
)
//
@PreAuthorize("@ss.hasPermission('reward::create')")
public
CommonResult
<
Long
>
create
(
@Valid
@RequestBody
RewardCreateReqVO
createReqVO
)
{
return
success
(
rewardService
.
create
(
createReqVO
));
}
@PutMapping
(
"/update"
)
@ApiOperation
(
"更新礼品"
)
@PreAuthorize
(
"@ss.hasPermission('reward::update')"
)
//
@PreAuthorize("@ss.hasPermission('reward::update')")
public
CommonResult
<
Boolean
>
update
(
@Valid
@RequestBody
RewardUpdateReqVO
updateReqVO
)
{
rewardService
.
update
(
updateReqVO
);
return
success
(
true
);
...
...
@@ -49,7 +49,7 @@ public class RewardController {
@DeleteMapping
(
"/delete"
)
@ApiOperation
(
"删除礼品"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
@PreAuthorize
(
"@ss.hasPermission('reward::delete')"
)
//
@PreAuthorize("@ss.hasPermission('reward::delete')")
public
CommonResult
<
Boolean
>
delete
(
@RequestParam
(
"id"
)
Long
id
)
{
rewardService
.
delete
(
id
);
return
success
(
true
);
...
...
@@ -58,7 +58,7 @@ public class RewardController {
@GetMapping
(
"/get"
)
@ApiOperation
(
"获得礼品详情"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
@PreAuthorize
(
"@ss.hasPermission('reward::query')"
)
//
@PreAuthorize("@ss.hasPermission('reward::query')")
public
CommonResult
<
RewardBackVO
>
get
(
@RequestParam
(
"id"
)
Long
id
)
{
RewardDO
rewardDO
=
rewardService
.
get
(
id
);
return
success
(
RewardConvert
.
INSTANCE
.
convert
(
rewardDO
));
...
...
@@ -67,7 +67,7 @@ public class RewardController {
@GetMapping
(
"/list"
)
@ApiOperation
(
"获得礼品列表"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
@PreAuthorize
(
"@ss.hasPermission('reward::query')"
)
//
@PreAuthorize("@ss.hasPermission('reward::query')")
public
CommonResult
<
List
<
RewardBackVO
>>
getList
(
@RequestParam
(
"ids"
)
Collection
<
Long
>
ids
)
{
List
<
RewardDO
>
list
=
rewardService
.
getList
(
ids
);
return
success
(
RewardConvert
.
INSTANCE
.
convertList
(
list
));
...
...
@@ -75,7 +75,7 @@ public class RewardController {
@GetMapping
(
"/page"
)
@ApiOperation
(
"获得礼品分页"
)
@PreAuthorize
(
"@ss.hasPermission('reward::query')"
)
//
@PreAuthorize("@ss.hasPermission('reward::query')")
public
CommonResult
<
PageResult
<
RewardBackVO
>>
getPage
(
@Valid
RewardQueryVO
query
,
PageVO
page
)
{
PageResult
<
RewardDO
>
pageResult
=
rewardService
.
getPage
(
query
,
page
);
return
success
(
RewardConvert
.
INSTANCE
.
convertPage
(
pageResult
));
...
...
@@ -83,7 +83,7 @@ public class RewardController {
@GetMapping
(
"/export-excel"
)
@ApiOperation
(
"导出礼品 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('reward::export')"
)
//
@PreAuthorize("@ss.hasPermission('reward::export')")
@OperateLog
(
type
=
EXPORT
)
public
void
exportExcel
(
@Valid
RewardQueryVO
query
,
HttpServletResponse
response
)
throws
IOException
{
...
...
yudao-server/pom.xml
View file @
0935422c
...
...
@@ -114,6 +114,11 @@
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>
cn.iocoder.boot
</groupId>
<artifactId>
yudao-module-reward-impl
</artifactId>
<version>
${revision}
</version>
</dependency>
<!-- spring boot 配置所需依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
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