Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
a163d0e5
Commit
a163d0e5
authored
Dec 09, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
弹框是否展示,没签到但当天已提示的,则不再提示
parent
3e9456a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/AppletPageConfigVo.java
...ain/java/com/wwdz/ch/wx/entity/vo/AppletPageConfigVo.java
+6
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AppletPageConfigServiceImpl.java
.../ch/wx/impl/distribution/AppletPageConfigServiceImpl.java
+20
-1
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/AppletPageConfigVo.java
View file @
a163d0e5
...
...
@@ -42,4 +42,10 @@ public class AppletPageConfigVo implements Entity {
* 是否展示
*/
private
Boolean
isShow
;
/**
* 当前日期字符串
* yyyyMMdd
*/
private
String
todayStr
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AppletPageConfigServiceImpl.java
View file @
a163d0e5
package
com.wwdz.ch.wx.impl.distribution
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.RedisUtils
;
import
com.wwdz.ch.db.dao.UserSignInDao
;
import
com.wwdz.ch.db.dao.distribution.AppletPageConfigDao
;
import
com.wwdz.ch.db.domain.UserSignIn
;
...
...
@@ -14,29 +15,47 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
@Service
public
class
AppletPageConfigServiceImpl
implements
AppletPageConfigService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AppletPageConfigServiceImpl
.
class
);
private
static
final
String
SIGN_IN_ALERT_KEY
=
"SIGN:IN:ALERT:"
;
@Autowired
AppletPageConfigDao
appletPageConfigDao
;
@Autowired
UserSignInDao
userSignInDao
;
@Autowired
RedisUtils
redisUtils
;
@Override
public
Result
getPageConfig
(
AppletPageConfigRequestDto
dto
)
{
try
{
LocalDate
today
=
LocalDate
.
now
();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
String
formattedDate
=
today
.
format
(
formatter
);
AppletPageConfig
appletPageConfig
=
appletPageConfigDao
.
findList
(
dto
);
AppletPageConfigVo
appletPageConfigVo
=
new
AppletPageConfigVo
();
appletPageConfigVo
.
setTodayStr
(
formattedDate
);
EntityMapper
.
copyAttribute
(
appletPageConfig
,
appletPageConfigVo
);
if
(
dto
.
getUserId
()
==
null
)
{
appletPageConfigVo
.
setIsShow
(
true
);
}
else
{
String
key
=
SIGN_IN_ALERT_KEY
+
formattedDate
+
":"
+
dto
.
getUserId
();
UserSignIn
userSignIn
=
userSignInDao
.
findTodayRecord
(
dto
.
getUserId
());
if
(
userSignIn
==
null
)
{
if
(
redisUtils
.
hasKey
(
key
))
{
appletPageConfigVo
.
setIsShow
(
false
);
}
else
{
appletPageConfigVo
.
setIsShow
(
true
);
redisUtils
.
set
(
key
,
dto
.
getUserId
(),
60
*
60
*
24
);
}
}
else
{
appletPageConfigVo
.
setIsShow
(
false
);
}
...
...
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