Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_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
70fa074a
authored
Nov 10, 2025
by
hcy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
并发问题
parent
64ff5f14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
service/service_spu.go
service/service_spu.go
View file @
70fa074a
...
...
@@ -103,6 +103,7 @@ func (ss *SpuService) SetInit(redisLySkuArr map[string]string, zyGoodsId, lyGood
for
goods_id
,
info
:=
range
redisLySkuArr
{
supplierId
:=
gjson
.
Get
(
info
,
"supplier_id"
)
.
Int
()
supplierIdStr
:=
gconv
.
String
(
supplierId
)
source
:=
gjson
.
Get
(
info
,
"source"
)
.
Int
()
canal
:=
gjson
.
Get
(
info
,
"canal"
)
.
String
()
...
...
@@ -114,8 +115,8 @@ func (ss *SpuService) SetInit(redisLySkuArr map[string]string, zyGoodsId, lyGood
if
canal
!=
""
{
canals
=
append
(
canals
,
canal
)
}
if
supplierId
!=
17
&&
!
php2go
.
InArray
(
supplierId
,
supplierIds
)
{
supplierIds
=
append
(
supplierIds
,
gconv
.
String
(
supplierId
)
)
if
supplierId
!=
17
&&
!
php2go
.
InArray
(
supplierId
Str
,
supplierIds
)
{
supplierIds
=
append
(
supplierIds
,
supplierIdStr
)
}
if
php2go
.
InArray
(
supplierId
,
[]
int
{
7
,
13
,
1688
,
17
})
{
needRawGoodsIds
=
append
(
needRawGoodsIds
,
goods_id
)
...
...
@@ -144,15 +145,16 @@ func (ss *SpuService) SetInit(redisLySkuArr map[string]string, zyGoodsId, lyGood
GoodsLabelTags
=
gredis
.
Hmget
(
"default_r"
,
"goods_source_tags"
,
[]
string
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
})
//批量获取原始编码
if
needRawGoodsIds
!=
nil
{
if
len
(
needRawGoodsIds
)
>
0
{
AllSkuRawMap
=
gredis
.
Hmget
(
"default_r"
,
"sku_raw_map"
,
needRawGoodsIds
)
}
//批量获取锁库信息
if
zyGoodsId
!=
nil
{
if
len
(
zyGoodsId
)
>
0
{
AllSkuLockMap
=
gredis
.
Hmget
(
"default_r"
,
"sku_lock_stock"
,
zyGoodsId
)
//所有锁库信息
}
//查询附加费
if
needExtendFeeId
!=
nil
{
if
len
(
needExtendFeeId
)
>
0
{
AllExtendFee
=
make
(
map
[
string
]
interface
{})
redisFeeArr
:=
gredis
.
Hmget
(
"default_r"
,
"supp_extend_fee"
,
needExtendFeeId
)
for
keyOne
,
feeone
:=
range
redisFeeArr
{
if
feeone
==
""
{
...
...
@@ -177,7 +179,8 @@ func (ss *SpuService) SetInit(redisLySkuArr map[string]string, zyGoodsId, lyGood
}
}
//获取供应商货期
if
canals
!=
nil
{
//专营货期
AllDelivery
=
make
(
map
[
string
]
map
[
string
]
string
,
0
)
if
len
(
canals
)
>
0
{
//专营货期
supplierRatios
:=
gredis
.
Hmget
(
"default_r"
,
"supp_ratio"
,
canals
)
for
dkey
,
supplierRatio
:=
range
supplierRatios
{
if
supplierRatio
==
""
{
...
...
@@ -200,24 +203,28 @@ func (ss *SpuService) SetInit(redisLySkuArr map[string]string, zyGoodsId, lyGood
}
}
}
if
supplierIds
!=
nil
{
//代购货期
if
len
(
supplierIds
)
>
0
{
//代购货期
supplierRatios
:=
gredis
.
Hmget
(
"default_r"
,
"SUPPLIER_REDIS_INFO_"
,
supplierIds
)
for
dkey
,
sinfo
:=
range
supplierRatios
{
cnDelivery
:=
gjson
.
Get
(
sinfo
,
"cn_delivery"
)
.
String
()
hkDelivery
:=
gjson
.
Get
(
sinfo
,
"hk_delivery"
)
.
String
()
if
cnDelivery
!=
""
||
hkDelivery
!=
""
{
AllDelivery
[
dkey
][
"cn_delivery"
]
=
cnDelivery
AllDelivery
[
dkey
][
"hk_delivery"
]
=
hkDelivery
return
AllDelivery
[
dkey
]
=
map
[
string
]
string
{
"cn_delivery"
:
cnDelivery
,
"hk_delivery"
:
hkDelivery
,
}
}
else
{
AllDelivery
[
dkey
][
"cn_delivery"
]
=
""
AllDelivery
[
dkey
][
"hk_delivery"
]
=
""
AllDelivery
[
dkey
]
=
map
[
string
]
string
{
"cn_delivery"
:
""
,
"hk_delivery"
:
""
,
}
}
}
}
//批量获取联营tags-标签
if
lyGoodsId
!=
nil
{
if
len
(
lyGoodsId
)
>
0
{
AllLyGoodsTag
=
make
(
map
[
string
]
model
.
GoodsTag
,
0
)
goodsTagArr
:=
gredis
.
Hmget
(
"default_r"
,
"goods_tag"
,
lyGoodsId
)
var
tags
[]
int
for
goods_id
,
goodsTagsStr
:=
range
goodsTagArr
{
...
...
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