Commit efca12cc by mushishixian

修复

parent be521fb6
...@@ -35,7 +35,7 @@ func Import(wg *sync.WaitGroup) { ...@@ -35,7 +35,7 @@ func Import(wg *sync.WaitGroup) {
err error err error
customer model.Customer customer model.Customer
) )
excelFileName = "./cmd/source/data/customer.xlsx" excelFileName = "../cmd/source/data/customer.xlsx"
xlFile, err = xlsx.OpenFile(excelFileName) xlFile, err = xlsx.OpenFile(excelFileName)
if err != nil { if err != nil {
fmt.Printf("open failed: %s\n", err) fmt.Printf("open failed: %s\n", err)
...@@ -71,6 +71,8 @@ func Import(wg *sync.WaitGroup) { ...@@ -71,6 +71,8 @@ func Import(wg *sync.WaitGroup) {
fmt.Println(err) fmt.Println(err)
} }
body := string(data) body := string(data)
fmt.Println(body)
return
rabbitmq.Send(Exchange, body) rabbitmq.Send(Exchange, body)
} }
} }
......
...@@ -34,7 +34,7 @@ func Import(wg *sync.WaitGroup) { ...@@ -34,7 +34,7 @@ func Import(wg *sync.WaitGroup) {
err error err error
goods model.Goods goods model.Goods
) )
excelFileName = "./cmd/source/data/goods.xlsx" excelFileName = "../cmd/source/data/goods.xlsx"
xlFile, err = xlsx.OpenFile(excelFileName) xlFile, err = xlsx.OpenFile(excelFileName)
if err != nil { if err != nil {
fmt.Printf("open failed: %s\n", err) fmt.Printf("open failed: %s\n", err)
...@@ -67,6 +67,8 @@ func Import(wg *sync.WaitGroup) { ...@@ -67,6 +67,8 @@ func Import(wg *sync.WaitGroup) {
fmt.Println(err) fmt.Println(err)
} }
body := string(data) body := string(data)
fmt.Println(body)
return
rabbitmq.Send(Exchange, body) rabbitmq.Send(Exchange, body)
} }
} }
......
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,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)
var wg sync.WaitGroup var wg sync.WaitGroup
......
...@@ -3,13 +3,14 @@ package supplier ...@@ -3,13 +3,14 @@ package supplier
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/tealeg/xlsx"
"scm_server/configs" "scm_server/configs"
"scm_server/internal/logic" "scm_server/internal/logic"
"scm_server/internal/model" "scm_server/internal/model"
"scm_server/internal/service" "scm_server/internal/service"
"sync" "sync"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/tealeg/xlsx"
) )
var Exchange rabbitmq.QueueExchange var Exchange rabbitmq.QueueExchange
...@@ -37,7 +38,7 @@ func Import(wg *sync.WaitGroup) { ...@@ -37,7 +38,7 @@ func Import(wg *sync.WaitGroup) {
err error err error
supplier model.Supplier supplier model.Supplier
) )
excelFileName = "./cmd/source/data/supplier.xlsx" excelFileName = "../cmd/source/data/supplier.xlsx"
xlFile, err = xlsx.OpenFile(excelFileName) xlFile, err = xlsx.OpenFile(excelFileName)
if err != nil { if err != nil {
fmt.Printf("open failed: %s\n", err) fmt.Printf("open failed: %s\n", err)
...@@ -67,6 +68,8 @@ func Import(wg *sync.WaitGroup) { ...@@ -67,6 +68,8 @@ func Import(wg *sync.WaitGroup) {
fmt.Println(err) fmt.Println(err)
} }
body := string(data) body := string(data)
fmt.Println(body)
return
rabbitmq.Send(Exchange, body) rabbitmq.Send(Exchange, body)
} }
} }
......
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