Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sso
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
曲欣亮
sso
Commits
a920c8ce
Commit
a920c8ce
authored
Jul 09, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
a2fa9b4a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
7 deletions
+81
-7
TestController.java
src/main/java/com/schneider_distributor/TestController.java
+2
-1
ZMISD009SOCREATIONService.java
.../com/schneider_distributor/ZMISD009SOCREATIONService.java
+2
-1
ZMISD009SOCREATIONTask.java
...ava/com/schneider_distributor/ZMISD009SOCREATIONTask.java
+73
-5
application-dev.yml
src/main/resources/application-dev.yml
+2
-0
application-pro.yml
src/main/resources/application-pro.yml
+2
-0
No files found.
src/main/java/com/schneider_distributor/TestController.java
View file @
a920c8ce
package
com
.
schneider_distributor
;
import
java.net.MalformedURLException
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
...
...
@@ -42,7 +43,7 @@ public class TestController {
}
@RequestMapping
(
value
=
{
"/009_SO_CREATION"
},
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
executeZMISD009SOCREATIONTask
()
{
public
String
executeZMISD009SOCREATIONTask
()
throws
MalformedURLException
{
this
.
verify
();
task
.
runTask
();
return
"OK"
;
...
...
src/main/java/com/schneider_distributor/ZMISD009SOCREATIONService.java
View file @
a920c8ce
...
...
@@ -2,11 +2,12 @@ package com.schneider_distributor;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
javax.xml.namespace.QName
;
import
javax.xml.ws.Service
;
import
javax.xml.ws.WebEndpoint
;
import
javax.xml.ws.WebServiceClient
;
import
javax.xml.ws.WebServiceFeature
;
import
javax.xml.ws.Service
;
/**
* This class was generated by Apache CXF 3.2.9
...
...
src/main/java/com/schneider_distributor/ZMISD009SOCREATIONTask.java
View file @
a920c8ce
package
com
.
schneider_distributor
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
com.schneider_distributor.ZDTSD009SOCREATION.Header
;
import
com.schneider_distributor.ZDTSD009SOCREATION.ITEM
;
@Component
public
class
ZMISD009SOCREATIONTask
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Value
(
"${wsdlLocation.009}"
)
private
String
wsdlLocaltion
;
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
public
void
execute
()
{
public
void
execute
()
throws
Exception
{
this
.
runTask
();
}
public
void
runTask
()
{
ZMISD009SOCREATIONService
service
=
new
ZMISD009SOCREATIONService
();
ZMISD009SOCREATION
ZMISD009SOCREATION
=
service
.
getZMISD009SOCREATIONPort
();
ZMISD009SOCREATION
.
zMISD009SOCREATION
(
null
);
public
void
runTask
()
throws
MalformedURLException
{
ZMISD009SOCREATIONService
service
=
new
ZMISD009SOCREATIONService
(
new
URL
(
wsdlLocaltion
));
this
.
sendData
(
service
.
getZMISD009SOCREATIONPort
());
}
private
void
sendData
(
ZMISD009SOCREATION
ZMISD009SOCREATION
)
{
List
<
Map
<
String
,
Object
>>
headerList
=
jdbcTemplate
.
queryForList
(
"SELECT * FROM t_so_creation_header WHERE SEND_STATUS = ? LIMIT ?"
,
"N"
,
1
);
if
(
headerList
.
size
()
>
0
)
{
for
(
Map
<
String
,
Object
>
headerMap
:
headerList
)
{
ZDTSD009SOCREATION
ZDTSD009SOCREATIONBean
=
new
ZDTSD009SOCREATION
();
Header
header
=
new
Header
();
Long
ID
=
(
Long
)
headerMap
.
get
(
"ID"
);
String
BSTKD_E
=
(
String
)
headerMap
.
get
(
"BSTKD_E"
);
String
VBELN
=
(
String
)
headerMap
.
get
(
"VBELN"
);
Date
BSTDK
=
(
Date
)
headerMap
.
get
(
"BSTDK"
);
String
KUNNR
=
(
String
)
headerMap
.
get
(
"KUNNR"
);
String
KGNNR
=
(
String
)
headerMap
.
get
(
"KGNNR"
);
String
QTFLAG
=
(
String
)
headerMap
.
get
(
"QTFLAG"
);
header
.
setBSTKDE
(
BSTKD_E
);
header
.
setVBELN
(
VBELN
);
header
.
setKUNNR
(
KUNNR
);
header
.
setKGNNR
(
KGNNR
);
header
.
setQTFLAG
(
QTFLAG
);
if
(
BSTDK
!=
null
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
header
.
setBSTDK
(
format
.
format
(
BSTDK
));
}
ZDTSD009SOCREATIONBean
.
setHeader
(
header
);
List
<
Map
<
String
,
Object
>>
itemList
=
jdbcTemplate
.
queryForList
(
"SELECT * FROM t_so_creation_item WHERE HEADER_ID = ?"
,
ID
);
for
(
Map
<
String
,
Object
>
itemMap
:
itemList
)
{
String
POSNR
=
(
String
)
itemMap
.
get
(
"POSNR"
);
String
VTEXT
=
(
String
)
itemMap
.
get
(
"VTEXT"
);
String
MATNR
=
(
String
)
itemMap
.
get
(
"MATNR"
);
Integer
KWMENG
=
(
Integer
)
itemMap
.
get
(
"KWMENG"
);
Date
EDATU
=
(
Date
)
itemMap
.
get
(
"EDATU"
);
ITEM
item
=
new
ITEM
();
item
.
setPOSNR
(
POSNR
);
item
.
setVTEXT
(
VTEXT
);
item
.
setMATNR
(
MATNR
);
if
(
KWMENG
!=
null
)
{
item
.
setKWMENG
(
KWMENG
.
toString
());
}
if
(
EDATU
!=
null
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
item
.
setEDATU
(
format
.
format
(
EDATU
));
}
ZDTSD009SOCREATIONBean
.
getITEM
().
add
(
item
);
}
ZMISD009SOCREATION
.
zMISD009SOCREATION
(
ZDTSD009SOCREATIONBean
);
jdbcTemplate
.
update
(
"UPDATE t_so_creation_header SET SEND_STATUS = 'Y', SEND_TIME = NOW() WHERE ID = ?"
,
ID
);
}
}
}
}
src/main/resources/application-dev.yml
View file @
a920c8ce
wsUsername
:
test
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
wsdlLocation
:
009
:
http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
...
...
src/main/resources/application-pro.yml
View file @
a920c8ce
wsUsername
:
schneider
wsPassword
:
f14d4a80f823438a875b1924384c944c
wsdlLocation
:
009
:
http://schneider-distributor.com/Z_MI_SD_009_SO_CREATION.wsdl
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
...
...
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