Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SpringMVCTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
HireTest
SpringMVCTemplate
Commits
94aa7288
Commit
94aa7288
authored
Dec 17, 2018
by
邢足健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coding
parent
e1507e68
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
2 deletions
+111
-2
dev.properties
web/src/main/filters/dev.properties
+2
-2
test1Controller.java
...ostudio/SpringMVCTemplate/controller/test1Controller.java
+109
-0
SpringMVCTemplate.war
web/target/SpringMVCTemplate.war
+0
-0
AthenaController.class
...tudio/SpringMVCTemplate/controller/AthenaController.class
+0
-0
test1Controller.class
...studio/SpringMVCTemplate/controller/test1Controller.class
+0
-0
testController.class
...ostudio/SpringMVCTemplate/controller/testController.class
+0
-0
.gitKeep
...lasses/mybatis/com/haomostudio/SpringMVCTemplate/.gitKeep
+0
-0
AthenaController.class
...tudio/SpringMVCTemplate/controller/AthenaController.class
+0
-0
test1Controller.class
...studio/SpringMVCTemplate/controller/test1Controller.class
+0
-0
testController.class
...ostudio/SpringMVCTemplate/controller/testController.class
+0
-0
.gitKeep
...lasses/mybatis/com/haomostudio/SpringMVCTemplate/.gitKeep
+0
-0
No files found.
web/src/main/filters/dev.properties
View file @
94aa7288
jdbc.driverClassName
=
com.mysql.jdbc.Driver
jdbc.driverClassName
=
com.mysql.jdbc.Driver
jdbc.url
=
jdbc:mysql://haomo-tech.com:3317/org?useUnicode=true&characterEncoding=UTF8
jdbc.url
=
jdbc:mysql://haomo-tech.com:3317/org?useUnicode=true&characterEncoding=UTF8
jdbc.username
=
root
jdbc.username
=
org
jdbc.password
=
root
jdbc.password
=
org@haomo
\ No newline at end of file
\ No newline at end of file
web/src/main/java/com/haomostudio/SpringMVCTemplate/controller/test1Controller.java
0 → 100644
View file @
94aa7288
package
com
.
haomostudio
.
SpringMVCTemplate
.
controller
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.*
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.UUID
;
public
class
test1Controller
{
//读取json文件
public
static
Boolean
reader
(
String
filePath
,
String
outPath
)
{
BufferedReader
reader
=
null
;
String
laststr
=
""
;
try
{
FileInputStream
fileInputStream
=
new
FileInputStream
(
filePath
);
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
fileInputStream
,
"UTF-8"
);
reader
=
new
BufferedReader
(
inputStreamReader
);
String
tempString
=
null
;
FileWriter
out
=
new
FileWriter
(
outPath
);
BufferedWriter
bw
=
new
BufferedWriter
(
out
);
while
((
tempString
=
reader
.
readLine
())
!=
null
)
{
String
s
=
sqlString
(
tempString
);
bw
.
write
(
s
);
bw
.
newLine
();
}
bw
.
flush
();
bw
.
close
();
reader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
reader
!=
null
)
{
try
{
reader
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
true
;
}
public
static
String
sqlString
(
String
str
)
{
String
modl_uuid
=
getUUID
();
String
woe_key
=
StringUtils
.
substringBefore
(
str
,
"|"
);
String
s1
=
StringUtils
.
substringBeforeLast
(
str
,
"|"
);
String
woe_typ
=
s1
.
substring
(
s1
.
lastIndexOf
(
"|"
)
+
1
);
String
woe_info
=
str
.
substring
(
str
.
lastIndexOf
(
"|"
)
+
1
).
replace
(
"\""
,
"\\\""
);
String
woe_crt_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
String
woe_upd_time
=
null
;
String
woe_creator
=
"admin"
;
String
woe_updater
=
null
;
String
sqlString
=
"insert into `md_woe` (`modl_uuid`, `woe_key`, `woe_dsc`, `woe_typ`, `woe_info`, `woe_crt_time`, `woe_upd_time`, `woe_creator`, `woe_updater`) values('"
+
modl_uuid
+
"','"
+
woe_key
+
"','"
+
woe_key
+
"','"
+
woe_typ
+
"','"
+
woe_info
+
"','"
+
woe_crt_time
+
"',"
+
woe_upd_time
+
",'"
+
woe_creator
+
"',"
+
woe_updater
+
");"
;
return
sqlString
;
}
public
static
String
getUUID
()
{
return
UUID
.
randomUUID
().
toString
().
trim
().
replaceAll
(
"-"
,
""
);
}
public
static
void
main
(
String
[]
args
)
throws
ParseException
{
;
//设置日期格式
String
format
=
"HH:mm:ss"
;
Date
nowTime
=
new
SimpleDateFormat
(
format
).
parse
(
new
SimpleDateFormat
(
"HH:mm:ss"
).
format
(
new
Date
()));
Date
startTime
=
new
SimpleDateFormat
(
format
).
parse
(
"09:00:00"
);
Date
endTime
=
new
SimpleDateFormat
(
format
).
parse
(
"18:00:00"
);
System
.
out
.
println
(
isEffectiveDate
(
nowTime
,
startTime
,
endTime
));
}
public
static
boolean
isEffectiveDate
(
Date
nowTime
,
Date
startTime
,
Date
endTime
)
{
if
(
nowTime
.
getTime
()
==
startTime
.
getTime
()
||
nowTime
.
getTime
()
==
endTime
.
getTime
())
{
return
true
;
}
Calendar
date
=
Calendar
.
getInstance
();
date
.
setTime
(
nowTime
);
Calendar
begin
=
Calendar
.
getInstance
();
begin
.
setTime
(
startTime
);
Calendar
end
=
Calendar
.
getInstance
();
end
.
setTime
(
endTime
);
if
(
date
.
after
(
begin
)
&&
date
.
before
(
end
))
{
return
true
;
}
else
{
return
false
;
}
}
}
web/target/SpringMVCTemplate.war
0 → 100644
View file @
94aa7288
File added
web/target/classes/com/haomostudio/SpringMVCTemplate/controller/AthenaController.class
0 → 100644
View file @
94aa7288
File added
web/target/classes/com/haomostudio/SpringMVCTemplate/controller/test1Controller.class
0 → 100644
View file @
94aa7288
File added
web/target/classes/com/haomostudio/SpringMVCTemplate/controller/testController.class
0 → 100644
View file @
94aa7288
File added
web/target/classes/mybatis/com/haomostudio/SpringMVCTemplate/.gitKeep
0 → 100644
View file @
94aa7288
web/target/web/WEB-INF/classes/com/haomostudio/SpringMVCTemplate/controller/AthenaController.class
0 → 100644
View file @
94aa7288
File added
web/target/web/WEB-INF/classes/com/haomostudio/SpringMVCTemplate/controller/test1Controller.class
0 → 100644
View file @
94aa7288
File added
web/target/web/WEB-INF/classes/com/haomostudio/SpringMVCTemplate/controller/testController.class
0 → 100644
View file @
94aa7288
File added
web/target/web/WEB-INF/classes/mybatis/com/haomostudio/SpringMVCTemplate/.gitKeep
0 → 100644
View file @
94aa7288
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