Commit c034f2e2 by mushishixian

设置串行

parent d38f1a71
...@@ -200,5 +200,5 @@ func main() { ...@@ -200,5 +200,5 @@ func main() {
"store", "store",
"direct", "direct",
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/", "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
}, t, 3) }, t, 1)
} }
...@@ -203,5 +203,5 @@ func main() { ...@@ -203,5 +203,5 @@ func main() {
"store", "store",
"direct", "direct",
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/", "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
}, t, 3) }, t, 1)
} }
...@@ -50,5 +50,5 @@ func main() { ...@@ -50,5 +50,5 @@ func main() {
"store", "store",
"direct", "direct",
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/", "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
}, t, 3) }, t, 1)
} }
...@@ -177,5 +177,5 @@ func main() { ...@@ -177,5 +177,5 @@ func main() {
"store", "store",
"direct", "direct",
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/", "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
}, t, 3) }, t, 1)
} }
...@@ -11,9 +11,9 @@ func main() { ...@@ -11,9 +11,9 @@ func main() {
message = map[string]interface{}{ message = map[string]interface{}{
"type": "save", "type": "save",
"data": map[string]string{ "data": map[string]string{
"FID": "Z8eVSzSLRXKa7ET9WHFzYagYZf0171=", "FID": "Z8eVSzSLRXKa7ET9WHFzYagYZf017ff=",
"FNUMBER": "WT0050333", "FNUMBER": "WT0050333",
"CFNAME": "深圳市鼎驰达电子有限公司", "CFNAME": "深圳市鼎驰达电子有限公司11",
}, },
} }
data,err := json.Marshal(message) data,err := json.Marshal(message)
......
package main package main
import "scm_server/cmd/source/customer" import "scm_server/cmd/source/supplier"
func main() { func main() {
//forever := make(chan bool) //forever := make(chan bool)
//go supplier.Import() //go supplier.Import()
//supplier.Import() supplier.Import()
//<-forever //<-forever
customer.Import() //customer.Import()
//goods.Import() //goods.Import()
} }
...@@ -14,8 +14,8 @@ var Exchange rabbitmq.QueueExchange ...@@ -14,8 +14,8 @@ var Exchange rabbitmq.QueueExchange
//导入委托方的信息(excel导入) //导入委托方的信息(excel导入)
func init() { func init() {
Exchange = rabbitmq.QueueExchange{ Exchange = rabbitmq.QueueExchange{
"store_customer", "store_supplier",
"store_customer", "store_supplier",
"store", "store",
"direct", "direct",
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/", "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
...@@ -35,7 +35,6 @@ func Import() { ...@@ -35,7 +35,6 @@ func Import() {
if err != nil { if err != nil {
fmt.Printf("open failed: %s\n", err) fmt.Printf("open failed: %s\n", err)
} }
i := 0
for _, sheet := range xlFile.Sheets { for _, sheet := range xlFile.Sheets {
for key, row := range sheet.Rows { for key, row := range sheet.Rows {
if key > 0 { if key > 0 {
...@@ -44,9 +43,7 @@ func Import() { ...@@ -44,9 +43,7 @@ func Import() {
supplier.Name = row.Cells[2].String() supplier.Name = row.Cells[2].String()
//去数据库检测是否已经同步过了 //去数据库检测是否已经同步过了
if exist := logic.CheckSupplierExist(supplier.ErpId); exist { if exist := logic.CheckSupplierExist(supplier.ErpId); exist {
i++ //fmt.Println("已存在,跳过")
fmt.Println("已存在,跳过")
fmt.Println(i)
continue continue
} }
message := make(map[string]interface{}) message := make(map[string]interface{})
......
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