Commit c7298005 by mushishixian

修改日志

parent c85161e6
......@@ -123,7 +123,7 @@ func SyncInStoreData(operate string, message InStoreMessage) (err error) {
} else {
url = configs.InStoreApiUrl + ""
}
req.Debug = true
req.Debug = false
billId := message.Data.FSourceBillID
if operate == "insert" {
resp, err = req.Post(url, params)
......
......@@ -127,7 +127,7 @@ func SyncOutStoreData(operate string, message OutStoreMessage) (err error) {
} else {
url = configs.OutStoreApiUrl + ""
}
req.Debug = true
req.Debug = false
billId := message.Data.FSourceBillID
if operate == "insert" {
resp, err = req.Post(url, param)
......
......@@ -10,9 +10,9 @@ import (
func main() {
message := make(map[string]interface{})
message = map[string]interface{}{
"type": "save",
"type": "save1",
"data": map[string]string{
"FID": "LxYAAAABVic3xn38",
"FID": "LxYAAAABVic3xn381",
"FNUMBER": "M0000009",
"CFNAME": "深圳市永盛微电子有限公司",
},
......
......@@ -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
......
......@@ -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))
logs.Error(fmt.Sprintf("%s", string(msg)))
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