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
a292fa28
Commit
a292fa28
authored
Dec 12, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布的商品不符合规定就取消签到记录2
parent
2bcdd4c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
.../main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
+6
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SignInNoticeJob.java
...api/src/main/java/com/wwdz/ch/wx/job/SignInNoticeJob.java
+3
-3
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
View file @
a292fa28
...
@@ -226,7 +226,11 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -226,7 +226,11 @@ public class UserSigninServiceImpl implements UserSigninService {
}
}
//连续签到天数
//连续签到天数
UserSignIn
lastedRecord
=
userSignInDao
.
findLastedRecord
(
userId
);
UserSignIn
lastedRecord
=
userSignInDao
.
findLastedRecord
(
userId
);
if
(
lastedRecord
==
null
)
{
resultMap
.
put
(
"totalConsecutiveDays"
,
0
);
}
else
{
resultMap
.
put
(
"totalConsecutiveDays"
,
lastedRecord
.
getTotalConsecutiveDays
()
==
null
?
0
:
lastedRecord
.
getTotalConsecutiveDays
());
resultMap
.
put
(
"totalConsecutiveDays"
,
lastedRecord
.
getTotalConsecutiveDays
()
==
null
?
0
:
lastedRecord
.
getTotalConsecutiveDays
());
}
//当前是几号
//当前是几号
LocalDate
today
=
LocalDate
.
now
();
LocalDate
today
=
LocalDate
.
now
();
...
@@ -395,7 +399,7 @@ public class UserSigninServiceImpl implements UserSigninService {
...
@@ -395,7 +399,7 @@ public class UserSigninServiceImpl implements UserSigninService {
//日历数据
//日历数据
resultMap
.
put
(
"calendar"
,
calendar
);
resultMap
.
put
(
"calendar"
,
calendar
);
//签到进度
//签到进度
resultMap
.
put
(
"rate"
,
(
int
)
Math
.
ceil
((
Double
.
valueOf
(
resultMap
.
get
(
"consecutiveDays"
).
toString
())
/
21
)
*
100
));
resultMap
.
put
(
"rate"
,
(
int
)
Math
.
ceil
((
Double
.
valueOf
(
resultMap
.
get
(
"consecutiveDays"
).
toString
())
/
365
)
*
100
));
//查询用户当天有没有发布过商品
//查询用户当天有没有发布过商品
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
LocalDateTime
startOfDay
=
today
.
atTime
(
LocalTime
.
MIN
);
LocalDateTime
startOfDay
=
today
.
atTime
(
LocalTime
.
MIN
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SignInNoticeJob.java
View file @
a292fa28
...
@@ -77,12 +77,12 @@ public class SignInNoticeJob {
...
@@ -77,12 +77,12 @@ public class SignInNoticeJob {
/**
/**
* 每天下午两点执行一次
* 每天下午两点执行一次
*/
*/
@Scheduled
(
cron
=
"0
20 11
* * ?"
)
@Scheduled
(
cron
=
"0
0 14
* * ?"
)
public
void
execute
()
{
public
void
execute
()
{
/*
if ("dev".equals(env)) {
if
(
"dev"
.
equals
(
env
))
{
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行发送签到提醒通知定时作业<<<<<<<<<<<<<<<<<<<<<"
);
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行发送签到提醒通知定时作业<<<<<<<<<<<<<<<<<<<<<"
);
return
;
return
;
}
*/
}
RLock
lock
=
redissonClient
.
getLock
(
SIGN_IN_NOTICE_KEY
);
RLock
lock
=
redissonClient
.
getLock
(
SIGN_IN_NOTICE_KEY
);
if
(!
lock
.
tryLock
())
{
if
(!
lock
.
tryLock
())
{
logger
.
warn
(
"发送签到提醒通知,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行"
,
Thread
.
currentThread
().
getId
());
logger
.
warn
(
"发送签到提醒通知,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行"
,
Thread
.
currentThread
().
getId
());
...
...
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