Commit 2e4514cf by mushishixian

修复bug

parent b84f05fc
...@@ -64,15 +64,15 @@ func (t *RecvPro) Consumer(dataByte []byte) error { ...@@ -64,15 +64,15 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
//判断操作类型 //判断操作类型
switch message.Type { switch message.Type {
case "save": case "save":
operateType = "insert"
outStore.BillId = message.Data.FSourceBillID outStore.BillId = message.Data.FSourceBillID
messageData, err = json.Marshal(&message) messageData, err = json.Marshal(&message)
if err != nil { if err != nil {
goto ERR goto ERR
} }
outStore.QueueMessage = string(messageData) outStore.QueueMessage = string(messageData)
//先去查询是否存在,不存在才去插入,已经存在即是修改 //先去查询是否存在已经同步完成的记录
if !logic.CheckOutStoreSyncStatus(outStore.BillId) { if !logic.CheckOutStoreSyncStatus(outStore.BillId) {
operateType = "insert"
if err = logic.InsertOutStore(outStore); err != nil { if err = logic.InsertOutStore(outStore); err != nil {
goto ERR goto ERR
} }
......
...@@ -57,6 +57,7 @@ func main() { ...@@ -57,6 +57,7 @@ func main() {
fmt.Println(err) fmt.Println(err)
} }
body := string(data) 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"}}`
queueExchange := rabbitmq.QueueExchange{ queueExchange := rabbitmq.QueueExchange{
"store_out", "store_out",
"store_out", "store_out",
......
...@@ -9,7 +9,7 @@ url = "amqp://huntadmin:jy2y2900@192.168.1.237:5672/" ...@@ -9,7 +9,7 @@ url = "amqp://huntadmin:jy2y2900@192.168.1.237:5672/"
[api] [api]
base = http://192.168.2.232:40001 base = http://192.168.2.232:40001
out_store = http://192.168.2.179:40003 out_store = http://192.168.2.232:40003
in_store = http://192.168.2.232:40004 in_store = http://192.168.2.232:40004
erp_sync_base_data_status = http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl erp_sync_base_data_status = http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl
erp_sync_bill_status = http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl erp_sync_bill_status = http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl
......
...@@ -56,24 +56,26 @@ func SendDingTalkRobotToApi(content string) { ...@@ -56,24 +56,26 @@ func SendDingTalkRobotToApi(content string) {
} }
func SendDingTalkRobotToApi1(content string) { func SendDingTalkRobotToApi1(content string) {
var ( go func() {
requestData DingDingRequest var (
apiUrl, token string requestData DingDingRequest
//resp *req.Resp apiUrl, token string
err error //resp *req.Resp
) err error
content = "仓储同步告警 : " + content )
requestData.MsgType = "text" content = "仓储同步告警 : " + content
requestData.Text = map[string]string{ requestData.MsgType = "text"
"content": content, requestData.Text = map[string]string{
} "content": content,
req.Debug = false }
requestData.IsAtAll = false req.Debug = false
token = "3c048caba514a5252aa8bdbb3e10994def6409a2f0d5212e5626c1a071152ec3" requestData.IsAtAll = false
apiUrl = "https://api.ichunt.com/public/dingtalkrobot?access_token=" + token token = "3c048caba514a5252aa8bdbb3e10994def6409a2f0d5212e5626c1a071152ec3"
params := req.BodyJSON(requestData) apiUrl = "https://api.ichunt.com/public/dingtalkrobot?access_token=" + token
_, err = req.Post(apiUrl, params) params := req.BodyJSON(requestData)
if err != nil { _, err = req.Post(apiUrl, params)
fmt.Println(err) if err != nil {
} fmt.Println(err)
}
}()
} }
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