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
93a4b99d
Commit
93a4b99d
authored
Jul 19, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
d8bd91f5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
10 deletions
+14
-10
.gitignore
.gitignore
+1
-0
MaterialMasterServiceImpl.java
...o/services/material_master/MaterialMasterServiceImpl.java
+3
-6
FileUtil.java
src/main/java/com/egolm/sso/util/FileUtil.java
+7
-1
application-dev.yml
src/main/resources/application-dev.yml
+1
-1
application-pro.yml
src/main/resources/application-pro.yml
+1
-1
application-uat.yml
src/main/resources/application-uat.yml
+1
-1
No files found.
.gitignore
View file @
93a4b99d
...
@@ -5,3 +5,4 @@
...
@@ -5,3 +5,4 @@
/application.properties
/application.properties
/bin/
/bin/
/logs/
/logs/
/xmlHistory/
src/main/java/com/egolm/sso/services/material_master/MaterialMasterServiceImpl.java
View file @
93a4b99d
...
@@ -9,8 +9,6 @@ import java.util.Map.Entry;
...
@@ -9,8 +9,6 @@ import java.util.Map.Entry;
import
javax.jws.WebService
;
import
javax.jws.WebService
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
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
;
...
@@ -32,8 +30,6 @@ import com.google.gson.Gson;
...
@@ -32,8 +30,6 @@ import com.google.gson.Gson;
@WebService
(
serviceName
=
"MaterialMasterService"
,
targetNamespace
=
"http://material_master.sso.egolm.com"
,
endpointInterface
=
"com.egolm.sso.services.material_master.MaterialMasterService"
)
@WebService
(
serviceName
=
"MaterialMasterService"
,
targetNamespace
=
"http://material_master.sso.egolm.com"
,
endpointInterface
=
"com.egolm.sso.services.material_master.MaterialMasterService"
)
public
class
MaterialMasterServiceImpl
implements
MaterialMasterService
{
public
class
MaterialMasterServiceImpl
implements
MaterialMasterService
{
private
static
Log
logger
=
LogFactory
.
getLog
(
MaterialMasterService
.
class
);
@Autowired
@Autowired
JdbcTemplate
jdbcTemplate
;
JdbcTemplate
jdbcTemplate
;
...
@@ -125,10 +121,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
...
@@ -125,10 +121,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
isSuccess
=
false
;
isSuccess
=
false
;
throw
new
XRException
(
"数据保存失败"
,
e
);
throw
new
XRException
(
"数据保存失败"
,
e
);
}
finally
{
}
finally
{
String
xmlName
=
Z_MT_SD_001_MATERIAL_MASTER
.
getClass
().
getSimpleName
()
+
".xml"
;
String
xmlName
=
Z_MT_SD_001_MATERIAL_MASTER
.
getClass
().
getSimpleName
();
try
{
try
{
String
xml
=
XMLUtil
.
toXml
(
Z_MT_SD_001_MATERIAL_MASTER
);
String
xml
=
XMLUtil
.
toXml
(
Z_MT_SD_001_MATERIAL_MASTER
);
FileUtil
.
writeText
(
xmlRoot
+
"/sap/"
+
xmlName
+
"/"
+
DateUtil
.
formatDate
(
new
Date
(),
DateUtil
.
FMT_DATE
)
+
"/"
+
(
isSuccess
?
"success"
:
"error"
)
+
"/"
+
xmlName
+
"-"
+
common
.
getNextval
(
dateString
+
"T_VEN_GOODS_BATCH_"
+
dateString
)
+
".XML"
,
xml
);
String
xmlFullName
=
xmlRoot
+
"/sap/"
+
xmlName
+
"/"
+
DateUtil
.
formatDate
(
new
Date
(),
DateUtil
.
FMT_DATE
)
+
"/"
+
(
isSuccess
?
"success"
:
"error"
)
+
"/"
+
xmlName
+
"-"
+
common
.
getNextval
(
dateString
+
"MATERIAL_MASTER_FILE_NAME"
+
dateString
)
+
".XML"
;
FileUtil
.
writeText
(
xmlFullName
,
xml
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
XRException
(
"报文保存失败"
,
e
);
throw
new
XRException
(
"报文保存失败"
,
e
);
}
}
...
...
src/main/java/com/egolm/sso/util/FileUtil.java
View file @
93a4b99d
...
@@ -2,6 +2,7 @@ package com.egolm.sso.util;
...
@@ -2,6 +2,7 @@ package com.egolm.sso.util;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.BufferedWriter
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -26,7 +27,12 @@ public class FileUtil {
...
@@ -26,7 +27,12 @@ public class FileUtil {
}
}
public
static
void
writeText
(
String
path
,
String
text
)
throws
IOException
{
public
static
void
writeText
(
String
path
,
String
text
)
throws
IOException
{
BufferedWriter
writer
=
new
BufferedWriter
(
new
OutputStreamWriter
(
new
FileOutputStream
(
path
)));
File
file
=
new
File
(
path
);
File
parentFile
=
file
.
getParentFile
();
if
(!
parentFile
.
exists
())
{
parentFile
.
mkdirs
();
}
BufferedWriter
writer
=
new
BufferedWriter
(
new
OutputStreamWriter
(
new
FileOutputStream
(
file
)));
writer
.
write
(
text
);
writer
.
write
(
text
);
writer
.
close
();
writer
.
close
();
}
}
...
...
src/main/resources/application-dev.yml
View file @
93a4b99d
wsUsername
:
test
wsUsername
:
test
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
xmlRoot
:
xmlHistory
xmlRoot
:
XML_HISTORY
SAP
:
SAP
:
NO009
:
NO009
:
CRON
:
0 0 0 * * ?
CRON
:
0 0 0 * * ?
...
...
src/main/resources/application-pro.yml
View file @
93a4b99d
wsUsername
:
schneider
wsUsername
:
schneider
wsPassword
:
f14d4a80f823438a875b1924384c944c
wsPassword
:
f14d4a80f823438a875b1924384c944c
xmlRoot
:
xmlHistory
xmlRoot
:
XML_HISTORY
SAP
:
SAP
:
NO009
:
NO009
:
CRON
:
0 0 0 * * ?
CRON
:
0 0 0 * * ?
...
...
src/main/resources/application-uat.yml
View file @
93a4b99d
wsUsername
:
test
wsUsername
:
test
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
wsPassword
:
78258c537d6e4d5fb210a57d05619fb6
xmlRoot
:
xmlHistory
xmlRoot
:
XML_HISTORY
SAP
:
SAP
:
NO009
:
NO009
:
CRON
:
0 0 0 * * ?
CRON
:
0 0 0 * * ?
...
...
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