Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
go_supplier_sever
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
673612a2
authored
Sep 24, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
d1d7af2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
app/dao/supplier.go
app/service/supplier_sku_mode.go
app/dao/supplier.go
View file @
673612a2
...
...
@@ -77,7 +77,7 @@ func UpdateSupplierSkuMode(supplierId, skuMode int) (err error) {
}
supplier
.
SkuMode
=
skuMode
//还要去写映射表lie_supplier_merger_mapping
_
,
err
=
Dao
.
GetDb
(
"supplier"
)
.
Table
(
"lie_supplier_channel"
)
.
Cols
(
"sku_mode"
)
.
Where
(
"supplier_id = ?"
,
supplierId
)
.
Update
(
supplier
)
_
,
err
=
Dao
.
GetDb
(
"supplier"
)
.
Table
(
"lie_supplier_channel"
)
.
Where
(
"supplier_id = ?"
,
supplierId
)
.
Cols
(
"sku_mode"
)
.
Update
(
supplier
)
if
err
!=
nil
{
return
err
}
...
...
app/service/supplier_sku_mode.go
View file @
673612a2
...
...
@@ -33,6 +33,7 @@ func SaveSkuModeFromES() (err error) {
}
result
:=
resp
.
String
()
goodsIdArr
:=
gjson
.
Get
(
result
,
"data.goods_id"
)
.
Array
()
fmt
.
Println
(
"当前处理供应商为 : "
,
supplier
.
SupplierName
)
if
len
(
goodsIdArr
)
>
0
{
//取一个goods_id就好
goodsId
:=
goodsIdArr
[
0
]
.
String
()
...
...
@@ -41,7 +42,7 @@ func SaveSkuModeFromES() (err error) {
redisCon
:=
dao
.
Dao
.
GetRedisDbGroup
(
"sku"
)
result
:=
redisCon
.
HGet
(
"goods_tag"
,
goodsId
)
.
String
()
goodsLabel
:=
gjson
.
Get
(
result
,
"goods_label"
)
.
Int
()
//
fmt.Println("供应商名称 : "+supplier.SupplierName+" goods_label为 : ", goodsLabel)
fmt
.
Println
(
"供应商名称 : "
+
supplier
.
SupplierName
+
" goods_label为 : "
,
goodsLabel
)
if
int
(
goodsLabel
)
!=
0
{
fmt
.
Println
(
supplier
.
SupplierId
,
goodsLabel
)
err
=
dao
.
UpdateSupplierSkuMode
(
supplier
.
SupplierId
,
int
(
goodsLabel
))
...
...
@@ -55,7 +56,7 @@ func SaveSkuModeFromES() (err error) {
return
err
}
}
}
else
{
}
else
{
err
=
dao
.
UpdateSupplierSkuMode
(
supplier
.
SupplierId
,
0
)
if
err
!=
nil
{
return
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