Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CnChunfeng
/
photo_taking
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
644d1345
authored
Sep 15, 2020
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加代码
parent
1f73bc73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
internal/service/erp_client.go
internal/service/erp_client.go
View file @
644d1345
...
...
@@ -3,13 +3,13 @@ package service
import
(
"encoding/json"
"errors"
xj
"github.com/basgys/goxml2json"
"github.com/beevik/etree"
"github.com/go-kratos/kratos/pkg/conf/paladin"
"github.com/go-kratos/kratos/pkg/log"
bm
"github.com/go-kratos/kratos/pkg/net/http/blademaster"
"github.com/mushishixian/gosoap"
"strings"
xj
"github.com/basgys/goxml2json"
)
var
ErpConfig
struct
{
...
...
@@ -102,16 +102,19 @@ func CheckOrderReturnData(res *gosoap.Response) (err error) {
xml
:=
strings
.
NewReader
(
`<?xml version="1.0" encoding="UTF-8"?>`
+
result
.
Text
())
turnJson
,
err
:=
xj
.
Convert
(
xml
)
log
.
Info
(
result
.
Text
())
if
err
!=
nil
{
return
errors
.
New
(
"转换Json失败"
)
}
log
.
Info
(
turnJson
.
String
())
err
=
json
.
Unmarshal
([]
byte
(
turnJson
.
String
()),
&
ErpReturnOrderData
)
ErpReturnOrderData
.
Xml
.
P
.
A
=
ErpReturnOrderData
.
Xml
.
P
.
A
[
:
len
(
ErpReturnOrderData
.
Xml
.
P
.
A
)
-
1
]
if
err
!=
nil
{
return
errors
.
New
(
"没查询到erp订单数据"
)
return
errors
.
New
(
err
.
Error
()
)
}
return
nil
}
...
...
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