Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
haoban3.0
haoban-manage3.0
Commits
89c34cec
Commit
89c34cec
authored
Apr 10, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 周报定时任务
parent
113ec359
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
QywxGroupMsgTaskApiService.java
.../api/service/content/task/QywxGroupMsgTaskApiService.java
+1
-0
QywxGroupMsgTaskApiServiceImpl.java
...out/impl/content/task/QywxGroupMsgTaskApiServiceImpl.java
+7
-0
test.java
haoban-manage3-service/src/test/java/test.java
+6
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/content/task/QywxGroupMsgTaskApiService.java
View file @
89c34cec
...
...
@@ -33,6 +33,7 @@ public interface QywxGroupMsgTaskApiService {
* 0 0 10 ? * MON
* 或者 0 0 10 ? * 2
* 每周一 10点
* 基础侧不支持最后不是?的表达式 改为每天执行 然后判断今天是不是周一
* @param params
* @return
*/
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/content/task/QywxGroupMsgTaskApiServiceImpl.java
View file @
89c34cec
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
content
.
task
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.Week
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.DateUtil
;
...
...
@@ -107,6 +108,12 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
@Override
public
ServiceResponse
<
Void
>
handlerMaterialWeekReport
(
String
params
)
{
log
.
info
(
"handlerMaterialWeekReport 执行素材周报任务开始 >>>>> {}"
,
DateUtil
.
datetimeToString
(
new
Date
()));
Date
now
=
new
Date
();
Week
week
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
dayOfWeekEnum
(
now
);
if
(!
Week
.
MONDAY
.
equals
(
week
))
{
log
.
info
(
"handlerMaterialWeekReport 当前时间 不是周一 忽略 》》》 {}"
,
DateUtil
.
datetimeToString
(
new
Date
()));
return
ServiceResponse
.
success
();
}
return
doHandlerReportInner
(
MaterialReportType
.
WEEK
.
getCode
());
}
...
...
haoban-manage3-service/src/test/java/test.java
View file @
89c34cec
...
...
@@ -11,6 +11,7 @@ import cn.hutool.cache.impl.TimedCache;
import
cn.hutool.core.date.DateField
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.Week
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.enums.content.MaterialReportType
;
...
...
@@ -80,6 +81,11 @@ public class test {
DateTime
temp
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetSecond
(
now
,
-(
hour_sec
));
int
hour
=
DateUtil
.
hour
(
temp
,
true
);
System
.
out
.
println
(
hour
);
Week
week
=
DateUtil
.
dayOfWeekEnum
(
new
Date
());
System
.
out
.
println
(
week
);
if
(
Week
.
MONDAY
.
equals
(
week
))
{
System
.
out
.
println
(
"周一"
);
}
}
}
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