Commit 362924e4 by mushishixian

测试

parent 87f44e5e
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment