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
ce5c2e27
Commit
ce5c2e27
authored
Jul 30, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature_member_score_zhangfeng' into feature_member_score
parents
57807f35
0612f246
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
43 deletions
+72
-43
ScoreRuleController.java
...ember/controller/admin/scoreRule/ScoreRuleController.java
+3
-3
ScoreRuleConvert.java
...dao/module/member/convert/scoreRule/ScoreRuleConvert.java
+3
-2
ScoreRuleService.java
...dao/module/member/service/scoreRule/ScoreRuleService.java
+1
-1
ScoreRuleServiceImpl.java
...module/member/service/scoreRule/ScoreRuleServiceImpl.java
+16
-16
ScoreRuleBackDetailVO.java
...dao/module/member/vo/scoreRule/ScoreRuleBackDetailVO.java
+28
-0
ScoreRuleBackVO.java
...der/yudao/module/member/vo/scoreRule/ScoreRuleBackVO.java
+20
-20
ScoreRuleBaseVO.java
...der/yudao/module/member/vo/scoreRule/ScoreRuleBaseVO.java
+1
-1
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/scoreRule/ScoreRuleController.java
View file @
ce5c2e27
...
...
@@ -65,9 +65,9 @@ public class ScoreRuleController {
@ApiOperation
(
"获得积分规则详情"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
@PreAuthorize
(
"@ss.hasPermission('member:score-rule:query')"
)
public
CommonResult
<
ScoreRuleBackVO
>
getScoreRule
(
@NotNull
@RequestBody
Long
id
)
{
ScoreRuleBack
VO
scoreRuleBack
VO
=
scoreRuleService
.
getScoreRule
(
id
);
return
success
(
scoreRuleBackVO
);
public
CommonResult
<
ScoreRuleBack
Detail
VO
>
getScoreRule
(
@NotNull
@RequestBody
Long
id
)
{
ScoreRuleBack
DetailVO
scoreRuleBackDetail
VO
=
scoreRuleService
.
getScoreRule
(
id
);
return
success
(
scoreRuleBack
Detail
VO
);
}
@PostMapping
(
"/list"
)
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/convert/scoreRule/ScoreRuleConvert.java
View file @
ce5c2e27
package
cn
.
iocoder
.
yudao
.
module
.
member
.
convert
.
scoreRule
;
import
java.util.*
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleBackVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleCreateReqVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.ScoreRuleUpdateReqVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO
;
import
java.util.List
;
/**
* 积分规则 DO Convert
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleService.java
View file @
ce5c2e27
...
...
@@ -41,7 +41,7 @@ public interface ScoreRuleService extends IService<ScoreRuleDO> {
* @param id 编号
* @return 积分规则
*/
ScoreRuleBackVO
getScoreRule
(
Long
id
);
ScoreRuleBack
Detail
VO
getScoreRule
(
Long
id
);
/**
* 获得积分规则列表
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleServiceImpl.java
View file @
ce5c2e27
...
...
@@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleRegisterExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
...
...
@@ -99,14 +100,15 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
}
@Override
public
ScoreRuleBackVO
getScoreRule
(
Long
id
)
{
public
ScoreRuleBack
Detail
VO
getScoreRule
(
Long
id
)
{
ScoreRuleDO
scoreRuleDO
=
scoreRuleMapper
.
selectById
(
id
);
if
(
scoreRuleDO
==
null
)
{
throw
exception
(
SCORE_RULE_NOT_EXISTS
);
}
ScoreRuleBackVO
scoreRuleBackVO
=
ScoreRuleConvert
.
INSTANCE
.
convert
(
scoreRuleDO
);
setExtraVO
(
scoreRuleBackVO
);
return
scoreRuleBackVO
;
ScoreRuleBackDetailVO
scoreRuleBackDetailVO
=
new
ScoreRuleBackDetailVO
();
BeanUtils
.
copyProperties
(
scoreRuleDO
,
scoreRuleBackDetailVO
);
setExtraVO
(
scoreRuleBackDetailVO
);
return
scoreRuleBackDetailVO
;
}
...
...
@@ -114,7 +116,6 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
public
List
<
ScoreRuleBackVO
>
getScoreRuleList
(
Collection
<
Long
>
ids
)
{
List
<
ScoreRuleDO
>
scoreRuleDOS
=
scoreRuleMapper
.
selectBatchIds
(
ids
);
List
<
ScoreRuleBackVO
>
scoreRuleBackVOS
=
ScoreRuleConvert
.
INSTANCE
.
convertList
(
scoreRuleDOS
);
scoreRuleBackVOS
.
forEach
(
this
::
setExtraVO
);
return
scoreRuleBackVOS
;
}
...
...
@@ -122,24 +123,23 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
public
PageResult
<
ScoreRuleBackVO
>
getScoreRulePage
(
ScoreRuleQueryVO
query
,
PageVO
page
)
{
PageResult
<
ScoreRuleDO
>
pageResult
=
scoreRuleMapper
.
selectPage
(
page
,
query
);
PageResult
<
ScoreRuleBackVO
>
scoreRuleBackVOPageResult
=
ScoreRuleConvert
.
INSTANCE
.
convertPage
(
pageResult
);
scoreRuleBackVOPageResult
.
getList
().
forEach
(
this
::
setExtraVO
);
return
scoreRuleBackVOPageResult
;
}
/**
* 设置返回VO额外信息
*
* @param scoreRuleBackVO VO
* @param scoreRuleBack
Detail
VO VO
*/
private
void
setExtraVO
(
ScoreRuleBack
VO
scoreRuleBack
VO
)
{
if
(
scoreRuleBackVO
.
getType
()
==
ScoreRuleTypeEnum
.
ORDER_V
.
getValue
())
{
scoreRuleBack
VO
.
setExtraOrderV
(
JSONUtil
.
toBean
(
scoreRuleBack
VO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
));
}
else
if
(
scoreRuleBackVO
.
getType
()
==
ScoreRuleTypeEnum
.
REGISTER
.
getValue
())
{
scoreRuleBack
VO
.
setExtraRegister
(
JSONUtil
.
toBean
(
scoreRuleBack
VO
.
getExtra
(),
ScoreRuleRegisterExtraVO
.
class
));
}
else
if
(
scoreRuleBackVO
.
getType
()
==
ScoreRuleTypeEnum
.
RECOMMEND
.
getValue
())
{
scoreRuleBack
VO
.
setExtraRecommend
(
JSONUtil
.
toBean
(
scoreRuleBack
VO
.
getExtra
(),
ScoreRulerRecommendExtraVO
.
class
));
}
else
if
(
scoreRuleBackVO
.
getType
()
==
ScoreRuleTypeEnum
.
SHARE
.
getValue
())
{
scoreRuleBack
VO
.
setExtraShare
(
JSONUtil
.
toBean
(
scoreRuleBack
VO
.
getExtra
(),
ScoreRuleShareExtraVO
.
class
));
private
void
setExtraVO
(
ScoreRuleBack
DetailVO
scoreRuleBackDetail
VO
)
{
if
(
scoreRuleBack
Detail
VO
.
getType
()
==
ScoreRuleTypeEnum
.
ORDER_V
.
getValue
())
{
scoreRuleBack
DetailVO
.
setExtraOrderV
(
JSONUtil
.
toBean
(
scoreRuleBackDetail
VO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
));
}
else
if
(
scoreRuleBack
Detail
VO
.
getType
()
==
ScoreRuleTypeEnum
.
REGISTER
.
getValue
())
{
scoreRuleBack
DetailVO
.
setExtraRegister
(
JSONUtil
.
toBean
(
scoreRuleBackDetail
VO
.
getExtra
(),
ScoreRuleRegisterExtraVO
.
class
));
}
else
if
(
scoreRuleBack
Detail
VO
.
getType
()
==
ScoreRuleTypeEnum
.
RECOMMEND
.
getValue
())
{
scoreRuleBack
DetailVO
.
setExtraRecommend
(
JSONUtil
.
toBean
(
scoreRuleBackDetail
VO
.
getExtra
(),
ScoreRulerRecommendExtraVO
.
class
));
}
else
if
(
scoreRuleBack
Detail
VO
.
getType
()
==
ScoreRuleTypeEnum
.
SHARE
.
getValue
())
{
scoreRuleBack
DetailVO
.
setExtraShare
(
JSONUtil
.
toBean
(
scoreRuleBackDetail
VO
.
getExtra
(),
ScoreRuleShareExtraVO
.
class
));
}
else
{
throw
exception
(
SCORE_RULE_NOT_EXISTS
);
}
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/ScoreRuleBackDetailVO.java
0 → 100644
View file @
ce5c2e27
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
scoreRule
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleRegisterExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
@Data
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
"管理后台 - 积分规则详细信息 Response VO"
)
public
class
ScoreRuleBackDetailVO
extends
ScoreRuleBackVO
{
@ApiModelProperty
(
value
=
"扩展字段原始"
)
private
String
extra
;
@ApiModelProperty
(
value
=
"订单V值扩展字段"
)
private
ScoreRuleOrderVExtraVO
extraOrderV
;
@ApiModelProperty
(
value
=
"注册扩展字段"
)
private
ScoreRuleRegisterExtraVO
extraRegister
;
@ApiModelProperty
(
value
=
"推荐扩展字段"
)
private
ScoreRulerRecommendExtraVO
extraRecommend
;
@ApiModelProperty
(
value
=
"分享扩展字段"
)
private
ScoreRuleShareExtraVO
extraShare
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/ScoreRuleBackVO.java
View file @
ce5c2e27
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
scoreRule
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleRegisterExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.annotations.*
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
/**
...
...
@@ -17,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
* @author 系统管理员
*/
@Data
@ApiModel
(
"管理后台 - 积分规则 Response VO"
)
@ApiModel
(
"管理后台 - 积分规则
基本信息
Response VO"
)
public
class
ScoreRuleBackVO
{
@ExcelProperty
(
"主键"
)
...
...
@@ -72,7 +70,7 @@ public class ScoreRuleBackVO {
@ExcelProperty
(
"积分有效期"
)
@ApiModelProperty
(
value
=
"积分有效期"
,
required
=
true
)
private
Integer
s
oc
rePeriod
;
private
Integer
s
co
rePeriod
;
@ExcelProperty
(
"排序值"
)
@ApiModelProperty
(
value
=
"排序值"
,
required
=
true
)
...
...
@@ -95,15 +93,17 @@ public class ScoreRuleBackVO {
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"扩展字段原始"
)
private
String
extra
;
@ApiModelProperty
(
value
=
"订单V值扩展字段"
)
private
ScoreRuleOrderVExtraVO
extraOrderV
;
@ApiModelProperty
(
value
=
"注册扩展字段"
)
private
ScoreRuleRegisterExtraVO
extraRegister
;
@ApiModelProperty
(
value
=
"推荐扩展字段"
)
private
ScoreRulerRecommendExtraVO
extraRecommend
;
@ApiModelProperty
(
value
=
"分享扩展字段"
)
private
ScoreRuleShareExtraVO
extraShare
;
@ExcelProperty
(
"更新时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"更新时间"
,
required
=
true
)
private
Date
updateTime
;
@ExcelProperty
(
"创建人"
)
@ApiModelProperty
(
value
=
"创建人"
,
required
=
true
)
private
String
creator
;
@ExcelProperty
(
"更新人"
)
@ApiModelProperty
(
value
=
"更新人"
,
required
=
true
)
private
String
updater
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/ScoreRuleBaseVO.java
View file @
ce5c2e27
...
...
@@ -70,7 +70,7 @@ public class ScoreRuleBaseVO {
@NotNull
(
message
=
"排序值不能为空"
)
private
Integer
orderNum
;
@ApiModelProperty
(
value
=
"是否推送(0是,1否)"
,
required
=
true
)
@ApiModelProperty
(
value
=
"是否推送(0是,1否)
默认是
"
,
required
=
true
)
@NotNull
(
message
=
"是否推送不能为空"
)
private
Integer
pushActivity
=
0
;
...
...
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