Commit c7298005 by mushishixian

修改日志

parent c85161e6
...@@ -123,7 +123,7 @@ func SyncInStoreData(operate string, message InStoreMessage) (err error) { ...@@ -123,7 +123,7 @@ func SyncInStoreData(operate string, message InStoreMessage) (err error) {
} else { } else {
url = configs.InStoreApiUrl + "" url = configs.InStoreApiUrl + ""
} }
req.Debug = true req.Debug = false
billId := message.Data.FSourceBillID billId := message.Data.FSourceBillID
if operate == "insert" { if operate == "insert" {
resp, err = req.Post(url, params) resp, err = req.Post(url, params)
......
...@@ -127,7 +127,7 @@ func SyncOutStoreData(operate string, message OutStoreMessage) (err error) { ...@@ -127,7 +127,7 @@ func SyncOutStoreData(operate string, message OutStoreMessage) (err error) {
} else { } else {
url = configs.OutStoreApiUrl + "" url = configs.OutStoreApiUrl + ""
} }
req.Debug = true req.Debug = false
billId := message.Data.FSourceBillID billId := message.Data.FSourceBillID
if operate == "insert" { if operate == "insert" {
resp, err = req.Post(url, param) resp, err = req.Post(url, param)
......
...@@ -10,9 +10,9 @@ import ( ...@@ -10,9 +10,9 @@ import (
func main() { func main() {
message := make(map[string]interface{}) message := make(map[string]interface{})
message = map[string]interface{}{ message = map[string]interface{}{
"type": "save", "type": "save1",
"data": map[string]string{ "data": map[string]string{
"FID": "LxYAAAABVic3xn38", "FID": "LxYAAAABVic3xn381",
"FNUMBER": "M0000009", "FNUMBER": "M0000009",
"CFNAME": "深圳市永盛微电子有限公司", "CFNAME": "深圳市永盛微电子有限公司",
}, },
......
...@@ -3,6 +3,7 @@ module scm_server ...@@ -3,6 +3,7 @@ module scm_server
go 1.13 go 1.13
require ( require (
github.com/astaxie/beego v1.12.1
github.com/beevik/etree v1.1.0 github.com/beevik/etree v1.1.0
github.com/go-kratos/kratos v0.4.2 github.com/go-kratos/kratos v0.4.2
github.com/ichunt2019/go-rabbitmq v1.0.1 github.com/ichunt2019/go-rabbitmq v1.0.1
...@@ -10,6 +11,7 @@ require ( ...@@ -10,6 +11,7 @@ require (
github.com/jmoiron/sqlx v1.2.0 github.com/jmoiron/sqlx v1.2.0
github.com/mushishixian/gosoap v1.2.1-0.20200424081802-b11347c911bc github.com/mushishixian/gosoap v1.2.1-0.20200424081802-b11347c911bc
github.com/pkg/errors v0.9.1 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/smartystreets/goconvey v1.6.4 // indirect
github.com/tealeg/xlsx v1.0.5 github.com/tealeg/xlsx v1.0.5
golang.org/x/net v0.0.0-20200421231249-e086a090c8fd // indirect golang.org/x/net v0.0.0-20200421231249-e086a090c8fd // indirect
......
...@@ -2,17 +2,17 @@ package logic ...@@ -2,17 +2,17 @@ package logic
import ( import (
"encoding/json" "encoding/json"
"github.com/go-kratos/kratos/pkg/log" "fmt"
"github.com/astaxie/beego/logs"
"scm_server/internal/dao" "scm_server/internal/dao"
"scm_server/internal/model" "scm_server/internal/model"
"scm_server/internal/service" "scm_server/internal/service"
"time" "time"
) )
func init(){ func init() {
var config log.Config logs.SetLogger(logs.AdapterFile,`{"filename":"logs/error.log","level":7,"maxlines":0,"maxsize":0,"daily":true,"maxdays":10,"color":true}`)
config.Dir = "logs" logs.Async()
log.Init(&config)
} }
const InsertSyncLogSql = "INSERT INTO `lie_sync_log` (`sync_name`,`sync_time`,`sync_error`,`unique_id`,`queue_message`,`add_time`) VALUES (?,?,?,?,?,?)" 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 ...@@ -42,6 +42,6 @@ func DealSyncError(dataByte []byte, uniqueId, syncName string, err error) error
service.SendDingTalkRobotToApi(string(msg)) service.SendDingTalkRobotToApi(string(msg))
//保存日志 //保存日志
log.Error("%s", string(msg)) logs.Error(fmt.Sprintf("%s", string(msg)))
return nil return nil
} }
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