Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
Project
Project
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
曲欣亮
sap-service
Commits
8b7c0f86
Commit
8b7c0f86
authored
Jul 19, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
d94d6ff0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
12 deletions
+32
-12
.gitignore
.gitignore
+1
-0
ZMISD009SOCREATIONTask.java
...ava/com/schneider_distributor/ZMISD009SOCREATIONTask.java
+16
-5
application-dev.yml
src/main/resources/application-dev.yml
+0
-1
application-pro.yml
src/main/resources/application-pro.yml
+1
-2
application-uat.yml
src/main/resources/application-uat.yml
+1
-2
OSCreationServiceTest.java
src/test/java/test/OSCreationServiceTest.java
+13
-2
No files found.
.gitignore
View file @
8b7c0f86
...
@@ -4,3 +4,4 @@
...
@@ -4,3 +4,4 @@
/.project
/.project
/application.properties
/application.properties
/bin/
/bin/
/logs/
src/main/java/com/schneider_distributor/ZMISD009SOCREATIONTask.java
View file @
8b7c0f86
package
com
.
schneider_distributor
;
package
com
.
schneider_distributor
;
import
java.io.File
;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -8,7 +9,7 @@ import java.util.List;
...
@@ -8,7 +9,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.b
eans.factory.annotation.Valu
e
;
import
org.springframework.b
oot.system.ApplicationHom
e
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -22,16 +23,18 @@ public class ZMISD009SOCREATIONTask {
...
@@ -22,16 +23,18 @@ public class ZMISD009SOCREATIONTask {
@Autowired
@Autowired
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
@Value
(
"${SAP.NO009.WSDL}"
)
private
String
wsdlLocaltion
;
@Scheduled
(
cron
=
"${SAP.NO009.CRON}"
)
@Scheduled
(
cron
=
"${SAP.NO009.CRON}"
)
public
void
execute
()
throws
Exception
{
public
void
execute
()
throws
Exception
{
this
.
runTask
();
this
.
runTask
();
}
}
public
void
runTask
()
throws
MalformedURLException
{
public
void
runTask
()
throws
MalformedURLException
{
ZMISD009SOCREATIONService
service
=
new
ZMISD009SOCREATIONService
(
new
URL
(
wsdlLocaltion
));
ApplicationHome
home
=
new
ApplicationHome
(
getClass
());
File
jarFile
=
home
.
getSource
();
File
folder
=
jarFile
.
getParentFile
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
wsdlLocation
=
"file:///"
+
absolutePath
+
"/WSDL/Z_MI_SD_009_SO_CREATION.wsdl"
;
ZMISD009SOCREATIONService
service
=
new
ZMISD009SOCREATIONService
(
new
URL
(
wsdlLocation
));
this
.
sendData
(
service
.
getZMISD009SOCREATIONPort
());
this
.
sendData
(
service
.
getZMISD009SOCREATIONPort
());
}
}
...
@@ -85,4 +88,12 @@ public class ZMISD009SOCREATIONTask {
...
@@ -85,4 +88,12 @@ public class ZMISD009SOCREATIONTask {
}
}
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
String
osName
=
System
.
getProperty
(
"os.name"
);
if
(
osName
.
toLowerCase
().
contains
(
"windows"
))
{
System
.
out
.
println
(
true
);
}
System
.
out
.
println
(
osName
);
}
}
}
src/main/resources/application-dev.yml
View file @
8b7c0f86
...
@@ -2,7 +2,6 @@ wsUsername: test
...
@@ -2,7 +2,6 @@ wsUsername: test
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
SAP
:
SAP
:
NO009
:
NO009
:
WSDL
:
http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
CRON
:
0 0 0 * * ?
CRON
:
0 0 0 * * ?
spring
:
spring
:
datasource
:
datasource
:
...
...
src/main/resources/application-pro.yml
View file @
8b7c0f86
...
@@ -2,7 +2,6 @@ wsUsername: schneider
...
@@ -2,7 +2,6 @@ wsUsername: schneider
wsPassword
:
f14d4a80f823438a875b1924384c944c
wsPassword
:
f14d4a80f823438a875b1924384c944c
SAP
:
SAP
:
NO009
:
NO009
:
WSDL
:
http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
CRON
:
0 0 0 * * ?
CRON
:
0 0 0 * * ?
spring
:
spring
:
datasource
:
datasource
:
...
...
src/main/resources/application-uat.yml
View file @
8b7c0f86
...
@@ -2,7 +2,6 @@ wsUsername: test
...
@@ -2,7 +2,6 @@ wsUsername: test
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
SAP
:
SAP
:
NO009
:
NO009
:
WSDL
:
http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
CRON
:
0 0 0 * * ?
CRON
:
0 0 0 * * ?
spring
:
spring
:
datasource
:
datasource
:
...
...
src/test/java/test/OSCreationServiceTest.java
View file @
8b7c0f86
package
test
;
package
test
;
import
java.io.File
;
import
java.net.URL
;
import
org.springframework.boot.system.ApplicationHome
;
import
com.schneider_distributor.ZDTSD009SOCREATION
;
import
com.schneider_distributor.ZDTSD009SOCREATION
;
import
com.schneider_distributor.ZMISD009SOCREATION
;
import
com.schneider_distributor.ZMISD009SOCREATION
;
import
com.schneider_distributor.ZMISD009SOCREATIONService
;
import
com.schneider_distributor.ZMISD009SOCREATIONService
;
public
class
OSCreationServiceTest
{
public
class
OSCreationServiceTest
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ZMISD009SOCREATIONService
service
=
new
ZMISD009SOCREATIONService
();
ApplicationHome
home
=
new
ApplicationHome
(
OSCreationServiceTest
.
class
);
File
jarFile
=
home
.
getSource
();
File
folder
=
jarFile
.
getParentFile
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
wsdlLocation
=
"file://////"
+
absolutePath
+
"/wsdl/Z_MI_SD_009_SO_CREATION.wsdl"
;
System
.
out
.
println
(
wsdlLocation
);
ZMISD009SOCREATIONService
service
=
new
ZMISD009SOCREATIONService
(
new
URL
(
wsdlLocation
));
ZMISD009SOCREATION
ZMISD009SOCREATION
=
service
.
getZMISD009SOCREATIONPort
();
ZMISD009SOCREATION
ZMISD009SOCREATION
=
service
.
getZMISD009SOCREATIONPort
();
ZMISD009SOCREATION
.
zMISD009SOCREATION
(
getZMTSD009SOCREATION
());
ZMISD009SOCREATION
.
zMISD009SOCREATION
(
getZMTSD009SOCREATION
());
}
}
...
...
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