Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
scm_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
c7298005
authored
May 07, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改日志
parent
c85161e6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
10 deletions
cmd/queue/sync_in_store/main.go
cmd/queue/sync_out_store/main.go
cmd/queue/sync_supplier/product/product.go
go.mod
go.sum
internal/logic/sync_log.go
cmd/queue/sync_in_store/main.go
View file @
c7298005
...
...
@@ -123,7 +123,7 @@ func SyncInStoreData(operate string, message InStoreMessage) (err error) {
}
else
{
url
=
configs
.
InStoreApiUrl
+
""
}
req
.
Debug
=
tru
e
req
.
Debug
=
fals
e
billId
:=
message
.
Data
.
FSourceBillID
if
operate
==
"insert"
{
resp
,
err
=
req
.
Post
(
url
,
params
)
...
...
cmd/queue/sync_out_store/main.go
View file @
c7298005
...
...
@@ -127,7 +127,7 @@ func SyncOutStoreData(operate string, message OutStoreMessage) (err error) {
}
else
{
url
=
configs
.
OutStoreApiUrl
+
""
}
req
.
Debug
=
tru
e
req
.
Debug
=
fals
e
billId
:=
message
.
Data
.
FSourceBillID
if
operate
==
"insert"
{
resp
,
err
=
req
.
Post
(
url
,
param
)
...
...
cmd/queue/sync_supplier/product/product.go
View file @
c7298005
...
...
@@ -10,9 +10,9 @@ import (
func
main
()
{
message
:=
make
(
map
[
string
]
interface
{})
message
=
map
[
string
]
interface
{}{
"type"
:
"save"
,
"type"
:
"save
1
"
,
"data"
:
map
[
string
]
string
{
"FID"
:
"LxYAAAABVic3xn38"
,
"FID"
:
"LxYAAAABVic3xn38
1
"
,
"FNUMBER"
:
"M0000009"
,
"CFNAME"
:
"深圳市永盛微电子有限公司"
,
},
...
...
go.mod
View file @
c7298005
...
...
@@ -3,6 +3,7 @@ module scm_server
go 1.13
require (
github.com/astaxie/beego v1.12.1
github.com/beevik/etree v1.1.0
github.com/go-kratos/kratos v0.4.2
github.com/ichunt2019/go-rabbitmq v1.0.1
...
...
@@ -10,6 +11,7 @@ require (
github.com/jmoiron/sqlx v1.2.0
github.com/mushishixian/gosoap v1.2.1-0.20200424081802-b11347c911bc
github.com/pkg/errors v0.9.1
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/tealeg/xlsx v1.0.5
golang.org/x/net v0.0.0-20200421231249-e086a090c8fd // indirect
...
...
go.sum
View file @
c7298005
This diff is collapsed.
Click to expand it.
internal/logic/sync_log.go
View file @
c7298005
...
...
@@ -2,17 +2,17 @@ package logic
import
(
"encoding/json"
"github.com/go-kratos/kratos/pkg/log"
"fmt"
"github.com/astaxie/beego/logs"
"scm_server/internal/dao"
"scm_server/internal/model"
"scm_server/internal/service"
"time"
)
func
init
(){
var
config
log
.
Config
config
.
Dir
=
"logs"
log
.
Init
(
&
config
)
func
init
()
{
logs
.
SetLogger
(
logs
.
AdapterFile
,
`{"filename":"logs/error.log","level":7,"maxlines":0,"maxsize":0,"daily":true,"maxdays":10,"color":true}`
)
logs
.
Async
()
}
const
InsertSyncLogSql
=
"INSERT INTO `lie_sync_log` (`sync_name`,`sync_time`,`sync_error`,`unique_id`,`queue_message`,`add_time`) VALUES (?,?,?,?,?,?)"
...
...
@@ -42,6 +42,6 @@ func DealSyncError(dataByte []byte, uniqueId, syncName string, err error) error
service
.
SendDingTalkRobotToApi
(
string
(
msg
))
//保存日志
log
.
Error
(
"%s"
,
string
(
msg
))
log
s
.
Error
(
fmt
.
Sprintf
(
"%s"
,
string
(
msg
)
))
return
nil
}
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