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
9bf841ee
Commit
9bf841ee
authored
Aug 12, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分规则触发缓存
parent
adc0eb3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
+9
-16
ScoreRuleRedisDao.java
.../module/member/dal/redis/scoreRule/ScoreRuleRedisDao.java
+2
-1
ScoreRuleServiceImpl.java
...module/member/service/scoreRule/ScoreRuleServiceImpl.java
+7
-15
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/redis/scoreRule/ScoreRuleRedisDao.java
View file @
9bf841ee
...
@@ -10,6 +10,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
...
@@ -10,6 +10,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* 会员积分规则 Redis DAO
* 会员积分规则 Redis DAO
...
@@ -57,7 +58,7 @@ public class ScoreRuleRedisDao {
...
@@ -57,7 +58,7 @@ public class ScoreRuleRedisDao {
ScoreRuleOrderVExtraVO
scoreRuleOrderVExtraVO
=
JsonUtils
.
parseObject
(
scoreRuleDO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
);
ScoreRuleOrderVExtraVO
scoreRuleOrderVExtraVO
=
JsonUtils
.
parseObject
(
scoreRuleDO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
);
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
scoreRuleOrderVExtraVO
.
getTransportType
()),
JsonUtils
.
toJsonString
(
scoreRuleDO
));
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
scoreRuleOrderVExtraVO
.
getTransportType
()),
JsonUtils
.
toJsonString
(
scoreRuleDO
));
}
}
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
null
),
JsonUtils
.
toJsonString
(
scoreRuleDO
));
stringRedisTemplate
.
opsForValue
().
set
(
formatKey
(
scoreRuleDO
.
getType
(),
null
),
JsonUtils
.
toJsonString
(
scoreRuleDO
)
,
24L
,
TimeUnit
.
HOURS
);
}
}
public
void
deleteEnableScoreRule
(
Integer
type
)
{
public
void
deleteEnableScoreRule
(
Integer
type
)
{
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleServiceImpl.java
View file @
9bf841ee
...
@@ -415,16 +415,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -415,16 +415,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if
(
enableScoreRule
==
null
)
{
if
(
enableScoreRule
==
null
)
{
return
null
;
return
null
;
}
}
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
// 校验一下活动开始结束时间
// 校验一下活动开始结束时间
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
}
}
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
}
else
{
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
return
null
;
}
}
}
return
enableScoreRule
;
return
enableScoreRule
;
}
}
...
@@ -439,15 +435,11 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -439,15 +435,11 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if
(
enableScoreRule
==
null
)
{
if
(
enableScoreRule
==
null
)
{
return
null
;
return
null
;
}
}
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
}
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
scoreRuleRedisDao
.
setEnableScoreRule
(
enableScoreRule
);
}
else
{
}
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
if
(!
enableScoreRule
.
getEndTime
().
after
(
new
Date
())
||
!
enableScoreRule
.
getStartTime
().
before
(
new
Date
()))
{
return
null
;
return
null
;
}
}
}
return
enableScoreRule
;
return
enableScoreRule
;
case
RECOMMEND:
case
RECOMMEND:
case
REGISTER:
case
REGISTER:
...
...
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