Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang-queue-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
0dadb5e8
authored
May 15, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
20e6d10f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
dal/label/label.go
erp/label/label.go
erp/main.go
util/config.go
dal/label/label.go
View file @
0dadb5e8
...
...
@@ -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
...
...
erp/label/label.go
View file @
0dadb5e8
...
...
@@ -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
)
...
...
erp/main.go
View file @
0dadb5e8
...
...
@@ -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
}
...
...
util/config.go
View file @
0dadb5e8
...
...
@@ -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
{
...
...
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