Commit 0dadb5e8 by 孙龙

up

parent 20e6d10f
...@@ -46,10 +46,6 @@ type UserInfo struct { ...@@ -46,10 +46,6 @@ type UserInfo struct {
} }
func AddTmplRelations(relations TemplateRelation) error{ func AddTmplRelations(relations TemplateRelation) error{
//saleOrderLists := []*SaleOrderLists{}
//db.LabelDB.Select(&saleOrderLists,"select * from lie_sale_order_lists")
fmt.Println(relations)
var( var(
err error err error
sale_order_lists_id int64 sale_order_lists_id int64
......
...@@ -2,7 +2,6 @@ package label ...@@ -2,7 +2,6 @@ package label
import ( import (
"encoding/json" "encoding/json"
"fmt"
"github.com/ichunt2019/logger" "github.com/ichunt2019/logger"
"go-queue-server/dal/label" "go-queue-server/dal/label"
) )
...@@ -16,7 +15,7 @@ import ( ...@@ -16,7 +15,7 @@ import (
*/ */
func AddTemplateRelations(erpData []byte) (err error){ func AddTemplateRelations(erpData []byte) (err error){
templateRelations := label.TemplateRelation{} templateRelations := label.TemplateRelation{}
fmt.Println(string(erpData)) //fmt.Println(string(erpData))
err = json.Unmarshal(erpData,&templateRelations ) err = json.Unmarshal(erpData,&templateRelations )
if err != nil{ if err != nil{
logger.Error("解析erp传输的销售单json报错: %s", err) logger.Error("解析erp传输的销售单json报错: %s", err)
......
...@@ -2,13 +2,13 @@ package main ...@@ -2,13 +2,13 @@ package main
import ( import (
"flag" "flag"
_ "fmt" "fmt"
_ "github.com/ichunt2019/go-msgserver/utils/rabbitmq"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq" "github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/ichunt2019/logger" "github.com/ichunt2019/logger"
"go-queue-server/dal/db" "go-queue-server/dal/db"
"go-queue-server/erp/label" "go-queue-server/erp/label"
"go-queue-server/util" "go-queue-server/util"
"go-queue-server/util/ding"
_ "sync" _ "sync"
_ "time" _ "time"
) )
...@@ -25,6 +25,14 @@ type RecvPro struct { ...@@ -25,6 +25,14 @@ type RecvPro struct {
func (t *RecvPro) Consumer(dataByte []byte) error { func (t *RecvPro) Consumer(dataByte []byte) error {
logger.Info(string(dataByte)) logger.Info(string(dataByte))
error := label.AddTemplateRelations(dataByte) error := label.AddTemplateRelations(dataByte)
if error !=nil {
ding.Send(
util.Configs.Ding_msg.ErpLabelWebhook,
"标签库系统告警:@all",fmt.Sprintf("erp推送销售单据到平台数据处理失败:%s",error)+string(dataByte) ,
make([]string,0),
false,
)
}
return error return error
} }
...@@ -33,6 +41,12 @@ func (t *RecvPro) FailAction(dataByte []byte) error { ...@@ -33,6 +41,12 @@ func (t *RecvPro) FailAction(dataByte []byte) error {
logger.Error("任务处理失败了,我要进入db日志库了") logger.Error("任务处理失败了,我要进入db日志库了")
logger.Error("任务处理失败了,发送钉钉消息通知主人") logger.Error("任务处理失败了,发送钉钉消息通知主人")
logger.Error(string(dataByte)) logger.Error(string(dataByte))
ding.Send(
util.Configs.Ding_msg.ErpLabelWebhook,
"标签库系统告警:@all",fmt.Sprintf("erp推送销售单据到平台数据处理失败")+string(dataByte) ,
make([]string,0),
false,
)
return nil return nil
} }
......
...@@ -60,6 +60,7 @@ type Ding struct { ...@@ -60,6 +60,7 @@ type Ding struct {
Webhook string `toml:"webhook"` Webhook string `toml:"webhook"`
JingDiao string `toml:"jingDiao"` JingDiao string `toml:"jingDiao"`
TuangouWebhook string `toml:"tuangou_webhook"` TuangouWebhook string `toml:"tuangou_webhook"`
ErpLabelWebhook string `toml:"erpLabel_webhook"`
} }
type ApiDomain struct { type ApiDomain struct {
......
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