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
362924e4
authored
May 16, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
测试
parent
87f44e5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
cmd/queue/sync_out_store/main.go
cmd/queue/sync_out_store/product/product.go
cmd/queue/sync_out_store/main.go
View file @
362924e4
...
...
@@ -59,17 +59,15 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
)
//先去转换队列消息的json,如果失败,记录起来
if
err
=
json
.
Unmarshal
(
dataByte
,
&
message
);
err
!=
nil
{
service
.
SendDingTalkRobotToApi
(
string
(
dataByte
))
service
.
SendDingTalkRobotToApi
(
err
.
Error
())
goto
ERR
}
return
nil
//判断操作类型
switch
message
.
Type
{
case
"save"
:
outStore
.
BillId
=
message
.
Data
.
FSourceBillID
messageData
,
err
=
json
.
Marshal
(
&
message
)
if
err
!=
nil
{
service
.
SendDingTalkRobotToApi
(
"message"
)
goto
ERR
}
outStore
.
QueueMessage
=
string
(
messageData
)
...
...
cmd/queue/sync_out_store/product/product.go
View file @
362924e4
...
...
@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"scm_server/configs"
)
func
main
()
{
...
...
@@ -12,16 +11,16 @@ func main() {
message
=
map
[
string
]
interface
{}{
"type"
:
"save"
,
"data"
:
map
[
string
]
interface
{}{
"FWarehouseNo"
:
"002"
,
"FEntrustBillNo"
:
"B0536495123"
,
"FErpPurInWorehouseNo"
:
"FKSH202003107482"
,
"FSourceBillID"
:
"+7fvorsZSAevQCJ7ujsbLMBZJbY=551"
,
"CFIsInsp"
:
false
,
"FPrincipalNo"
:
"WT00268"
,
"FBizType"
:
"执行采购"
,
"Remark"
:
"测试"
,
"FErpPostRequistionBillNo"
:
"536495123"
,
"FDeliveryTypeNo"
:
"deliveryTerms0001"
,
"FWarehouseNo"
:
"002"
,
"FEntrustBillNo"
:
"B0536495123"
,
"FErpPurInWorehouseNo"
:
"FKSH202003107482"
,
"FSourceBillID"
:
"+7fvorsZSAevQCJ7ujsbLMBZJbY=551"
,
"CFIsInsp"
:
false
,
"FPrincipalNo"
:
"WT00268"
,
"FBizType"
:
"执行采购"
,
"Remark"
:
"测试"
,
"FErpPostRequistionBillNo"
:
"536495123"
,
"FDeliveryTypeNo"
:
"deliveryTerms0001"
,
"FEntrys"
:
[]
map
[
string
]
interface
{}{
{
"FQty"
:
9
,
...
...
@@ -59,12 +58,13 @@ func main() {
body
:=
string
(
data
)
body
=
`{"type":"save","data":{"FEntrustBillNo":"B05438","FWarehouseNo":"002","FDeliveryTypeNo":"deliveryTerms0003","FPrincipalNo":"WT00683","FSourceBillID":"7aJKpxihRW+LqF7MXDosLO+cpps=","FEntrys":[{"FQty":20,"FSourceBillEntryID":"EYTqfK7nT46e1Ek63QR6dcLaWpc=","FMaterialID":"Hcew0urxRmKVS4bYh6rDQ0QJ5/A=","FUnit":"\u4E2A","FBrand":"BRAND","FOriginCountry":"115","CFIsInsp":false,"FPrice":3.0045,"FGoods":"\u7535\u78C1\u5E72\u6270\u6EE4\u6CE2\u5668","FModel":"sfg"}],"FIsCustoms":true,"FErpPostRequistionBillNo":"FKFH202005147729"}}`
body
=
`{"Type":"save","Data":{"FWarehouseNo":"002","FErpPostRequistionBillNo":"FKFH202005147730","FIsCustoms":true,"FSourceBillID":"eRoPxET5QsGpiG/+k153z++cpps=","FRecPerson":"","FPrincipalNo":"WT00655","FDeliveryTypeNo":"deliveryTerms0001","FRecPersonContact":"","FRecPersonAddress":"","Remark":"","FEntrustBillNo":"B05448","FEntrys":[{"FQty":60,"FMaterialID":"LBQDhMUhQF2WFB20c54Qu0QJ5/A=","FBrand":"JST","FPrice":5.0077,"FSourceBillEntryID":"AJ6EYRbSSICvCxd/CZeciMLaWpc=","FModel":"04CPT-B1-2A","FGoods":"二极管","FUnit":"个","CFIsInsp":false,"Fremark":"","FOriginCountry":"137"}]}}`
body
=
`{"type":"save","data":{"FEntrustBillNo":"B29606","FWarehouseNo":"002","FDeliveryTypeNo":"deliveryTerms0001","FPrincipalNo":"WT01258","FSourceBillID":"PUsjMm2WSxWAxD6XSHrx2++cpps=","FEntrys":[{"FQty":1,"FSourceBillEntryID":"8siFWucqQzqcsSQHE29lBMLaWpc=","FMaterialID":"J70vqbGQTKmM43+mfBVUkkQJ5/A=","FUnit":"\u5757","FBrand":"EXCELITAS","CFIsInsp":false,"FPrice":58.09,"FGoods":"PCB\u7A7A\u767D\u7EBF\u8DEF\u677F","FModel":"1401375"}],"FIsCustoms":true,"FErpPostRequistionBillNo":"FFH20200516081123"}}`
queueExchange
:=
rabbitmq
.
QueueExchange
{
"scm_store_out"
,
"scm_store_out"
,
"scm_store"
,
"direct"
,
configs
.
RABBITMQDSN
,
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/"
,
}
rabbitmq
.
Send
(
queueExchange
,
body
)
...
...
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