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
4348e9fc
Commit
4348e9fc
authored
Dec 16, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
昨天领取过礼物的,则今天签到也重新计算
parent
15b66247
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSignInDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSignInDao.java
+3
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserSignInDaoImpl.java
.../src/main/java/com/wwdz/ch/db/impl/UserSignInDaoImpl.java
+13
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
.../main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
+9
-2
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSignInDao.java
View file @
4348e9fc
...
...
@@ -38,4 +38,7 @@ public interface UserSignInDao {
boolean
updateByPrimaryKey
(
UserSignIn
userSignin
);
boolean
deleteTodayRecord
(
long
userId
);
boolean
updateInvalid
(
UserSignInRequestDto
dto
);
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserSignInDaoImpl.java
View file @
4348e9fc
...
...
@@ -116,4 +116,17 @@ public class UserSignInDaoImpl implements UserSignInDao {
criteria
.
andSignInDateEqualTo
(
todayString
);
return
userSignInMapper
.
deleteByExample
(
example
)
>
0
;
}
@Override
public
boolean
updateInvalid
(
UserSignInRequestDto
dto
)
{
UserSignInExample
example
=
new
UserSignInExample
();
UserSignInExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getStartQueryTime
(),
criteria:
:
andCreateTimeGreaterThan
);
criteria
.
andUserIdEqualTo
(
dto
.
getUserId
());
criteria
.
andIsValidEqualTo
(
true
);
UserSignIn
userSignin
=
new
UserSignIn
();
userSignin
.
setIsValid
(
false
);
return
userSignInMapper
.
updateByExampleSelective
(
userSignin
,
example
)
>
0
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserSigninServiceImpl.java
View file @
4348e9fc
...
...
@@ -98,8 +98,8 @@ public class UserSigninServiceImpl implements UserSigninService {
userSignin
.
setCreateTime
(
new
Date
());
userSignin
.
setUpdateTime
(
new
Date
());
int
consecutiveDays
=
1
;
//连续签到天数, 21天清零重新计算
if
(
yesterdaySignin
.
getConsecutiveDays
()
!=
21
)
{
//连续签到天数, 21天清零重新计算
, 昨天领取过礼物的,则今天签到也重新计算
if
(
yesterdaySignin
.
getConsecutiveDays
()
!=
21
||
!
yesterdaySignin
.
getIsReward
()
)
{
consecutiveDays
=
yesterdaySignin
.
getConsecutiveDays
()
+
1
;
}
userSignin
.
setConsecutiveDays
(
consecutiveDays
);
...
...
@@ -155,6 +155,13 @@ public class UserSigninServiceImpl implements UserSigninService {
updateDto
.
setIsGet
(
true
);
updateDto
.
setUpdateTime
(
new
Date
());
userSignInDao
.
updateByPrimaryKey
(
updateDto
);
//领取完礼物后把签到天数清零,所有大于领取礼物日期的签到记录全部设置为无效
UserSignInRequestDto
userSignInRequestDto
=
new
UserSignInRequestDto
();
userSignInRequestDto
.
setUserId
(
dto
.
getUserId
());
userSignInRequestDto
.
setStartQueryTime
(
userSignin
.
getCreateTime
());
userSignInDao
.
updateInvalid
(
userSignInRequestDto
);
//创建赠品订单
DistributionOrder
distributionOrder
=
new
DistributionOrder
();
String
distributionOrderId
=
IdUtils
.
getOrderNumber
(
CommConsts
.
DISTRIBUTION_ORDER_PREFIX
);
...
...
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