Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
srm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
aship
srm
Commits
80aedae8
Commit
80aedae8
authored
Aug 12, 2019
by
顾俭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aship/aship#1 防伪码功能:申请防伪码接口
parent
6a0c63ef
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
application.yml
deploy/IOne-SRM-Prod/application.yml
+2
-1
application.yml
deploy/IOne-SRM-Staging/application.yml
+2
-1
BarcodeGenClient.java
src/main/java/com/i1/erp/barcode/soap/BarcodeGenClient.java
+25
-5
application.yml
src/main/resources/application.yml
+2
-0
No files found.
deploy/IOne-SRM-Prod/application.yml
View file @
80aedae8
...
...
@@ -37,7 +37,8 @@ srm:
printLabelA4Url
:
WebReport/ReportServer?reportlet=ZMT/SRM/srmlabelA4.cpt&shdh=
soapWs
:
wsDynamicClient
:
true
wsUrl
:
http://192.168.1.30:6394/ws/r/aws_ttsrv4
wsUrl
:
http://192.168.12.10/web/ws/r/aws_ttsrv4
wsdlUrl
:
http://192.168.12.10/web/ws/r/aws_ttsrv4?wsdl
deliverOrderWSDL
:
http://192.168.12.10/web/ws/r/aws_ttsrv4?wsdl
deliverOrderFahuo
:
SRM_fahuo
deliverOrderChehuiWSDL
:
http://192.168.12.10/web/ws/r/aws_ttsrv4?wsdl
...
...
deploy/IOne-SRM-Staging/application.yml
View file @
80aedae8
...
...
@@ -37,7 +37,8 @@ srm:
printLabelA4Url
:
WebReport/ReportServer?reportlet=ZMT/SRM_TEST/srmlabelA4.cpt&shdh=
soapWs
:
wsDynamicClient
:
true
wsUrl
:
http://192.168.1.30:6394/ws/r/aws_ttsrv4_toptest
wsUrl
:
http://192.168.12.10/web/ws/r/aws_ttsrv4_toptest
wsdlUrl
:
http://192.168.12.10/web/ws/r/aws_ttsrv4_toptest?wsdl
deliverOrderWSDL
:
http://192.168.12.10/web/ws/r/aws_ttsrv4_toptest?wsdl
deliverOrderFahuo
:
SRM_fahuo
deliverOrderChehuiWSDL
:
http://192.168.12.10/web/ws/r/aws_ttsrv4_toptest?wsdl
...
...
src/main/java/com/i1/erp/barcode/soap/BarcodeGenClient.java
View file @
80aedae8
...
...
@@ -5,6 +5,7 @@ import com.i1.erp.WebServiceClient;
import
com.i1.erp.barcode.service.BarCodeGenService
;
import
com.i1.erp.base.web.dto.SyncResponse
;
import
com.i1.erp.entity.request.Request
;
import
com.i1.erp.entity.response.Response
;
import
com.i1.srm.purchaseOrder.web.dto.PoBarcodeDto
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.cxf.endpoint.Client
;
...
...
@@ -15,14 +16,16 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Component
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
FAIL_CODE
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
SUCCESS_CODE
;
import
static
com
.
i1
.
srm
.
utils
.
SafeType
.
safeString
;
@Component
public
class
BarcodeGenClient
extends
WebServiceClient
{
@Value
(
"${srm.soapWs.wsDynamicClient}"
)
public
Boolean
wsDynamicClient
;
@Value
(
"${srm.soapWs.wsUrl}"
)
private
String
WS_URL
;
@Value
(
"${srm.soapWs.ws
dl
Url}"
)
private
String
WS
DL
_URL
;
@Value
(
"${srm.soapWs.genBarcode}"
)
public
String
ERP_GEN_BARCODE_OP
;
...
...
@@ -50,17 +53,34 @@ public class BarcodeGenClient extends WebServiceClient {
logger
.
info
(
covertObjectToXML
(
requestXml
,
Request
.
class
));
if
(
StringUtils
.
isBlank
(
WS_URL
)
||
StringUtils
.
isBlank
(
ERP_GEN_BARCODE_OP
))
{
if
(
StringUtils
.
isBlank
(
WS
DL
_URL
)
||
StringUtils
.
isBlank
(
ERP_GEN_BARCODE_OP
))
{
throw
new
IOneServiceException
(
"WSDL不可为空."
);
}
Client
client
=
getClient
(
WS_URL
);
Client
client
=
getClient
(
WS
DL
_URL
);
Object
[]
objects
=
client
.
invoke
(
ERP_GEN_BARCODE_OP
,
new
Object
[]{
requestXml
});
client
.
destroy
();
logger
.
info
(
objects
[
0
].
toString
());
return
new
SyncResponse
();
// handle response
try
{
Response
response
=
convertXMLToObject
(
objects
[
0
].
toString
(),
Response
.
class
);
if
(
response
.
getExecution
().
getStatus
().
getCode
().
equalsIgnoreCase
(
"0"
))
{
return
SyncResponse
.
of
(
SUCCESS_CODE
,
"申请防伪码成功"
);
}
else
{
String
errorDetails
=
String
.
format
(
"失败码:%s, 原因: %s, SQL: "
,
safeString
(
response
.
getExecution
().
getStatus
().
getCode
()),
safeString
(
response
.
getExecution
().
getStatus
().
getDescription
()),
safeString
(
response
.
getExecution
().
getStatus
().
getSqlcode
()));
return
SyncResponse
.
of
(
FAIL_CODE
,
errorDetails
);
}
}
catch
(
IOneServiceException
e
)
{
return
SyncResponse
.
of
(
FAIL_CODE
,
e
.
getMessage
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"e"
,
e
);
return
SyncResponse
.
of
(
FAIL_CODE
,
e
.
getMessage
());
...
...
src/main/resources/application.yml
View file @
80aedae8
...
...
@@ -84,6 +84,7 @@ srm:
soapWs
:
wsDynamicClient
:
true
wsUrl
:
http://127.0.0.1:6394/ws/r/aws_ttsrv4_toptest
wsdlUrl
:
http://127.0.0.1:6394/web/ws/r/aws_ttsrv4_toptest?wsdl
deliverOrderWSDL
:
http://127.0.0.1:6394/ws/r/aws_ttsrv4?wsdl
deliverOrderFahuo
:
SRM_fahuo
deliverOrderChehuiWSDL
:
http://127.0.0.1:6394/ws/r/aws_ttsrv4?wsdl
...
...
@@ -185,6 +186,7 @@ srm:
soapWs
:
wsDynamicClient
:
true
wsUrl
:
http://127.0.0.1:6394/ws/r/aws_ttsrv4_toptest
wsdlUrl
:
http://127.0.0.1:6394/web/ws/r/aws_ttsrv4_toptest?wsdl
deliverOrderWSDL
:
http://127.0.0.1:6394/ws/r/aws_ttsrv4_toptest?wsdl
deliverOrderFahuo
:
SRM_fahuo
deliverOrderChehuiWSDL
:
http://127.0.0.1:6394/ws/r/aws_ttsrv4_toptest?wsdl
...
...
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