Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clpjb.maximo76.00
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
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟宏辉
clpjb.maximo76.00
Commits
9612ac66
Commit
9612ac66
authored
Jul 21, 2022
by
zhh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务
parent
c603860e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
src/tohi/app/cron/common/MboDataHander.java
src/tohi/app/cron/common/MboDataHander.java
+21
-10
No files found.
src/tohi/app/cron/common/MboDataHander.java
View file @
9612ac66
...
...
@@ -75,18 +75,29 @@ public class MboDataHander {
System
.
out
.
println
(
"设置日期3333---"
+
calendar
.
getTime
());
CRONMANAGEMbo
.
setValue
(
"NEXTDATE"
,
calendar
.
getTime
());
//将修改后的日期设置为下一个到期日
}
}
else
if
(
unit
.
equalsIgnoreCase
(
"WEEK"
))
{
//周 每周多次
}
else
if
(
unit
.
equalsIgnoreCase
(
"WEEK"
))
{
//周 每周多次
不同天数
boolean
flag
=
false
;
calendar
=
Calendar
.
getInstance
();
calendar1
=
Calendar
.
getInstance
();
calendar1
=
Calendar
.
getInstance
();
//当前时间
int
weekNowNum
=
calendar1
.
get
(
Calendar
.
DAY_OF_WEEK
);
//获取当前星期
for
(
int
i
=
0
;
i
<
PERIODDATEMboSet
.
count
();
i
++)
{
//每天几次 获取时间
MboRemote
PERIODDATEMbo
=
PERIODDATEMboSet
.
getMbo
(
i
);
Calendar
calendar2
=
Calendar
.
getInstance
();
Date
runtime
=
PERIODDATEMbo
.
getDate
(
"RUNTIME"
);
Date
runtime
=
PERIODDATEMbo
.
getDate
(
"RUNTIME"
);
int
WEEKVALUE
=
PERIODDATEMbo
.
getInt
(
"WEEKVALUE"
);
//获取配置的星期
//如果当前日期小于接下来的日期
int
day
=
0
;
if
(
weekNowNum
<
WEEKVALUE
)
{
day
=
WEEKVALUE
-
weekNowNum
;
//得出差的天数
}
else
{
day
=
weekNowNum
+(
7
-
weekNowNum
)+
WEEKVALUE
;
//下星期的天数
}
calendar2
.
add
(
Calendar
.
DAY_OF_MONTH
,
day
);
//几天后的日期
calendar2
.
set
(
Calendar
.
HOUR_OF_DAY
,
runtime
.
getHours
());
calendar2
.
set
(
Calendar
.
MINUTE
,
runtime
.
getMinutes
());
calendar
.
set
(
calendar
.
get
(
Calendar
.
YEAR
),
calendar
.
get
(
Calendar
.
MONTH
),
calendar
.
get
(
Calendar
.
DATE
),
calendar2
.
get
(
Calendar
.
HOUR_OF_DAY
),
calendar2
.
get
(
Calendar
.
MINUTE
));
//将获取的小时放入到对象内 一周后的时间
calendar
2
.
get
(
Calendar
.
DATE
),
calendar2
.
get
(
Calendar
.
HOUR_OF_DAY
),
calendar2
.
get
(
Calendar
.
MINUTE
));
//将获取的小时放入到对象内
System
.
out
.
println
(
"下一个到期日为===="
+
calendar
.
getTime
());
if
(
calendar
.
after
(
calendar1
))
{
//如果生成日期在当前日期之后 ,为下一个到期日
flag
=
true
;
//标记是否有大于当前时间的计划
...
...
@@ -95,14 +106,14 @@ public class MboDataHander {
}
if
(
flag
)
{
CRONMANAGEMbo
.
setValue
(
"NEXTDATE"
,
calendar
.
getTime
());
//将修改后的日期设置为下一个到期日
}
else
{
MboRemote
PERIODDATEMbo
=
PERIODDATEMboSet
.
getMbo
(
0
);
//获取第二天初始时间
Date
runtime
=
PERIODDATEMbo
.
getDate
(
"RUNTIME"
);
calendar
.
set
(
calendar
.
get
(
calendar
.
YEAR
),
calendar
.
get
(
calendar
.
MONTH
),
calendar
.
get
(
calendar
.
DAY_OF_MONTH
)+
7
,
runtime
.
getHours
(),
runtime
.
getMinutes
());
//天数加1
CRONMANAGEMbo
.
setValue
(
"NEXTDATE"
,
calendar
.
getTime
());
//将修改后的日期设置为下一个到期日
}
// else{
// MboRemote PERIODDATEMbo = PERIODDATEMboSet.getMbo(0); //获取第二天初始时间
// Date runtime=PERIODDATEMbo.getDate("RUNTIME");
// calendar.set(calendar.get(calendar.YEAR), calendar.get(calendar.MONTH), calendar.get(calendar.DAY_OF_MONTH)+7,runtime.getHours(),runtime.getMinutes()); //天数加1
// CRONMANAGEMbo.setValue("NEXTDATE", calendar.getTime()); //将修改后的日期设置为下一个到期日
// }
}
else
if
(
unit
.
equalsIgnoreCase
(
"MONTH"
))
{
//月
boolean
flag
=
false
;
calendar
=
Calendar
.
getInstance
();
...
...
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