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
9fce53b5
Commit
9fce53b5
authored
Aug 14, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
eb943b53
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
34 deletions
+26
-34
SAPServiceFactory.java
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
+5
-24
SI004INVENTORYSyncOutServiceTask.java
...TORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
+4
-1
SI009SOCREATIONAsynOutServiceTask.java
...ION_AsynOutService/SI009SOCREATIONAsynOutServiceTask.java
+7
-3
SI011ACTUALSALESSyncOutServiceTask.java
...ES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
+7
-3
application.yml
src/main/resources/application.yml
+3
-3
No files found.
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
View file @
9fce53b5
package
com
.
egolm
.
sso
.
clients
;
package
com
.
egolm
.
sso
.
clients
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -19,8 +18,6 @@ import org.apache.wss4j.common.ext.WSPasswordCallback;
...
@@ -19,8 +18,6 @@ import org.apache.wss4j.common.ext.WSPasswordCallback;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.egolm.sso.config.XRException
;
@Component
@Component
public
class
SAPServiceFactory
{
public
class
SAPServiceFactory
{
...
@@ -32,32 +29,16 @@ public class SAPServiceFactory {
...
@@ -32,32 +29,16 @@ public class SAPServiceFactory {
@Value
(
"${schneider.password}"
)
@Value
(
"${schneider.password}"
)
private
String
password
;
private
String
password
;
public
<
T
>
T
create
(
Class
<
T
>
requiredType
,
String
wsdlLocation
,
QName
serviceQName
)
{
public
<
T
>
T
create
(
Class
<
T
>
requiredType
,
URL
wsdlLocation
,
QName
serviceQName
)
{
assert
requiredType
!=
null
:
"WebService requiredType cannot be null"
;
assert
requiredType
!=
null
:
"WebService requiredType cannot be null"
;
assert
wsdlLocation
!=
null
:
"WebService wsdlLocation cannot be null"
;
assert
wsdlLocation
!=
null
:
"WebService wsdlLocation cannot be null"
;
assert
serviceQName
!=
null
:
"WebService serviceQName cannot be null"
;
assert
serviceQName
!=
null
:
"WebService serviceQName cannot be null"
;
try
{
Service
dyService
=
Service
.
create
(
wsdlLocation
,
serviceQName
);
URL
WSDL_URL
=
new
URL
(
"file:"
+
wsdlLocation
);
Service
dyService
=
Service
.
create
(
WSDL_URL
,
serviceQName
);
T
service
=
dyService
.
getPort
(
requiredType
);
T
service
=
dyService
.
getPort
(
requiredType
);
ClientProxy
.
getClient
(
service
).
getOutInterceptors
().
add
(
getWSS4JOutInterceptor
());
ClientProxy
.
getClient
(
service
).
getOutInterceptors
().
add
(
getWSS4JOutInterceptor
());
return
service
;
return
service
;
}
catch
(
MalformedURLException
e
)
{
throw
new
XRException
(
e
);
}
}
}
// private static String absolutePath = null;
// private String getAbsolutePath(String WSDLPATH) {
// if (absolutePath == null) {
// ApplicationHome home = new ApplicationHome(getClass());
// File jarFile = home.getSource();
// File folder = jarFile.getParentFile();
// absolutePath = folder.getAbsolutePath();
// }
// return "file:///" + absolutePath + "/" + WSDLPATH;
// }
private
WSS4JOutInterceptor
wss4JOutInterceptor
=
null
;
private
WSS4JOutInterceptor
wss4JOutInterceptor
=
null
;
public
WSS4JOutInterceptor
getWSS4JOutInterceptor
()
{
public
WSS4JOutInterceptor
getWSS4JOutInterceptor
()
{
...
...
src/main/java/com/egolm/sso/clients/SI_004_INVENTORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
View file @
9fce53b5
...
@@ -2,6 +2,7 @@ package com.egolm.sso.clients.SI_004_INVENTORY_SyncOutService;
...
@@ -2,6 +2,7 @@ package com.egolm.sso.clients.SI_004_INVENTORY_SyncOutService;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -9,6 +10,7 @@ import java.util.Map;
...
@@ -9,6 +10,7 @@ import java.util.Map;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.cxf.frontend.ClientProxy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
...
@@ -65,7 +67,8 @@ public class SI004INVENTORYSyncOutServiceTask {
...
@@ -65,7 +67,8 @@ public class SI004INVENTORYSyncOutServiceTask {
}
}
public
void
runTask
()
throws
MalformedURLException
{
public
void
runTask
()
throws
MalformedURLException
{
SI004INVENTORYSyncOut
service
=
factory
.
create
(
SI004INVENTORYSyncOut
.
class
,
WSDLPATH
,
SI004INVENTORYSyncOutService
.
SERVICE
);
SI004INVENTORYSyncOut
service
=
new
SI004INVENTORYSyncOutService
(
new
URL
(
WSDLPATH
)).
getPort
(
SI004INVENTORYSyncOut
.
class
);
ClientProxy
.
getClient
(
service
).
getOutInterceptors
().
add
(
factory
.
getWSS4JOutInterceptor
());
this
.
sendData
(
service
);
this
.
sendData
(
service
);
}
}
...
...
src/main/java/com/egolm/sso/clients/SI_009_SO_CREATION_AsynOutService/SI009SOCREATIONAsynOutServiceTask.java
View file @
9fce53b5
package
com
.
egolm
.
sso
.
clients
.
SI_009_SO_CREATION_AsynOutService
;
package
com
.
egolm
.
sso
.
clients
.
SI_009_SO_CREATION_AsynOutService
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -8,6 +10,7 @@ import java.util.Map;
...
@@ -8,6 +10,7 @@ import java.util.Map;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.cxf.frontend.ClientProxy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
...
@@ -58,12 +61,13 @@ public class SI009SOCREATIONAsynOutServiceTask {
...
@@ -58,12 +61,13 @@ public class SI009SOCREATIONAsynOutServiceTask {
private
SAPServiceFactory
factory
;
private
SAPServiceFactory
factory
;
@Scheduled
(
cron
=
"${CRON.N009}"
)
@Scheduled
(
cron
=
"${CRON.N009}"
)
public
void
execute
()
{
public
void
execute
()
throws
MalformedURLException
{
this
.
runTask
();
this
.
runTask
();
}
}
public
void
runTask
()
{
public
void
runTask
()
throws
MalformedURLException
{
SI009SOCREATIONAsynOut
service
=
factory
.
create
(
SI009SOCREATIONAsynOut
.
class
,
WSDLPATH
,
SI009SOCREATIONAsynOutService
.
SERVICE
);
SI009SOCREATIONAsynOut
service
=
new
SI009SOCREATIONAsynOutService
(
new
URL
(
WSDLPATH
)).
getPort
(
SI009SOCREATIONAsynOut
.
class
);
ClientProxy
.
getClient
(
service
).
getOutInterceptors
().
add
(
factory
.
getWSS4JOutInterceptor
());
this
.
sendData
(
service
);
this
.
sendData
(
service
);
}
}
...
...
src/main/java/com/egolm/sso/clients/SI_011_ACTUAL_SALES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
View file @
9fce53b5
package
com
.
egolm
.
sso
.
clients
.
SI_011_ACTUAL_SALES_SyncOutService
;
package
com
.
egolm
.
sso
.
clients
.
SI_011_ACTUAL_SALES_SyncOutService
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -8,6 +10,7 @@ import java.util.Map;
...
@@ -8,6 +10,7 @@ import java.util.Map;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.cxf.frontend.ClientProxy
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
...
@@ -59,12 +62,13 @@ public class SI011ACTUALSALESSyncOutServiceTask {
...
@@ -59,12 +62,13 @@ public class SI011ACTUALSALESSyncOutServiceTask {
private
SAPServiceFactory
factory
;
private
SAPServiceFactory
factory
;
@Scheduled
(
cron
=
"${CRON.N011}"
)
@Scheduled
(
cron
=
"${CRON.N011}"
)
public
void
execute
()
{
public
void
execute
()
throws
MalformedURLException
{
this
.
runTask
();
this
.
runTask
();
}
}
public
void
runTask
()
{
public
void
runTask
()
throws
MalformedURLException
{
SI011ACTUALSALESSyncOut
service
=
factory
.
create
(
SI011ACTUALSALESSyncOut
.
class
,
WSDLPATH
,
SI011ACTUALSALESSyncOutService
.
SERVICE
);
SI011ACTUALSALESSyncOut
service
=
new
SI011ACTUALSALESSyncOutService
(
new
URL
(
WSDLPATH
)).
getPort
(
SI011ACTUALSALESSyncOut
.
class
);
ClientProxy
.
getClient
(
service
).
getOutInterceptors
().
add
(
factory
.
getWSS4JOutInterceptor
());
this
.
sendData
(
service
);
this
.
sendData
(
service
);
}
}
...
...
src/main/resources/application.yml
View file @
9fce53b5
...
@@ -6,9 +6,9 @@ CRON:
...
@@ -6,9 +6,9 @@ CRON:
N004
:
0 20 0 * * ?
N004
:
0 20 0 * * ?
N011
:
0 30 0 * * ?
N011
:
0 30 0 * * ?
WSDL
:
WSDL
:
N009
:
WSDL/SI_009_SO_CREATION_AsynOutService.wsdl
N009
:
file:
WSDL/SI_009_SO_CREATION_AsynOutService.wsdl
N004
:
WSDL/SI_004_INVENTORY_SyncOutService.wsdl
N004
:
file:
WSDL/SI_004_INVENTORY_SyncOutService.wsdl
N011
:
WSDL/SI_011_ACTUAL_SALES_SyncOutService.wsdl
N011
:
file:
WSDL/SI_011_ACTUAL_SALES_SyncOutService.wsdl
server
:
server
:
port
:
8080
port
:
8080
spring
:
spring
:
...
...
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