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
2e4514cf
authored
May 14, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复bug
parent
b84f05fc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
3 deletions
cmd/queue/sync_out_store/main.go
cmd/queue/sync_out_store/product/product.go
conf/config.ini
internal/service/dingding.go
cmd/queue/sync_out_store/main.go
View file @
2e4514cf
...
@@ -64,15 +64,15 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
...
@@ -64,15 +64,15 @@ func (t *RecvPro) Consumer(dataByte []byte) error {
//判断操作类型
//判断操作类型
switch
message
.
Type
{
switch
message
.
Type
{
case
"save"
:
case
"save"
:
operateType
=
"insert"
outStore
.
BillId
=
message
.
Data
.
FSourceBillID
outStore
.
BillId
=
message
.
Data
.
FSourceBillID
messageData
,
err
=
json
.
Marshal
(
&
message
)
messageData
,
err
=
json
.
Marshal
(
&
message
)
if
err
!=
nil
{
if
err
!=
nil
{
goto
ERR
goto
ERR
}
}
outStore
.
QueueMessage
=
string
(
messageData
)
outStore
.
QueueMessage
=
string
(
messageData
)
//先去查询是否存在
,不存在才去插入,已经存在即是修改
//先去查询是否存在
已经同步完成的记录
if
!
logic
.
CheckOutStoreSyncStatus
(
outStore
.
BillId
)
{
if
!
logic
.
CheckOutStoreSyncStatus
(
outStore
.
BillId
)
{
operateType
=
"insert"
if
err
=
logic
.
InsertOutStore
(
outStore
);
err
!=
nil
{
if
err
=
logic
.
InsertOutStore
(
outStore
);
err
!=
nil
{
goto
ERR
goto
ERR
}
}
...
...
cmd/queue/sync_out_store/product/product.go
View file @
2e4514cf
...
@@ -57,6 +57,7 @@ func main() {
...
@@ -57,6 +57,7 @@ func main() {
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
}
}
body
:=
string
(
data
)
body
:=
string
(
data
)
body
=
`{"type":"save","data":{"FEntrustBillNo":"B05438","FWarehouseNo":"002","FDeliveryTypeNo":"deliveryTerms0003","FPrincipalNo":"WT00683","FSourceBillID":"7aJKpxihRW+LqF7MXDosLO+cpps=","FEntrys":[{"FQty":20,"FSourceBillEntryID":"EYTqfK7nT46e1Ek63QR6dcLaWpc=","FMaterialID":"Hcew0urxRmKVS4bYh6rDQ0QJ5/A=","FUnit":"\u4E2A","FBrand":"BRAND","FOriginCountry":"115","CFIsInsp":false,"FPrice":3.0045,"FGoods":"\u7535\u78C1\u5E72\u6270\u6EE4\u6CE2\u5668","FModel":"sfg"}],"FIsCustoms":true,"FErpPostRequistionBillNo":"FKFH202005147729"}}`
queueExchange
:=
rabbitmq
.
QueueExchange
{
queueExchange
:=
rabbitmq
.
QueueExchange
{
"store_out"
,
"store_out"
,
"store_out"
,
"store_out"
,
...
...
conf/config.ini
View file @
2e4514cf
...
@@ -9,7 +9,7 @@ url = "amqp://huntadmin:jy2y2900@192.168.1.237:5672/"
...
@@ -9,7 +9,7 @@ url = "amqp://huntadmin:jy2y2900@192.168.1.237:5672/"
[api]
[api]
base
=
http://192.168.2.232:40001
base
=
http://192.168.2.232:40001
out_store
=
http://192.168.2.
179
:40003
out_store
=
http://192.168.2.
232
:40003
in_store
=
http://192.168.2.232:40004
in_store
=
http://192.168.2.232:40004
erp_sync_base_data_status
=
http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl
erp_sync_base_data_status
=
http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl
erp_sync_bill_status
=
http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl
erp_sync_bill_status
=
http://192.168.2.253:6888/ormrpc/services/WSInventoryManagementFacade?wsdl
...
...
internal/service/dingding.go
View file @
2e4514cf
...
@@ -56,6 +56,7 @@ func SendDingTalkRobotToApi(content string) {
...
@@ -56,6 +56,7 @@ func SendDingTalkRobotToApi(content string) {
}
}
func
SendDingTalkRobotToApi1
(
content
string
)
{
func
SendDingTalkRobotToApi1
(
content
string
)
{
go
func
()
{
var
(
var
(
requestData
DingDingRequest
requestData
DingDingRequest
apiUrl
,
token
string
apiUrl
,
token
string
...
@@ -76,4 +77,5 @@ func SendDingTalkRobotToApi1(content string) {
...
@@ -76,4 +77,5 @@ func SendDingTalkRobotToApi1(content string) {
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
}
}
}()
}
}
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