Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wang
/
go_upload_sync
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
6f79295a
authored
Jun 01, 2021
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
3a1909fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
app/service/upload_sku_sync.go
app/service/upload_sku_sync.go
View file @
6f79295a
...
@@ -115,7 +115,11 @@ func (this *UploadSkuSync) handle() {
...
@@ -115,7 +115,11 @@ func (this *UploadSkuSync) handle() {
uploadInfo
,
err
:=
dao
.
GetUploadLogInfo
(
this
.
SkuRes
.
UpSn
)
uploadInfo
,
err
:=
dao
.
GetUploadLogInfo
(
this
.
SkuRes
.
UpSn
)
//如果sku是新增,就压入队列 es_sku_add
//如果sku是新增,就压入队列 es_sku_add
this
.
PushInsertSkuMq
(
uploadInfo
,
updateItemStruct
)
handleFlag
:=
this
.
PushInsertSkuMq
(
uploadInfo
,
updateItemStruct
)
if
(
!
handleFlag
){
msg
:=
fmt
.
Sprintf
(
"没有返回值,原始队列字符串为:%s"
,
this
.
SkuRes
)
this
.
dingdingSucessPush
(
msg
)
}
//修改UpdateLogItem 表
//修改UpdateLogItem 表
err
=
dao
.
UpdateLogItem
(
this
.
SkuRes
.
UpSn
,
this
.
SkuRes
.
UploadLogId
,
updateItemStruct
)
err
=
dao
.
UpdateLogItem
(
this
.
SkuRes
.
UpSn
,
this
.
SkuRes
.
UploadLogId
,
updateItemStruct
)
...
@@ -174,8 +178,9 @@ func (this *UploadSkuSync)PushWechatMsg(uploadInfo *dao.UpdatesUploadStruct) {
...
@@ -174,8 +178,9 @@ func (this *UploadSkuSync)PushWechatMsg(uploadInfo *dao.UpdatesUploadStruct) {
}
}
//如果sku是新增,就压入队列 es_sku_add
//如果sku是新增,就压入队列 es_sku_add
func
(
this
*
UploadSkuSync
)
PushInsertSkuMq
(
uploadInfo
*
dao
.
UpdatesUploadStruct
,
updateItemStruct
dao
.
UpdateItemStruct
)
{
func
(
this
*
UploadSkuSync
)
PushInsertSkuMq
(
uploadInfo
*
dao
.
UpdatesUploadStruct
,
updateItemStruct
dao
.
UpdateItemStruct
)
bool
{
fmt
.
Println
(
"进入 PushInsertSkuMq 函数"
)
fmt
.
Printf
(
"单号:%s,skuid:%d;的状态为%d
\n
"
,
uploadInfo
.
UpSn
,
updateItemStruct
.
SkuId
,
updateItemStruct
.
SkuStatus
)
fmt
.
Printf
(
"单号:%s,skuid:%d;的状态为%d
\n
"
,
uploadInfo
.
UpSn
,
updateItemStruct
.
SkuId
,
updateItemStruct
.
SkuStatus
)
if
(
updateItemStruct
.
SkuStatus
==
1
){
if
(
updateItemStruct
.
SkuStatus
==
1
){
...
@@ -188,13 +193,15 @@ func (this *UploadSkuSync) PushInsertSkuMq(uploadInfo *dao.UpdatesUploadStruct,u
...
@@ -188,13 +193,15 @@ func (this *UploadSkuSync) PushInsertSkuMq(uploadInfo *dao.UpdatesUploadStruct,u
msg
:=
fmt
.
Sprintf
(
"推送新增sku队列,解析为json报错"
)
msg
:=
fmt
.
Sprintf
(
"推送新增sku队列,解析为json报错"
)
fmt
.
Println
(
msg
)
fmt
.
Println
(
msg
)
this
.
dingdingSucessPush
(
msg
);
this
.
dingdingSucessPush
(
msg
);
return
return
true
//return fmt.Errorf(msg)
}
}
listMsg
:=
string
(
bytes
)
listMsg
:=
string
(
bytes
)
fmt
.
Printf
(
"单号:%s,skuid:%d ;发送 es_sku_add 队列
\n
,data:%s"
,
uploadInfo
.
UpSn
,
updateItemStruct
.
SkuId
,
listMsg
)
fmt
.
Printf
(
"单号:%s,skuid:%d ;发送 es_sku_add 队列
\n
,data:%s"
,
uploadInfo
.
UpSn
,
updateItemStruct
.
SkuId
,
listMsg
)
listName
:=
"es_sku_add"
listName
:=
"es_sku_add"
this
.
rabbitmqPush
(
listName
,
listMsg
)
this
.
rabbitmqPush
(
listName
,
listMsg
)
}
}
return
true
}
}
//after2 := time.After(2*time.Second)
//after2 := time.After(2*time.Second)
//push到下架商品的队列
//push到下架商品的队列
...
...
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