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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
23 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,24 +56,26 @@ func SendDingTalkRobotToApi(content string) {
...
@@ -56,24 +56,26 @@ func SendDingTalkRobotToApi(content string) {
}
}
func
SendDingTalkRobotToApi1
(
content
string
)
{
func
SendDingTalkRobotToApi1
(
content
string
)
{
var
(
go
func
()
{
requestData
DingDingRequest
var
(
apiUrl
,
token
string
requestData
DingDingRequest
//resp *req.Resp
apiUrl
,
token
string
err
error
//resp *req.Resp
)
err
error
content
=
"仓储同步告警 : "
+
content
)
requestData
.
MsgType
=
"text"
content
=
"仓储同步告警 : "
+
content
requestData
.
Text
=
map
[
string
]
string
{
requestData
.
MsgType
=
"text"
"content"
:
content
,
requestData
.
Text
=
map
[
string
]
string
{
}
"content"
:
content
,
req
.
Debug
=
false
}
requestData
.
IsAtAll
=
false
req
.
Debug
=
false
token
=
"3c048caba514a5252aa8bdbb3e10994def6409a2f0d5212e5626c1a071152ec3"
requestData
.
IsAtAll
=
false
apiUrl
=
"https://api.ichunt.com/public/dingtalkrobot?access_token="
+
token
token
=
"3c048caba514a5252aa8bdbb3e10994def6409a2f0d5212e5626c1a071152ec3"
params
:=
req
.
BodyJSON
(
requestData
)
apiUrl
=
"https://api.ichunt.com/public/dingtalkrobot?access_token="
+
token
_
,
err
=
req
.
Post
(
apiUrl
,
params
)
params
:=
req
.
BodyJSON
(
requestData
)
if
err
!=
nil
{
_
,
err
=
req
.
Post
(
apiUrl
,
params
)
fmt
.
Println
(
err
)
if
err
!=
nil
{
}
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