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
2fabfe1d
Commit
2fabfe1d
authored
Aug 19, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature_member_score_zhangfeng' into feature_member_score
parents
5ff85533
77525aef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
RecommendStrategy.java
...dule/member/mq/consumer/score/core/RecommendStrategy.java
+2
-2
RewardServiceImpl.java
...yudao/module/reward/service/reward/RewardServiceImpl.java
+22
-6
RewardUpdateReqVO.java
...oder/yudao/module/reward/vo/reward/RewardUpdateReqVO.java
+1
-1
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/mq/consumer/score/core/RecommendStrategy.java
View file @
2fabfe1d
...
@@ -53,8 +53,8 @@ public class RecommendStrategy extends AbstractScoreRuleStrategy {
...
@@ -53,8 +53,8 @@ public class RecommendStrategy extends AbstractScoreRuleStrategy {
try
{
try
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"userId"
,
userId
);
map
.
put
(
"userId"
,
userId
);
map
.
put
(
"userNameZh"
,
me
ssage
.
getUserNameZh
());
map
.
put
(
"userNameZh"
,
me
mberUserDO
.
getNickname
());
map
.
put
(
"userNameEn"
,
me
ssage
.
getUserNameEn
());
map
.
put
(
"userNameEn"
,
me
mberUserDO
.
getEnglishName
());
String
desensitizedPhoneNumber
=
memberUserDO
.
getMobile
().
replaceAll
(
"(\\d{3})\\d{4}(\\d{4})"
,
"$1****$2"
);
String
desensitizedPhoneNumber
=
memberUserDO
.
getMobile
().
replaceAll
(
"(\\d{3})\\d{4}(\\d{4})"
,
"$1****$2"
);
map
.
put
(
"phone"
,
desensitizedPhoneNumber
);
map
.
put
(
"phone"
,
desensitizedPhoneNumber
);
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/reward/RewardServiceImpl.java
View file @
2fabfe1d
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.reward.service.reward;
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.reward.service.reward;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO
;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
...
@@ -16,6 +17,7 @@ import cn.iocoder.yudao.module.reward.convert.reward.RewardConvert;
...
@@ -16,6 +17,7 @@ import cn.iocoder.yudao.module.reward.convert.reward.RewardConvert;
import
cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO
;
import
cn.iocoder.yudao.module.reward.dal.dataobject.reward.RewardDO
;
import
cn.iocoder.yudao.module.reward.dal.mysql.reward.RewardMapper
;
import
cn.iocoder.yudao.module.reward.dal.mysql.reward.RewardMapper
;
import
cn.iocoder.yudao.module.reward.enums.QuantitativeRelationSymbolEnum
;
import
cn.iocoder.yudao.module.reward.enums.QuantitativeRelationSymbolEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardPickMethedEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardStatusEnum
;
import
cn.iocoder.yudao.module.reward.enums.RewardStatusEnum
;
import
cn.iocoder.yudao.module.reward.vo.reward.*
;
import
cn.iocoder.yudao.module.reward.vo.reward.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
@@ -78,7 +80,12 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -78,7 +80,12 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
}
}
private
void
verifyCreateVO
(
RewardCreateReqVO
createReqVO
)
{
private
void
verifyCreateVO
(
RewardCreateReqVO
createReqVO
)
{
//活动开始时间不能比活动结束时间晚,活动结束时间不能比当前时间早
// 校验领取方式
List
<
String
>
pickMethodList
=
Arrays
.
asList
(
createReqVO
.
getPickMethod
().
split
(
","
));
if
(!
pickMethodList
.
contains
(
String
.
valueOf
(
RewardPickMethedEnum
.
SELF_PICKUP
.
getValue
()))
&&
!
pickMethodList
.
contains
(
String
.
valueOf
(
RewardPickMethedEnum
.
SEND_HOME_FREE
.
getValue
()))
&&
!
pickMethodList
.
contains
(
String
.
valueOf
(
RewardPickMethedEnum
.
SEND_HOME_PAY
.
getValue
())))
{
throw
exception
(
REWARD_PICK_METHOD_NOT_ALLOW
);
}
// 活动开始时间不能比活动结束时间晚,活动结束时间不能比当前时间早
if
(
ObjectUtils
.
allNotNull
(
createReqVO
.
getStartTime
(),
createReqVO
.
getEndTime
()))
{
if
(
ObjectUtils
.
allNotNull
(
createReqVO
.
getStartTime
(),
createReqVO
.
getEndTime
()))
{
if
(
createReqVO
.
getStartTime
().
after
((
createReqVO
.
getEndTime
()))
||
createReqVO
.
getEndTime
().
before
(
Date
.
from
(
Instant
.
now
())))
{
if
(
createReqVO
.
getStartTime
().
after
((
createReqVO
.
getEndTime
()))
||
createReqVO
.
getEndTime
().
before
(
Date
.
from
(
Instant
.
now
())))
{
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
...
@@ -117,6 +124,11 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -117,6 +124,11 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
RewardDO
updateObj
=
new
RewardDO
();
RewardDO
updateObj
=
new
RewardDO
();
//未启用可编辑所有内容
//未启用可编辑所有内容
if
(
rewardDO
.
getStatus
()
==
RewardStatusEnum
.
DISABLED
.
getValue
())
{
if
(
rewardDO
.
getStatus
()
==
RewardStatusEnum
.
DISABLED
.
getValue
())
{
// 校验领取方式
List
<
String
>
pickMethodList
=
Arrays
.
asList
(
updateReqVO
.
getPickMethod
().
split
(
","
));
if
(
StringUtils
.
isNotBlank
(
updateReqVO
.
getPickMethod
())
&&
!
pickMethodList
.
contains
(
String
.
valueOf
(
RewardPickMethedEnum
.
SELF_PICKUP
.
getValue
()))
&&
!
pickMethodList
.
contains
(
String
.
valueOf
(
RewardPickMethedEnum
.
SEND_HOME_FREE
.
getValue
()))
&&
!
pickMethodList
.
contains
(
String
.
valueOf
(
RewardPickMethedEnum
.
SEND_HOME_PAY
.
getValue
())))
{
throw
exception
(
REWARD_PICK_METHOD_NOT_ALLOW
);
}
if
(
ObjectUtils
.
allNotNull
(
updateReqVO
.
getStartTime
(),
updateReqVO
.
getEndTime
()))
{
if
(
ObjectUtils
.
allNotNull
(
updateReqVO
.
getStartTime
(),
updateReqVO
.
getEndTime
()))
{
if
(
updateReqVO
.
getStartTime
().
after
((
updateReqVO
.
getEndTime
()))
||
updateReqVO
.
getEndTime
().
before
(
Date
.
from
(
Instant
.
now
())))
{
if
(
updateReqVO
.
getStartTime
().
after
((
updateReqVO
.
getEndTime
()))
||
updateReqVO
.
getEndTime
().
before
(
Date
.
from
(
Instant
.
now
())))
{
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
...
@@ -125,11 +137,11 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -125,11 +137,11 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
}
else
{
}
else
{
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
}
}
List
<
Reward
Cre
ateReqVO
.
NodeAndPoints
>
nodeIds
=
updateReqVO
.
getNodeIds
();
List
<
Reward
Upd
ateReqVO
.
NodeAndPoints
>
nodeIds
=
updateReqVO
.
getNodeIds
();
if
(
CollectionUtil
.
isEmpty
(
nodeIds
))
{
if
(
CollectionUtil
.
isEmpty
(
nodeIds
))
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
}
Reward
Cre
ateReqVO
.
NodeAndPoints
nodeAndPoints
=
nodeIds
.
get
(
0
);
Reward
Upd
ateReqVO
.
NodeAndPoints
nodeAndPoints
=
nodeIds
.
get
(
0
);
updateObj
=
RewardConvert
.
INSTANCE
.
convert
(
updateReqVO
);
updateObj
=
RewardConvert
.
INSTANCE
.
convert
(
updateReqVO
);
updateObj
.
setPointsRequire
(
nodeAndPoints
.
getPoints
());
updateObj
.
setPointsRequire
(
nodeAndPoints
.
getPoints
());
updateObj
.
setNodeId
(
nodeAndPoints
.
getNodeId
());
updateObj
.
setNodeId
(
nodeAndPoints
.
getNodeId
());
...
@@ -360,11 +372,15 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
...
@@ -360,11 +372,15 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
}
}
private
void
setPickMethod
(
AppRewardBackVO
appRewardBackVO
)
{
private
void
setPickMethod
(
AppRewardBackVO
appRewardBackVO
)
{
for
(
String
pickMethod
:
appRewardBackVO
.
getPickMethod
().
split
(
","
))
{
String
[]
splitPickMethod
=
appRewardBackVO
.
getPickMethod
().
split
(
","
);
for
(
String
pickMethod
:
splitPickMethod
)
{
AppRewardBackVO
.
PickMethod
pickMethodDict
=
new
AppRewardBackVO
.
PickMethod
();
AppRewardBackVO
.
PickMethod
pickMethodDict
=
new
AppRewardBackVO
.
PickMethod
();
pickMethodDict
.
setValue
(
pickMethod
);
pickMethodDict
.
setValue
(
pickMethod
);
pickMethodDict
.
setLabelZh
(
DictFrameworkUtils
.
getDictDataFromCache
(
"way_of_receiving"
,
pickMethod
).
getLabel
());
DictDataRespDTO
wayOfReceiving
=
DictFrameworkUtils
.
getDictDataFromCache
(
"way_of_receiving"
,
pickMethod
);
pickMethodDict
.
setLabelEn
(
DictFrameworkUtils
.
getDictDataFromCache
(
"way_of_receiving"
,
pickMethod
).
getLabelEn
());
if
(
wayOfReceiving
!=
null
)
{
pickMethodDict
.
setLabelZh
(
wayOfReceiving
.
getLabel
());
pickMethodDict
.
setLabelEn
(
wayOfReceiving
.
getLabelEn
());
}
appRewardBackVO
.
getPickMethodList
().
add
(
pickMethodDict
);
appRewardBackVO
.
getPickMethodList
().
add
(
pickMethodDict
);
}
}
}
}
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardUpdateReqVO.java
View file @
2fabfe1d
...
@@ -52,7 +52,7 @@ public class RewardUpdateReqVO {
...
@@ -52,7 +52,7 @@ public class RewardUpdateReqVO {
@ApiModelProperty
(
value
=
"兑换网点和积分列表"
,
required
=
true
)
@ApiModelProperty
(
value
=
"兑换网点和积分列表"
,
required
=
true
)
@NotNull
(
message
=
"兑换网点列表不能为空"
)
@NotNull
(
message
=
"兑换网点列表不能为空"
)
private
List
<
Reward
Cre
ateReqVO
.
NodeAndPoints
>
nodeIds
;
private
List
<
Reward
Upd
ateReqVO
.
NodeAndPoints
>
nodeIds
;
@ApiModelProperty
(
value
=
"剩余数量"
)
@ApiModelProperty
(
value
=
"剩余数量"
)
@Min
(
value
=
0
)
@Min
(
value
=
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