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
ace06b39
Commit
ace06b39
authored
Jul 30, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分规则接口
parent
b7ea7a20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
91 deletions
+73
-91
RelationSymbolEnum.java
...iocoder/yudao/module/member/enums/RelationSymbolEnum.java
+23
-0
ScoreRuleMapper.java
...ao/module/member/dal/mysql/scoreRule/ScoreRuleMapper.java
+40
-43
ScoreRuleQueryVO.java
...er/yudao/module/member/vo/scoreRule/ScoreRuleQueryVO.java
+10
-48
No files found.
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/RelationSymbolEnum.java
0 → 100644
View file @
ace06b39
package
cn
.
iocoder
.
yudao
.
module
.
member
.
enums
;
public
enum
RelationSymbolEnum
{
GT
(
1
,
"大于"
),
EQ
(
2
,
"等于"
),
LT
(
3
,
"小于"
);
private
final
int
value
;
private
final
String
name
;
RelationSymbolEnum
(
int
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
public
int
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
\ No newline at end of file
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/scoreRule/ScoreRuleMapper.java
View file @
ace06b39
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
mysql
.
scoreRule
;
import
java.util.*
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.enums.RelationSymbolEnum
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleQueryVO
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 积分规则 DO Mapper
* 积分规则 Mapper
*
* @author 系统管理员
*/
@Mapper
...
...
@@ -18,58 +22,51 @@ public interface ScoreRuleMapper extends AbstractMapper<ScoreRuleDO> {
@Override
default
PageResult
<
ScoreRuleDO
>
selectPage
(
PageVO
page
,
Object
object
)
{
if
(
object
instanceof
ScoreRuleQueryVO
)
{
ScoreRuleQueryVO
vo
=
(
ScoreRuleQueryVO
)
object
;
return
selectPage
(
page
,
new
LambdaQuery
<
ScoreRuleDO
>()
.
eqIfPresent
(
ScoreRuleDO:
:
getType
,
vo
.
getType
())
.
eqIfPresent
(
ScoreRuleDO:
:
getTitleZh
,
vo
.
getTitleZh
())
.
eqIfPresent
(
ScoreRuleDO:
:
getTitleEn
,
vo
.
getTitleEn
())
.
eqIfPresent
(
ScoreRuleDO:
:
getDescZh
,
vo
.
getDescZh
())
.
eqIfPresent
(
ScoreRuleDO:
:
getDescEn
,
vo
.
getDescEn
())
.
eqIfPresent
(
ScoreRuleDO:
:
getCoverImageZh
,
vo
.
getCoverImageZh
())
.
eqIfPresent
(
ScoreRuleDO:
:
getCoverImageEn
,
vo
.
getCoverImageEn
())
.
eqIfPresent
(
ScoreRuleDO:
:
getGetScoreOnce
,
vo
.
getGetScoreOnce
())
.
eqIfPresent
(
ScoreRuleDO:
:
getMaxScoreTotal
,
vo
.
getMaxScoreTotal
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getStartTime
,
vo
.
getBeginStartTime
(),
vo
.
getEndStartTime
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getEndTime
,
vo
.
getBeginEndTime
(),
vo
.
getEndEndTime
())
.
eqIfPresent
(
ScoreRuleDO:
:
getScorePeriod
,
vo
.
getSocrePeriod
())
.
eqIfPresent
(
ScoreRuleDO:
:
getOrderNum
,
vo
.
getOrderNum
())
.
eqIfPresent
(
ScoreRuleDO:
:
getPushActivity
,
vo
.
getPushActivity
())
.
eqIfPresent
(
ScoreRuleDO:
:
getShowPlatform
,
vo
.
getShowPlatform
())
.
eqIfPresent
(
ScoreRuleDO:
:
getStatus
,
vo
.
getStatus
())
.
eqIfPresent
(
ScoreRuleDO:
:
getExtra
,
vo
.
getExtra
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
ScoreRuleDO:
:
getId
));
}
ScoreRuleQueryVO
vo
=
(
ScoreRuleQueryVO
)
object
;
LambdaQueryWrapperX
<
ScoreRuleDO
>
queryWrapperX
=
new
LambdaQuery
<
ScoreRuleDO
>()
.
eqIfPresent
(
ScoreRuleDO:
:
getType
,
vo
.
getType
())
.
eqIfPresent
(
ScoreRuleDO:
:
getStatus
,
vo
.
getStatus
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
ScoreRuleDO:
:
getId
);
if
(
vo
.
getGetScoreOnceSymbol
()
!=
null
&&
vo
.
getGetScoreOnce
()
!=
null
)
{
queryWrapperX
.
gt
(
vo
.
getGetScoreOnceSymbol
()
==
RelationSymbolEnum
.
GT
.
getValue
(),
ScoreRuleDO:
:
getGetScoreOnce
,
vo
.
getGetScoreOnce
())
.
eq
(
vo
.
getGetScoreOnceSymbol
()
==
RelationSymbolEnum
.
EQ
.
getValue
(),
ScoreRuleDO:
:
getGetScoreOnce
,
vo
.
getGetScoreOnce
())
.
lt
(
vo
.
getGetScoreOnceSymbol
()
==
RelationSymbolEnum
.
LT
.
getValue
(),
ScoreRuleDO:
:
getGetScoreOnce
,
vo
.
getGetScoreOnce
());
}
if
(
vo
.
getMaxScoreTotalSymbol
()
!=
null
&&
vo
.
getMaxScoreTotal
()
!=
null
)
{
queryWrapperX
.
gt
(
vo
.
getMaxScoreTotalSymbol
()
==
RelationSymbolEnum
.
GT
.
getValue
(),
ScoreRuleDO:
:
getMaxScoreTotal
,
vo
.
getMaxScoreTotal
())
.
eq
(
vo
.
getMaxScoreTotalSymbol
()
==
RelationSymbolEnum
.
EQ
.
getValue
(),
ScoreRuleDO:
:
getMaxScoreTotal
,
vo
.
getMaxScoreTotal
())
.
lt
(
vo
.
getMaxScoreTotalSymbol
()
==
RelationSymbolEnum
.
LT
.
getValue
(),
ScoreRuleDO:
:
getMaxScoreTotal
,
vo
.
getMaxScoreTotal
());
}
queryWrapperX
.
and
(
vo
.
getTitle
()
!=
null
,
wrapper
->
wrapper
.
like
(
ScoreRuleDO:
:
getTitleEn
,
vo
.
getTitle
())
.
or
()
.
like
(
ScoreRuleDO:
:
getTitleZh
,
vo
.
getTitle
())
);
queryWrapperX
.
and
(
vo
.
getDesc
()
!=
null
,
wrapper
->
wrapper
.
like
(
ScoreRuleDO:
:
getDescZh
,
vo
.
getDesc
())
.
or
()
.
like
(
ScoreRuleDO:
:
getDescEn
,
vo
.
getDesc
())
);
return
selectPage
(
page
,
queryWrapperX
);
}
return
null
;
}
@Override
default
List
<
ScoreRuleDO
>
selectList
(
Object
object
)
{
if
(
object
instanceof
ScoreRuleQueryVO
)
{
ScoreRuleQueryVO
vo
=
(
ScoreRuleQueryVO
)
object
;
ScoreRuleQueryVO
vo
=
(
ScoreRuleQueryVO
)
object
;
return
selectList
(
new
LambdaQuery
<
ScoreRuleDO
>()
.
eqIfPresent
(
ScoreRuleDO:
:
getType
,
vo
.
getType
())
.
eqIfPresent
(
ScoreRuleDO:
:
getTitleZh
,
vo
.
getTitleZh
())
.
eqIfPresent
(
ScoreRuleDO:
:
getTitleEn
,
vo
.
getTitleEn
())
.
eqIfPresent
(
ScoreRuleDO:
:
getDescZh
,
vo
.
getDescZh
())
.
eqIfPresent
(
ScoreRuleDO:
:
getDescEn
,
vo
.
getDescEn
())
.
eqIfPresent
(
ScoreRuleDO:
:
getCoverImageZh
,
vo
.
getCoverImageZh
())
.
eqIfPresent
(
ScoreRuleDO:
:
getCoverImageEn
,
vo
.
getCoverImageEn
())
.
eqIfPresent
(
ScoreRuleDO:
:
getGetScoreOnce
,
vo
.
getGetScoreOnce
())
.
eqIfPresent
(
ScoreRuleDO:
:
getMaxScoreTotal
,
vo
.
getMaxScoreTotal
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getStartTime
,
vo
.
getBeginStartTime
(),
vo
.
getEndStartTime
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getEndTime
,
vo
.
getBeginEndTime
(),
vo
.
getEndEndTime
())
.
eqIfPresent
(
ScoreRuleDO:
:
getScorePeriod
,
vo
.
getSocrePeriod
())
.
eqIfPresent
(
ScoreRuleDO:
:
getOrderNum
,
vo
.
getOrderNum
())
.
eqIfPresent
(
ScoreRuleDO:
:
getPushActivity
,
vo
.
getPushActivity
())
.
eqIfPresent
(
ScoreRuleDO:
:
getShowPlatform
,
vo
.
getShowPlatform
())
.
eqIfPresent
(
ScoreRuleDO:
:
getStatus
,
vo
.
getStatus
())
.
eqIfPresent
(
ScoreRuleDO:
:
getExtra
,
vo
.
getExtra
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
eqIfPresent
(
ScoreRuleDO:
:
getType
,
vo
.
getType
())
.
eqIfPresent
(
ScoreRuleDO:
:
getGetScoreOnce
,
vo
.
getGetScoreOnce
())
.
eqIfPresent
(
ScoreRuleDO:
:
getMaxScoreTotal
,
vo
.
getMaxScoreTotal
())
.
eqIfPresent
(
ScoreRuleDO:
:
getStatus
,
vo
.
getStatus
())
.
betweenIfPresent
(
ScoreRuleDO:
:
getCreateTime
,
vo
.
getBeginCreateTime
(),
vo
.
getEndCreateTime
())
.
orderByDesc
(
ScoreRuleDO:
:
getId
));
}
return
null
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/ScoreRuleQueryVO.java
View file @
ace06b39
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
scoreRule
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.annotations.*
;
import
cn.iocoder.yudao.framework.common.pojo.PageParam
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
@@ -15,64 +17,25 @@ public class ScoreRuleQueryVO {
@ApiModelProperty
(
value
=
"指标类型"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"规则标题中文"
)
private
String
titleZh
;
@ApiModelProperty
(
value
=
"规则标题英文"
)
private
String
titleEn
;
@ApiModelProperty
(
value
=
"规则说明中文"
)
private
String
descZh
;
@ApiModelProperty
(
value
=
"规则说明英文"
)
private
String
descEn
;
@ApiModelProperty
(
value
=
"规则标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"封面图中文"
)
private
String
coverImageZh
;
@ApiModelProperty
(
value
=
"封面图英文"
)
private
String
coverImageEn
;
@ApiModelProperty
(
value
=
"规则说明"
)
private
String
desc
;
@ApiModelProperty
(
value
=
"单次获取积分数查询条件(1大于,2等于,3小于)"
)
private
Integer
getScoreOnceSymbol
;
@ApiModelProperty
(
value
=
"单次获取积分数"
)
private
Integer
getScoreOnce
;
@ApiModelProperty
(
value
=
"单次获取积分数查询条件(1大于,2等于,3小于)"
)
private
Integer
maxScoreTotalSymbol
;
@ApiModelProperty
(
value
=
"累积最高积分"
)
private
Integer
maxScoreTotal
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"开始活动开始时间"
)
private
Date
beginStartTime
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"结束活动开始时间"
)
private
Date
endStartTime
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"开始活动结束时间"
)
private
Date
beginEndTime
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"结束活动结束时间"
)
private
Date
endEndTime
;
@ApiModelProperty
(
value
=
"积分有效期"
)
private
Integer
socrePeriod
;
@ApiModelProperty
(
value
=
"排序值"
)
private
Integer
orderNum
;
@ApiModelProperty
(
value
=
"是否推送"
)
private
Integer
pushActivity
;
@ApiModelProperty
(
value
=
"展示平台"
)
private
String
showPlatform
;
@ApiModelProperty
(
value
=
"活动状态"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"扩展字段"
)
private
String
extra
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"开始创建时间"
)
private
Date
beginCreateTime
;
...
...
@@ -80,5 +43,4 @@ public class ScoreRuleQueryVO {
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"结束创建时间"
)
private
Date
endCreateTime
;
}
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