Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
scm_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c034f2e2
authored
Apr 23, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
设置串行
parent
d38f1a71
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
15 deletions
cmd/queue/sync_customer/main.go
cmd/queue/sync_goods/main.go
cmd/queue/sync_status/main.go
cmd/queue/sync_supplier/main.go
cmd/queue/sync_supplier/product.go
cmd/source/main.go
cmd/source/supplier/supplier.go
cmd/queue/sync_customer/main.go
View file @
c034f2e2
...
@@ -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
)
}
}
cmd/queue/sync_goods/main.go
View file @
c034f2e2
...
@@ -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
)
}
}
cmd/queue/sync_status/main.go
View file @
c034f2e2
...
@@ -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
)
}
}
cmd/queue/sync_supplier/main.go
View file @
c034f2e2
...
@@ -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
)
}
}
cmd/queue/sync_supplier/product.go
View file @
c034f2e2
...
@@ -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"
:
"Z8eVSzSLRXKa7ET9WHFzYagYZf017
1
="
,
"FID"
:
"Z8eVSzSLRXKa7ET9WHFzYagYZf017
ff
="
,
"FNUMBER"
:
"WT0050333"
,
"FNUMBER"
:
"WT0050333"
,
"CFNAME"
:
"深圳市鼎驰达电子有限公司"
,
"CFNAME"
:
"深圳市鼎驰达电子有限公司
11
"
,
},
},
}
}
data
,
err
:=
json
.
Marshal
(
message
)
data
,
err
:=
json
.
Marshal
(
message
)
...
...
cmd/source/main.go
View file @
c034f2e2
package
main
package
main
import
"scm_server/cmd/source/
custom
er"
import
"scm_server/cmd/source/
suppli
er"
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()
}
}
cmd/source/supplier/supplier.go
View file @
c034f2e2
...
@@ -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_
custom
er"
,
"store_
suppli
er"
,
"store_
custom
er"
,
"store_
suppli
er"
,
"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
{})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment