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
15b66247
Commit
15b66247
authored
Dec 16, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断用户当天是否还有其它发布的商品,没有则需要取消签到记录
parent
71a62261
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
...va/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
+23
-11
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SignInNoticeJob.java
...api/src/main/java/com/wwdz/ch/wx/job/SignInNoticeJob.java
+2
-2
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
View file @
15b66247
...
...
@@ -38,8 +38,7 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.net.URL
;
import
java.time.Duration
;
import
java.time.Instant
;
import
java.time.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -617,16 +616,29 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
String
url
=
wxAppletApi
.
getUrlLink
(
"/pages/saleSelf/index"
,
"userId="
+
oldItem
.
getCreatorId
()
+
"&shareRecordId="
);
String
msg
=
"您发布的"
+
oldItem
.
getName
()
+
",内容涉嫌违反平台规定,已被平台下架,请前往"
+
url
+
"查看"
;
//如果用户今天签到了,则取消签到记录
UserSignIn
todaySignIn
=
userSignInDao
.
findTodayRecord
(
oldItem
.
getCreatorId
());
if
(
todaySignIn
!=
null
)
{
UserSignIn
updateDto
=
new
UserSignIn
();
updateDto
.
setId
(
todaySignIn
.
getId
());
updateDto
.
setIsValid
(
false
);
userSignInDao
.
updateByPrimaryKey
(
updateDto
);
msg
=
"您发布的"
+
oldItem
.
getName
()
+
",内容涉嫌违反平台规定,已被平台下架,并取消了今天的签到记录,请前往"
+
url
+
"查看"
;
//判断用户当天是否还有其它发布的商品,没有则需要取消签到记录
LocalDate
today
=
LocalDate
.
now
();
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
LocalDateTime
startOfDay
=
today
.
atTime
(
LocalTime
.
MIN
);
Date
startDate
=
Date
.
from
(
startOfDay
.
atZone
(
java
.
time
.
ZoneId
.
systemDefault
()).
toInstant
());
LocalDateTime
endOfDay
=
today
.
atTime
(
LocalTime
.
MAX
);
Date
endDate
=
Date
.
from
(
endOfDay
.
atZone
(
java
.
time
.
ZoneId
.
systemDefault
()).
toInstant
());
supplierItemRequestDto
.
setStartCreateTime
(
startDate
);
supplierItemRequestDto
.
setEndCreateTime
(
endDate
);
supplierItemRequestDto
.
setCreatorId
(
oldItem
.
getCreatorId
());
if
(!
supplierItemDao
.
isUploadItem
(
supplierItemRequestDto
))
{
//没有其它发布的商品,如果用户今天签到了,则取消签到记录
UserSignIn
todaySignIn
=
userSignInDao
.
findTodayRecord
(
oldItem
.
getCreatorId
());
if
(
todaySignIn
!=
null
)
{
UserSignIn
updateDto
=
new
UserSignIn
();
updateDto
.
setId
(
todaySignIn
.
getId
());
updateDto
.
setIsValid
(
false
);
userSignInDao
.
updateByPrimaryKey
(
updateDto
);
msg
=
"您发布的"
+
oldItem
.
getName
()
+
",内容涉嫌违反平台规定,已被平台下架,并取消了今天的签到记录,请前往"
+
url
+
"查看"
;
}
aliSmsSender
.
sendSms
(
oldItem
.
getCreatorId
(),
msg
);
}
aliSmsSender
.
sendSms
(
oldItem
.
getCreatorId
(),
msg
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"违规下架失败 error : {}"
,
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SignInNoticeJob.java
View file @
15b66247
...
...
@@ -75,9 +75,9 @@ public class SignInNoticeJob {
/**
* 每天
下午两
点执行一次
* 每天
晚上八
点执行一次
*/
@Scheduled
(
cron
=
"0 0
14
* * ?"
)
@Scheduled
(
cron
=
"0 0
20
* * ?"
)
public
void
execute
()
{
if
(
"dev"
.
equals
(
env
))
{
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行发送签到提醒通知定时作业<<<<<<<<<<<<<<<<<<<<<"
);
...
...
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