Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_scm_wms_sync
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
87846042
authored
May 13, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化代码
parent
8ab52c7b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
42 deletions
cmd/queue/sync_audit_status/main.go
cmd/queue/sync_status/main.go
conf/config.ini
configs/erp.go
internal/service/erp_request.go
scm_server
cmd/queue/sync_audit_status/main.go
View file @
87846042
...
...
@@ -25,9 +25,9 @@ type QueueAuditData struct {
type
StoreData
struct
{
ErpStoreId
string
`json:"erp_store_id"`
BoxNumber
int
`json:"box_number"`
BoxWeight
string
`json:"box_weight"`
BoxWeight
string
`json:"box_weight"`
PalletNumber
int
`json:"pallet_number"`
PalletWeight
string
`json:"pallet_weight"`
PalletWeight
string
`json:"pallet_weight"`
Detail
[]
StoreGoods
`json:"detail"`
}
...
...
cmd/queue/sync_status/main.go
View file @
87846042
...
...
@@ -53,40 +53,8 @@ ERR:
return
nil
}
func
LoginErp
()
(
err
error
)
{
soap
,
err
:=
gosoap
.
SoapClient
(
configs
.
ErpLoginStatusApi
)
if
err
!=
nil
{
return
}
params
:=
gosoap
.
ArrayParams
{
{
"userName"
,
"WBYH"
},
{
"password"
,
"123456"
},
{
"slnName"
,
"eas"
},
{
"dcName"
,
"demo"
},
{
"language"
,
"L2"
},
{
"dbType"
,
"1"
},
{
"authPattern"
,
"BaseDB"
},
}
res
,
err
:=
soap
.
Call
(
"login"
,
params
)
if
err
!=
nil
{
return
}
doc
:=
etree
.
NewDocument
()
if
err
:=
doc
.
ReadFromBytes
(
res
.
Body
);
err
!=
nil
{
return
err
}
root
:=
doc
.
SelectElement
(
"multiRef"
)
sessionId
:=
root
.
SelectElement
(
"sessionId"
)
.
Text
()
if
sessionId
!=
""
{
return
}
return
errors
.
New
(
string
(
res
.
Body
))
}
func
SyncErpDataStatus
(
syncName
,
uniqueId
string
)
(
err
error
)
{
if
err
=
LoginErp
();
err
!=
nil
{
if
err
=
service
.
LoginErp
();
err
!=
nil
{
return
}
var
(
...
...
conf/config.ini
View file @
87846042
...
...
@@ -17,3 +17,12 @@ erp_login_status = http://192.168.2.253:6888/ormrpc/services/EASLogin?wsdl
[falcon]
push_url
=
http://192.168.1.237:1988/v1/push
[erp]
userName
=
WBYH
password
=
123456
slnName
=
eas
dcName
=
demo
language
=
L2
dbType
=
1
authPattern
=
BaseDB
configs/erp.go
0 → 100644
View file @
87846042
package
configs
var
ErpUserName
string
var
ErpPassword
string
var
ErpSlnName
string
var
ErpDcName
string
var
ErpLanguage
string
var
ErpDbType
string
var
ErpAuthPattern
string
func
init
()
{
ErpUserName
=
GetConfig
(
"erp"
,
"userName"
)
ErpPassword
=
GetConfig
(
"erp"
,
"password"
)
ErpSlnName
=
GetConfig
(
"erp"
,
"slnName"
)
ErpDcName
=
GetConfig
(
"erp"
,
"dcName"
)
ErpLanguage
=
GetConfig
(
"erp"
,
"language"
)
ErpDbType
=
GetConfig
(
"erp"
,
"dbType"
)
ErpAuthPattern
=
GetConfig
(
"erp"
,
"authPattern"
)
}
\ No newline at end of file
internal/service/erp_request.go
View file @
87846042
...
...
@@ -13,13 +13,13 @@ func LoginErp() (err error) {
return
}
params
:=
gosoap
.
ArrayParams
{
{
"userName"
,
"WBYH"
},
{
"password"
,
"123456"
},
{
"slnName"
,
"eas"
},
{
"dcName"
,
"demo"
},
{
"language"
,
"L2"
},
{
"dbType"
,
"1"
},
{
"authPattern"
,
"BaseDB"
},
{
"userName"
,
configs
.
ErpUserName
},
{
"password"
,
configs
.
ErpPassword
},
{
"slnName"
,
configs
.
ErpSlnName
},
{
"dcName"
,
configs
.
ErpDcName
},
{
"language"
,
configs
.
ErpLanguage
},
{
"dbType"
,
configs
.
ErpDbType
},
{
"authPattern"
,
configs
.
ErpAuthPattern
},
}
res
,
err
:=
soap
.
Call
(
"login"
,
params
)
...
...
scm_server
View file @
87846042
The file could not be displayed because it is too large.
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