Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
signal
traffic-signal-platform
Commits
ae30b5f5
Commit
ae30b5f5
authored
Nov 11, 2024
by
zhouleilei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计划调度工具类优化
parent
74141e44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ScheduleUtil.java
...c/main/java/net/wanji/common/utils/tool/ScheduleUtil.java
+5
-5
No files found.
wj-common/src/main/java/net/wanji/common/utils/tool/ScheduleUtil.java
View file @
ae30b5f5
...
@@ -13,12 +13,12 @@ public class ScheduleUtil {
...
@@ -13,12 +13,12 @@ public class ScheduleUtil {
* @Param value
* @Param value
* @Param type 1-月 2-日 3-星期
* @Param type 1-月 2-日 3-星期
**/
**/
public
static
String
getSchedule
(
Integer
value
,
Integer
type
)
{
public
static
String
getSchedule
(
Long
value
,
Integer
type
)
{
if
(
value
==
null
||
type
==
null
){
if
(
value
==
null
||
type
==
null
){
return
""
;
return
""
;
}
}
//将int转为二进制
//将int转为二进制
String
binary
=
Integer
.
toBinaryString
(
value
);
String
binary
=
Long
.
toBinaryString
(
value
);
StringBuilder
stringBuilder
=
new
StringBuilder
(
binary
);
StringBuilder
stringBuilder
=
new
StringBuilder
(
binary
);
String
s
=
stringBuilder
.
reverse
().
toString
();
String
s
=
stringBuilder
.
reverse
().
toString
();
int
len
=
s
.
length
();
int
len
=
s
.
length
();
...
@@ -101,8 +101,8 @@ public class ScheduleUtil {
...
@@ -101,8 +101,8 @@ public class ScheduleUtil {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
getSchedule
(
8190
,
1
));
System
.
out
.
println
(
getSchedule
(
512L
,
1
));
System
.
out
.
println
(
getSchedule
(
0
,
2
));
System
.
out
.
println
(
getSchedule
(
4294967295L
,
2
));
System
.
out
.
println
(
getSchedule
(
4
,
3
));
System
.
out
.
println
(
getSchedule
(
1L
,
3
));
}
}
}
}
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