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
952e2e69
authored
May 14, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化
parent
87846042
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
3 deletions
cmd/queue/sync_audit_status/main.go
cmd/queue/sync_audit_status/product/product_status_queue.go
cmd/queue/sync_out_store/main.go
cmd/queue/sync_status/main.go
scm_server
cmd/queue/sync_audit_status/main.go
View file @
952e2e69
...
@@ -50,7 +50,7 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
...
@@ -50,7 +50,7 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
goto
ERR
goto
ERR
}
}
if
message
.
SyncName
==
"in_store"
{
if
message
.
SyncName
==
"in_store"
||
message
.
SyncName
==
"out_store"
{
//得到入库数据以后,去组装金蝶需要的数据
//得到入库数据以后,去组装金蝶需要的数据
storeErpData
=
map
[
string
]
interface
{}{
storeErpData
=
map
[
string
]
interface
{}{
"FSourceBillID"
:
message
.
Data
.
ErpStoreId
,
"FSourceBillID"
:
message
.
Data
.
ErpStoreId
,
...
@@ -67,6 +67,7 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
...
@@ -67,6 +67,7 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
})
})
}
}
storeErpData
[
"FEntrys"
]
=
inStoreErpGoods
storeErpData
[
"FEntrys"
]
=
inStoreErpGoods
fmt
.
Println
(
storeErpData
)
jsonByte
,
_
=
json
.
Marshal
(
storeErpData
)
jsonByte
,
_
=
json
.
Marshal
(
storeErpData
)
}
}
//得到message以后,去请求金蝶的接口
//得到message以后,去请求金蝶的接口
...
...
cmd/queue/sync_audit_status/product/product_status_queue.go
View file @
952e2e69
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
func
main
()
()
{
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":"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}]}}`
fmt
.
Println
(
message
)
fmt
.
Println
(
message
)
queueExchange
:=
rabbitmq
.
QueueExchange
{
queueExchange
:=
rabbitmq
.
QueueExchange
{
"store_audit_status"
,
"store_audit_status"
,
...
...
cmd/queue/sync_out_store/main.go
View file @
952e2e69
...
@@ -176,6 +176,7 @@ func TransformParams(message OutStoreMessage) (params map[string]interface{}) {
...
@@ -176,6 +176,7 @@ func TransformParams(message OutStoreMessage) (params map[string]interface{}) {
}
}
outStoreDetail
=
append
(
outStoreDetail
,
map
[
string
]
interface
{}{
outStoreDetail
=
append
(
outStoreDetail
,
map
[
string
]
interface
{}{
"erp_goods_id"
:
entry
.
FMaterialID
,
"erp_goods_id"
:
entry
.
FMaterialID
,
"erp_entry_sn"
:
entry
.
FSourceBillEntryID
,
"goods_name"
:
entry
.
FModel
,
"goods_name"
:
entry
.
FModel
,
"brand_name"
:
entry
.
FBrand
,
"brand_name"
:
entry
.
FBrand
,
"number"
:
entry
.
FQty
,
"number"
:
entry
.
FQty
,
...
...
cmd/queue/sync_status/main.go
View file @
952e2e69
...
@@ -95,6 +95,7 @@ func SyncErpDataStatus(syncName, uniqueId string) (err error) {
...
@@ -95,6 +95,7 @@ func SyncErpDataStatus(syncName, uniqueId string) (err error) {
params
=
gosoap
.
ArrayParams
{
params
=
gosoap
.
ArrayParams
{
{
"json"
,
fmt
.
Sprintf
(
`{"FType":"%s", "FID":"%s"}`
,
syncName
,
uniqueId
)},
{
"json"
,
fmt
.
Sprintf
(
`{"FType":"%s", "FID":"%s"}`
,
syncName
,
uniqueId
)},
}
}
fmt
.
Println
(
fmt
.
Sprintf
(
`{"FType":"%s", "FID":"%s"}`
,
syncName
,
uniqueId
))
res
,
err
=
soap
.
Call
(
apiMethod
,
params
)
res
,
err
=
soap
.
Call
(
apiMethod
,
params
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
...
@@ -163,7 +164,6 @@ func CheckBillDataRequest(syncName, uniqueId string, res *gosoap.Response) (err
...
@@ -163,7 +164,6 @@ func CheckBillDataRequest(syncName, uniqueId string, res *gosoap.Response) (err
for
key
,
value
:=
range
responseData
{
for
key
,
value
:=
range
responseData
{
//金蝶判断成功的标志
//金蝶判断成功的标志
if
key
==
"0000"
{
if
key
==
"0000"
{
fmt
.
Println
(
"ok"
)
//成功还要去修改记录表
//成功还要去修改记录表
switch
syncName
{
switch
syncName
{
case
"inStore"
:
case
"inStore"
:
...
@@ -175,7 +175,6 @@ func CheckBillDataRequest(syncName, uniqueId string, res *gosoap.Response) (err
...
@@ -175,7 +175,6 @@ func CheckBillDataRequest(syncName, uniqueId string, res *gosoap.Response) (err
}
}
//金额判断失败的标志
//金额判断失败的标志
if
key
==
"4444"
{
if
key
==
"4444"
{
fmt
.
Println
(
"fail"
)
return
errors
.
New
(
"金蝶返回失败,失败信息为:"
+
value
)
return
errors
.
New
(
"金蝶返回失败,失败信息为:"
+
value
)
}
}
}
}
...
...
scm_server
View file @
952e2e69
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