Commit 0dadb5e8 by 孙龙

up

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