Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
97bbf47f
"vscode:/vscode.git/clone" did not exist on "5b1f41fcbe764ab81256fb5aefbab4627e1b1cbd"
Commit
97bbf47f
authored
Oct 25, 2020
by
季圣华
Browse files
优化工具类
parent
825e1c7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/utils/Tools.java
View file @
97bbf47f
...
@@ -155,7 +155,6 @@ public class Tools {
...
@@ -155,7 +155,6 @@ public class Tools {
return
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
cal
.
getTime
());
return
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
cal
.
getTime
());
}
}
/**
/**
* 获取当前月份的前6个月(含当前月)
* 获取当前月份的前6个月(含当前月)
* @param size 月数
* @param size 月数
...
@@ -176,41 +175,6 @@ public class Tools {
...
@@ -176,41 +175,6 @@ public class Tools {
return
list
;
return
list
;
}
}
/**
* 获取当前月份的前6个月(含当前月)
* @param date
* @return
*/
public
static
List
<
String
>
getSixMonth
(
String
date
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
int
month
=
Integer
.
parseInt
(
date
.
substring
(
5
,
7
));
int
year
=
Integer
.
parseInt
(
date
.
substring
(
0
,
4
));
for
(
int
i
=
5
;
i
>=
0
;
i
--)
{
if
(
month
>
6
)
{
if
(
month
-
i
>=
10
)
{
list
.
add
(
year
+
"-"
+
String
.
valueOf
(
month
-
i
));
}
else
{
list
.
add
(
year
+
"-0"
+
String
.
valueOf
(
month
-
i
));
}
}
else
{
if
(
month
-
i
<=
0
)
{
if
(
month
-
i
+
12
>=
10
)
{
list
.
add
(
String
.
valueOf
(
year
-
1
)
+
"-"
+
String
.
valueOf
(
month
-
i
+
12
));
}
else
{
list
.
add
(
String
.
valueOf
(
year
-
1
)
+
"-0"
+
String
.
valueOf
(
month
-
i
+
12
));
}
}
else
{
if
(
month
-
i
>=
10
)
{
list
.
add
(
String
.
valueOf
(
year
)
+
"-"
+
String
.
valueOf
(
month
-
i
));
}
else
{
list
.
add
(
String
.
valueOf
(
year
)
+
"-0"
+
String
.
valueOf
(
month
-
i
));
}
}
}
}
return
list
;
}
/**
/**
* 截取字符串长度
* 截取字符串长度
*
*
...
...
Write
Preview
Supports
Markdown
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