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
a991e4a6
Commit
a991e4a6
authored
Aug 01, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
db71c18e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
4 deletions
+39
-4
ExceptionAspect.java
src/main/java/com/egolm/sso/config/ExceptionAspect.java
+1
-1
CommonService.java
src/main/java/com/egolm/sso/services/CommonService.java
+26
-0
ConfirmQuotationServiceImpl.java
...rvices/confirm_quotation/ConfirmQuotationServiceImpl.java
+1
-0
DNDeletionServiceImpl.java
...egolm/sso/services/dn_deletion/DNDeletionServiceImpl.java
+1
-0
MaterialMasterServiceImpl.java
...o/services/material_master/MaterialMasterServiceImpl.java
+1
-0
PrformaInvoiceServiceImpl.java
...o/services/prforma_invoice/PrformaInvoiceServiceImpl.java
+1
-0
PriceListServiceImpl.java
...m/egolm/sso/services/price_list/PriceListServiceImpl.java
+1
-0
ShippingNotificationServiceImpl.java
...hipping_notfirmation/ShippingNotificationServiceImpl.java
+1
-0
MaterialMasterServiceTest.java
src/test/java/test/MaterialMasterServiceTest.java
+6
-3
No files found.
src/main/java/com/egolm/sso/config/ExceptionAspect.java
View file @
a991e4a6
...
...
@@ -16,7 +16,7 @@ public class ExceptionAspect {
@AfterThrowing
(
throwing
=
"ex"
,
pointcut
=
execution
)
public
void
afterThrowing
(
Throwable
ex
)
{
logger
.
error
(
"未处理异常"
,
ex
);
//
logger.error("未处理异常", ex);
}
}
src/main/java/com/egolm/sso/services/CommonService.java
View file @
a991e4a6
package
com
.
egolm
.
sso
.
services
;
import
java.text.MessageFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.jdbc.core.JdbcTemplate
;
...
...
@@ -12,6 +15,9 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
com.egolm.sso.config.XRException
;
import
com.egolm.sso.util.SqlUtil
;
import
com.egolm.sso.util.SqlUtil.Sql
;
import
com.egolm.sso.util.StringUtil
;
@Service
public
class
CommonService
{
...
...
@@ -19,6 +25,9 @@ public class CommonService {
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Value
(
"${systemId}"
)
private
String
systemId
;
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
Long
getNextval
(
String
sName
)
{
try
{
...
...
@@ -54,4 +63,21 @@ public class CommonService {
}
}
public
void
saveApiAccessLog
(
String
METHOD
,
String
ADDRESS
,
String
RESULT
)
{
Date
now
=
new
Date
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"ID"
,
Long
.
valueOf
(
System
.
currentTimeMillis
()
+
StringUtil
.
getIndex
(
"T_API_ACCESS_LOG_ID"
)));
map
.
put
(
"METHOD"
,
METHOD
);
map
.
put
(
"ADDRESS"
,
ADDRESS
);
map
.
put
(
"ACCESS_DATE"
,
now
);
map
.
put
(
"RESULT"
,
RESULT
);
map
.
put
(
"CREATED"
,
now
);
map
.
put
(
"CREATEBY"
,
systemId
);
Sql
sqlObj
=
SqlUtil
.
insertSql
(
"t_api_access_log"
,
map
);
String
sql
=
sqlObj
.
getSql
();
Object
[]
objs
=
sqlObj
.
getArgs
();
jdbcTemplate
.
update
(
sql
,
objs
);
}
}
src/main/java/com/egolm/sso/services/confirm_quotation/ConfirmQuotationServiceImpl.java
View file @
a991e4a6
...
...
@@ -174,6 +174,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_008_SO_CONFIRM_QUOTATION
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/confirm_quotation"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/dn_deletion/DNDeletionServiceImpl.java
View file @
a991e4a6
...
...
@@ -84,6 +84,7 @@ public class DNDeletionServiceImpl implements DNDeletionService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
DELETED_DOCUMENTS
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/dn_deletion"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/material_master/MaterialMasterServiceImpl.java
View file @
a991e4a6
...
...
@@ -132,6 +132,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_001_MATERIAL_MASTER
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/material_master"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/prforma_invoice/PrformaInvoiceServiceImpl.java
View file @
a991e4a6
...
...
@@ -259,6 +259,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_005_PERFORM_INVOICE
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/prforma_invoice"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/price_list/PriceListServiceImpl.java
View file @
a991e4a6
...
...
@@ -115,6 +115,7 @@ public class PriceListServiceImpl implements PriceListService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_002_PRICE_LIST
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/price_list"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/shipping_notfirmation/ShippingNotificationServiceImpl.java
View file @
a991e4a6
...
...
@@ -183,6 +183,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/shipping_notfirmation"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/test/java/test/MaterialMasterServiceTest.java
View file @
a991e4a6
...
...
@@ -3,17 +3,20 @@ package test;
import
com.egolm.sso.services.material_master.MaterialMasterService
;
import
com.egolm.sso.services.material_master.Z_MT_SD_001_MATERIAL_MASTER
;
import
com.egolm.sso.util.ServiceFactory
;
import
com.egolm.sso.util.ServiceFactory.PasswordType
;
import
com.egolm.sso.util.StringUtil
;
import
com.egolm.sso.util.XMLUtil
;
public
class
MaterialMasterServiceTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
wsdlLocation
=
"http://10.204.15.9:8080/api/services/material_master?wsdl"
;
//String wsdlLocation = "http://10.204.15.9:8080/api/services/material_master?wsdl";
String
wsdlLocation
=
"http://localhost:8080/api/services/material_master?wsdl"
;
String
namespace
=
"http://material_master.sso.egolm.com"
;
String
serviceName
=
"MaterialMasterService"
;
MaterialMasterService
service
=
ServiceFactory
.
create
(
MaterialMasterService
.
class
,
wsdlLocation
,
namespace
,
serviceName
);
String
XML
=
StringUtil
.
readText
(
"C:\\Users\\Quxl\\Desktop\\SSP3A250F7R.xml"
);
MaterialMasterService
service
=
ServiceFactory
.
create
(
MaterialMasterService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
"78258c537d6e4d5fb210a57d05619fb6"
,
PasswordType
.
PasswordText
);
//String XML = StringUtil.readText("C:\\Users\\Quxl\\Desktop\\SSP3A250F7R.xml");
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/001.XML"
);
Z_MT_SD_001_MATERIAL_MASTER
Z_MT_SD_001_MATERIAL_MASTER
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_001_MATERIAL_MASTER
.
class
);
service
.
execute
(
Z_MT_SD_001_MATERIAL_MASTER
);
}
...
...
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