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
da7e1d1e
authored
May 16, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复大小写敏感
parent
3d3630c4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
25 deletions
cmd/source/customer/customer.go
cmd/source/goods/goods.go
cmd/source/main.go
cmd/source/supplier/supplier.go
internal/logic/customer.go
internal/logic/goods.go
internal/logic/supplier.go
cmd/source/customer/customer.go
View file @
da7e1d1e
...
...
@@ -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/goods/goods.go
View file @
da7e1d1e
...
...
@@ -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 @
da7e1d1e
...
...
@@ -2,8 +2,6 @@ package main
import
(
"flag"
"scm_server/cmd/source/customer"
"scm_server/cmd/source/goods"
"scm_server/cmd/source/supplier"
"scm_server/configs"
"sync"
...
...
@@ -15,9 +13,9 @@ func main() {
flag
.
Parse
()
configs
.
Setup
(
path
)
var
wg
sync
.
WaitGroup
wg
.
Add
(
3
)
wg
.
Add
(
1
)
go
supplier
.
Import
(
&
wg
)
go
customer
.
Import
(
&
wg
)
go
goods
.
Import
(
&
wg
)
//
go customer.Import(&wg)
//
go goods.Import(&wg)
wg
.
Wait
()
}
cmd/source/supplier/supplier.go
View file @
da7e1d1e
...
...
@@ -68,6 +68,8 @@ func Import(wg *sync.WaitGroup) {
fmt
.
Println
(
err
)
}
body
:=
string
(
data
)
fmt
.
Println
(
body
)
return
rabbitmq
.
Send
(
Exchange
,
body
)
}
}
...
...
internal/logic/customer.go
View file @
da7e1d1e
...
...
@@ -6,19 +6,19 @@ import (
"time"
)
const
CheckCustomerExistSql
=
"SELECT customer_id FROM lie_customer WHERE erp_id = ?"
const
CheckCustomerExistSql
=
"SELECT customer_id FROM lie_customer WHERE
binary
erp_id = ?"
const
CheckCustomerSyncStatusSql
=
"SELECT sync_status FROM lie_customer WHERE erp_id = ?"
const
CheckCustomerSyncStatusSql
=
"SELECT sync_status FROM lie_customer WHERE
binary
erp_id = ?"
const
InsertCustomerSql
=
"Insert INTO `lie_customer` (`erp_client_code`,`name`,`erp_id`,`add_time`,`sync_status`) VALUES (?,?,?,?,?)"
const
UpdateCustomerSql
=
"UPDATE `lie_customer` SET `erp_client_code` = ? , `name` = ? , `update_time` = ? WHERE `erp_id` = ?"
const
UpdateCustomerSql
=
"UPDATE `lie_customer` SET `erp_client_code` = ? , `name` = ? , `update_time` = ? WHERE
binary
`erp_id` = ?"
const
DeleteCustomerSql
=
"UPDATE `lie_customer` SET `status` = ? , `update_time` = ? WHERE `erp_id` = ?"
const
DeleteCustomerSql
=
"UPDATE `lie_customer` SET `status` = ? , `update_time` = ? WHERE
binary
`erp_id` = ?"
const
SyncCustomerSuccessSql
=
"UPDATE `lie_customer` SET sync_status = 1 , sync_time = ? WHERE erp_id = ?"
const
SyncCustomerSuccessSql
=
"UPDATE `lie_customer` SET sync_status = 1 , sync_time = ? WHERE
binary
erp_id = ?"
const
SyncCustomerErpSuccessSql
=
"UPDATE `lie_customer` SET sync_erp_status = 1 , sync_time = ? WHERE erp_id = ?"
const
SyncCustomerErpSuccessSql
=
"UPDATE `lie_customer` SET sync_erp_status = 1 , sync_time = ? WHERE
binary
erp_id = ?"
//修改同步到erp成功的状态
func
SyncCustomerErpSuccess
(
erpId
string
)
(
err
error
)
{
...
...
internal/logic/goods.go
View file @
da7e1d1e
...
...
@@ -6,21 +6,21 @@ import (
"time"
)
const
CheckGoodsExistSql
=
"SELECT goods_id FROM lie_goods WHERE erp_id = ?"
const
CheckGoodsExistSql
=
"SELECT goods_id FROM lie_goods WHERE
binary
erp_id = ?"
const
CheckGoodsSyncStatusSql
=
"SELECT sync_status FROM lie_goods WHERE erp_id = ?"
const
CheckGoodsSyncStatusSql
=
"SELECT sync_status FROM lie_goods WHERE
binary
erp_id = ?"
const
InsertGoodsSql
=
"INSERT INTO `lie_goods` (`goods_name`,`goods_cn_name`,`brand_name`,`erp_id`,`add_time`,`sync_status`) VALUES (?,?,?,?,?,?)"
const
UpdateGoodsSql
=
"UPDATE `lie_goods` SET `goods_name` = ? , `goods_cn_name` = ? , `brand_name` = ? , `update_time` = ? WHERE `erp_id` = ?"
const
UpdateGoodsSql
=
"UPDATE `lie_goods` SET `goods_name` = ? , `goods_cn_name` = ? , `brand_name` = ? , `update_time` = ? WHERE
binary
`erp_id` = ?"
const
DeleteGoodsSql
=
"UPDATE `lie_goods` SET `status` = ? , `update_time` = ? WHERE `erp_id` = ?"
const
DeleteGoodsSql
=
"UPDATE `lie_goods` SET `status` = ? , `update_time` = ? WHERE
binary
`erp_id` = ?"
const
SyncGoodsSuccessSql
=
"UPDATE `lie_goods` SET sync_status = 1 , sync_time = ? WHERE erp_id = ?"
const
SyncGoodsSuccessSql
=
"UPDATE `lie_goods` SET sync_status = 1 , sync_time = ? WHERE
binary
erp_id = ?"
const
SyncGoodsSuccessWithStatusSql
=
"UPDATE `lie_goods` SET sync_status = 1 , sync_time = ? , status = ? WHERE erp_id = ?"
const
SyncGoodsSuccessWithStatusSql
=
"UPDATE `lie_goods` SET sync_status = 1 , sync_time = ? , status = ? WHERE
binary
erp_id = ?"
const
SyncGoodsErpSuccessSql
=
"UPDATE `lie_goods` SET sync_erp_status = 1 , sync_time = ? WHERE erp_id = ?"
const
SyncGoodsErpSuccessSql
=
"UPDATE `lie_goods` SET sync_erp_status = 1 , sync_time = ? WHERE
binary
erp_id = ?"
//修改同步到erp成功的状态
func
SyncGoodsErpSuccess
(
erpId
string
)
(
err
error
)
{
...
...
internal/logic/supplier.go
View file @
da7e1d1e
...
...
@@ -6,21 +6,21 @@ import (
"time"
)
const
CheckSupplierExistSql
=
"SELECT supplier_id FROM lie_supplier WHERE erp_id = ?"
const
CheckSupplierExistSql
=
"SELECT supplier_id FROM lie_supplier WHERE
binary
erp_id = ?"
const
CheckSupplierSyncStatusSql
=
"SELECT sync_status FROM lie_supplier WHERE erp_id = ?"
const
CheckSupplierSyncStatusSql
=
"SELECT sync_status FROM lie_supplier WHERE
binary
erp_id = ?"
const
InsertSupplierSql
=
"Insert INTO `lie_supplier` (`erp_supplier_code`,`name`,`erp_id`,`add_time`,`sync_status`) VALUES (?,?,?,?,?)"
const
UpdateSupplierSql
=
"UPDATE `lie_supplier` SET `erp_supplier_code` = ? , `name` = ? , `update_time` = ? WHERE `erp_id` = ?"
const
UpdateSupplierSql
=
"UPDATE `lie_supplier` SET `erp_supplier_code` = ? , `name` = ? , `update_time` = ? WHERE
binary
`erp_id` = ?"
const
DeleteSupplierSql
=
"UPDATE `lie_supplier` SET `status` = ? , `update_time` = ? WHERE `erp_id` = ?"
const
DeleteSupplierSql
=
"UPDATE `lie_supplier` SET `status` = ? , `update_time` = ? WHERE
binary
`erp_id` = ?"
const
WriteSupplierSyncErrorSql
=
"UPDATE `lie_supplier` SET sync_time = ? , sync_status = ? , sync_error = ? WHERE erp_id = ?"
const
WriteSupplierSyncErrorSql
=
"UPDATE `lie_supplier` SET sync_time = ? , sync_status = ? , sync_error = ? WHERE
binary
erp_id = ?"
const
SyncSupplierSuccessSql
=
"UPDATE `lie_supplier` SET sync_status = 1 , sync_time = ? WHERE erp_id = ?"
const
SyncSupplierSuccessSql
=
"UPDATE `lie_supplier` SET sync_status = 1 , sync_time = ? WHERE
binary
erp_id = ?"
const
SyncSupplierErpSuccessSql
=
"UPDATE `lie_supplier` SET sync_erp_status = 1 , sync_time = ? WHERE erp_id = ?"
const
SyncSupplierErpSuccessSql
=
"UPDATE `lie_supplier` SET sync_erp_status = 1 , sync_time = ? WHERE
binary
erp_id = ?"
//修改同步到erp成功的状态
func
SyncSupplierErpSuccess
(
erpId
string
)
(
err
error
)
{
...
...
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