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
efca12cc
authored
May 16, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复
parent
be521fb6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
6 deletions
cmd/source/customer/customer.go
cmd/source/data/supplier.xlsx
cmd/source/goods/goods.go
cmd/source/main.go
cmd/source/supplier/supplier.go
cmd/source/customer/customer.go
View file @
efca12cc
...
...
@@ -35,7 +35,7 @@ func Import(wg *sync.WaitGroup) {
err
error
customer
model
.
Customer
)
excelFileName
=
"./cmd/source/data/customer.xlsx"
excelFileName
=
".
.
/cmd/source/data/customer.xlsx"
xlFile
,
err
=
xlsx
.
OpenFile
(
excelFileName
)
if
err
!=
nil
{
fmt
.
Printf
(
"open failed: %s
\n
"
,
err
)
...
...
@@ -71,6 +71,8 @@ func Import(wg *sync.WaitGroup) {
fmt
.
Println
(
err
)
}
body
:=
string
(
data
)
fmt
.
Println
(
body
)
return
rabbitmq
.
Send
(
Exchange
,
body
)
}
}
...
...
cmd/source/data/supplier.xlsx
View file @
efca12cc
No preview for this file type
cmd/source/goods/goods.go
View file @
efca12cc
...
...
@@ -34,7 +34,7 @@ func Import(wg *sync.WaitGroup) {
err
error
goods
model
.
Goods
)
excelFileName
=
"./cmd/source/data/goods.xlsx"
excelFileName
=
".
.
/cmd/source/data/goods.xlsx"
xlFile
,
err
=
xlsx
.
OpenFile
(
excelFileName
)
if
err
!=
nil
{
fmt
.
Printf
(
"open failed: %s
\n
"
,
err
)
...
...
@@ -67,6 +67,8 @@ func Import(wg *sync.WaitGroup) {
fmt
.
Println
(
err
)
}
body
:=
string
(
data
)
fmt
.
Println
(
body
)
return
rabbitmq
.
Send
(
Exchange
,
body
)
}
}
...
...
cmd/source/main.go
View file @
efca12cc
...
...
@@ -11,7 +11,7 @@ import (
func
main
()
{
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
()
configs
.
Setup
(
path
)
var
wg
sync
.
WaitGroup
...
...
cmd/source/supplier/supplier.go
View file @
efca12cc
...
...
@@ -3,13 +3,14 @@ package supplier
import
(
"encoding/json"
"fmt"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/tealeg/xlsx"
"scm_server/configs"
"scm_server/internal/logic"
"scm_server/internal/model"
"scm_server/internal/service"
"sync"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/tealeg/xlsx"
)
var
Exchange
rabbitmq
.
QueueExchange
...
...
@@ -37,7 +38,7 @@ func Import(wg *sync.WaitGroup) {
err
error
supplier
model
.
Supplier
)
excelFileName
=
"./cmd/source/data/supplier.xlsx"
excelFileName
=
".
.
/cmd/source/data/supplier.xlsx"
xlFile
,
err
=
xlsx
.
OpenFile
(
excelFileName
)
if
err
!=
nil
{
fmt
.
Printf
(
"open failed: %s
\n
"
,
err
)
...
...
@@ -67,6 +68,8 @@ func Import(wg *sync.WaitGroup) {
fmt
.
Println
(
err
)
}
body
:=
string
(
data
)
fmt
.
Println
(
body
)
return
rabbitmq
.
Send
(
Exchange
,
body
)
}
}
...
...
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