Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
scm_server
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
a1116e70
authored
May 15, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复优化
parent
8104954b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
12 deletions
cmd/queue/sync_audit_status/main.go
cmd/queue/sync_audit_status/product/product_status_queue.go
cmd/queue/sync_goods/product/product.go
cmd/queue/sync_out_store/main.go
cmd/queue/sync_status/main.go
cmd/queue/sync_audit_status/main.go
View file @
a1116e70
...
...
@@ -94,6 +94,7 @@ ERR:
}
func
SyncErpAuditStatus
(
syncName
,
billId
,
json
string
)
(
err
error
)
{
fmt
.
Println
(
json
)
if
err
=
service
.
LoginErp
();
err
!=
nil
{
return
}
...
...
cmd/queue/sync_audit_status/product/product_status_queue.go
View file @
a1116e70
...
...
@@ -7,12 +7,7 @@ import (
)
func
main
()
()
{
message
:=
`{"SyncName":"in_store","Data":{"erp_store_id":"FGipxV9OSXGWVCgqefjkesBZJbY=","detail":[{"number":"10.0000","erp_entry_sn":"mJ4W+QdYQoWe0WCnzEOJou0oFFw=","country":""},{"number":"900.0000","erp_entry_sn":"z0ULke\/wRhC5cQFzZZT4WO0oFFw=","country":""}],"pallet_number":1,"pallet_weight":"0.0000","box_number":1,"box_weight":"0.0000"}}`
message
=
`{"SyncName":"out_store","Data":{"erp_store_id":"Ncx3gMUSSEml7z2jL1\/p\/u+cpps=","box_number":1,"pallet_number":0,"detail":[{"erp_entry_sn":"123131","number":"25.0000","box_id":"39","pallet_id":0}]}}`
message
=
`{"SyncName":"in_store","Data":{"erp_store_id":"ibn\/BoPESE+jP5olU7sjl8BZJbY=","detail":[{"number":"100.0000","erp_entry_sn":"Nn9vCo1nRNip2jzdHLDN0e0oFFw=","country":"127"}],"pallet_number":1,"pallet_weight":"0.0000","box_number":1,"box_weight":"0.0000"}}`
message
=
`{"SyncName":"in_store","Data":{"erp_store_id":"MYDb7OZMQeS6cSN7TO8r+sBZJbY=","detail":[{"number":"200.0000","erp_entry_sn":"RbAldie8SiGLuPFp5WvY9e0oFFw=","country":"107"}],"pallet_number":0,"pallet_weight":"0","box_number":1,"box_weight":"0.0000"}}`
message
=
`{"SyncName":"in_store","Data":{"erp_store_id":"aou1scjXStuIAw4aB7m1rMBZJbY=","detail":[{"number":"200.0000","erp_entry_sn":"qpnQLQvyRyKQBttqm9YmAO0oFFw=","country":"112"}],"pallet_number":0,"pallet_weight":"0","box_number":1,"box_weight":"0.0000"}}`
message
=
`{"SyncName":"in_store","Data":{"erp_store_id":"aou1scjXStuIAw4aB7m1rMBZJbY=","detail":[{"number":"200.0000","erp_entry_sn":"qpnQLQvyRyKQBttqm9YmAO0oFFw=","country":"112"}],"pallet_number":0,"pallet_weight":"0","box_number":1,"box_weight":"0.0000"}}`
message
:=
`{"SyncName":"out_store","Data":{"erp_store_id":"Ncx3gMUSSEml7z2jL1\/p\/u+cpps=","box_number":1,"pallet_number":0,"detail":[{"erp_entry_sn":"123131","number":"25.0000","box_id":"39","pallet_id":0}]}}`
fmt
.
Println
(
message
)
queueExchange
:=
rabbitmq
.
QueueExchange
{
"scm_store_audit_status"
,
...
...
cmd/queue/sync_goods/product/product.go
View file @
a1116e70
...
...
@@ -10,12 +10,12 @@ import (
func
main
()
{
message
:=
make
(
map
[
string
]
interface
{})
message
=
map
[
string
]
interface
{}{
"type"
:
"
delet
e"
,
"type"
:
"
sav
e"
,
"data"
:
map
[
string
]
string
{
"FID"
:
"imqWd01vR7qdD/+CY8FKHkQJ5/A="
,
"FGoods"
:
"test123145"
,
"FGoods"
:
"test123145
1
"
,
"FBrand"
:
"TEST123145"
,
"FModel"
:
"test123145"
,
"FModel"
:
"test123145
1
"
,
},
}
data
,
err
:=
json
.
Marshal
(
message
)
...
...
cmd/queue/sync_out_store/main.go
View file @
a1116e70
...
...
@@ -117,7 +117,6 @@ func SyncOutStoreData(operate string, message OutStoreMessage) (err error) {
params
map
[
string
]
interface
{}
)
params
=
TransformParams
(
message
)
fmt
.
Println
(
params
)
//构建请求数据
param
:=
req
.
BodyJSON
(
&
params
)
...
...
cmd/queue/sync_status/main.go
View file @
a1116e70
...
...
@@ -37,7 +37,7 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
if
message
.
SyncName
==
"inStore"
||
message
.
SyncName
==
"outStore"
{
time
.
Sleep
(
5
*
time
.
Second
)
}
fmt
.
Println
(
message
.
SyncName
)
//
fmt.Println(message.SyncName)
//得到message以后,去请求金蝶的接口
if
err
=
SyncErpDataStatus
(
message
.
SyncName
,
message
.
ErpId
);
err
!=
nil
{
goto
ERR
...
...
@@ -104,7 +104,7 @@ func SyncErpDataStatus(syncName, uniqueId string) (err error) {
params
=
gosoap
.
ArrayParams
{
{
"json"
,
fmt
.
Sprintf
(
`{"FType":"%s", "FID":"%s"}`
,
syncName
,
uniqueId
)},
}
fmt
.
Println
(
fmt
.
Sprintf
(
`{"FType":"%s", "FID":"%s"}`
,
syncName
,
uniqueId
))
//
fmt.Println(fmt.Sprintf(`{"FType":"%s", "FID":"%s"}`, syncName, uniqueId))
res
,
err
=
soap
.
Call
(
apiMethod
,
params
)
if
err
!=
nil
{
return
...
...
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