Commit 6d1751dc by mushishixian

修复

parent 30fbbbf7
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"fmt" "fmt"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq" "github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/prometheus/common/log" "github.com/prometheus/common/log"
"time"
) )
type RecvPro struct { type RecvPro struct {
...@@ -28,7 +27,6 @@ func init() { ...@@ -28,7 +27,6 @@ func init() {
} }
func (t *RecvPro) Consumer(dataByte []byte) (err error) { func (t *RecvPro) Consumer(dataByte []byte) (err error) {
start := time.Now()
var message model.BomMessage var message model.BomMessage
if err = json.Unmarshal(dataByte, &message); err != nil { if err = json.Unmarshal(dataByte, &message); err != nil {
log.Error(err) log.Error(err)
...@@ -40,8 +38,6 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) { ...@@ -40,8 +38,6 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
if err != nil { if err != nil {
log.Error(err) log.Error(err)
} }
duration := time.Now().Sub(start)
fmt.Println(duration)
return nil return nil
} }
......
...@@ -50,7 +50,6 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching) (err er ...@@ -50,7 +50,6 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching) (err er
return return
} }
} }
for _, matching := range matchingList {
now := time.Now().Unix() now := time.Now().Unix()
if matching.IsBuy == 1 { if matching.IsBuy == 1 {
err = model.Db.Table("lie_bom_item_"+tableEnd).Where("bom_item_id = ?", matching.BomItemID). err = model.Db.Table("lie_bom_item_"+tableEnd).Where("bom_item_id = ?", matching.BomItemID).
...@@ -66,7 +65,6 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching) (err er ...@@ -66,7 +65,6 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching) (err er
} }
} }
} }
}
return nil return nil
} }
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
func main() { func main() {
var path string var path string
flag.StringVar(&path, "config", "conf/config.ini", "../conf/config.ini") flag.StringVar(&path, "config", "../conf/config.ini", "../conf/config.ini")
flag.Parse() flag.Parse()
configs.Setup(path) configs.Setup(path)
model.Setup() model.Setup()
......
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