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
0e7f9f90
authored
Aug 03, 2022
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Plain Diff
解决冲突
parents
89ec071b
a06f158d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
26 deletions
conf/dev/database.ini
conf/dev/redis.ini
service/service_ly.go
service/service_ly_common.go
service/service_zy.go
conf/dev/database.ini
View file @
0e7f9f90
conf/dev/redis.ini
View file @
0e7f9f90
service/service_ly.go
View file @
0e7f9f90
...
@@ -2,16 +2,17 @@ package service
...
@@ -2,16 +2,17 @@ package service
import
(
import
(
"fmt"
"fmt"
"github.com/gin-gonic/gin"
"github.com/gogf/gf/util/gconv"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/model"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/gredis"
"go_sku_server/service/sorter"
"go_sku_server/service/sorter"
"sort"
"sort"
"sync"
"sync"
"github.com/gin-gonic/gin"
"github.com/gogf/gf/util/gconv"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
)
)
type
LyService
struct
{
type
LyService
struct
{
...
@@ -100,8 +101,6 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
...
@@ -100,8 +101,6 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
}
}
}
}
//获取供应链标准品牌
//获取供应链标准品牌
//什么是供应链的标准品牌 供应链那边报关的时候要求他们的标准品牌,所以要吧自己的品牌映射上去
//什么是供应链的标准品牌 供应链那边报关的时候要求他们的标准品牌,所以要吧自己的品牌映射上去
//继来那边对接的标准品牌(下单的时候)
//继来那边对接的标准品牌(下单的时候)
...
@@ -110,8 +109,8 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
...
@@ -110,8 +109,8 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
//获取新版的标准品牌
//获取新版的标准品牌
sku
.
StandardBrand
=
ls
.
GetStandardBrand
(
brandId
)
sku
.
StandardBrand
=
ls
.
GetStandardBrand
(
brandId
)
//处理过期
//处理过期
,todo 2022.7.13 专卖没有过期
if
gjson
.
Get
(
skuStr
,
"is_expire"
)
.
Int
()
!=
0
{
if
sku
.
SupplierId
!=
17
&&
gjson
.
Get
(
skuStr
,
"is_expire"
)
.
Int
()
!=
0
{
sku
.
LadderPrice
=
nil
sku
.
LadderPrice
=
nil
}
}
...
@@ -161,13 +160,18 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
...
@@ -161,13 +160,18 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
sku
.
LadderPriceResult
=
[]
int
{}
sku
.
LadderPriceResult
=
[]
int
{}
}
}
//这边有个临时逻辑,如果供应商id是TI的,就库存为0
// if sku.SupplierId == 1679 {
// sku.Stock = 0
// }
//判断是否可以购买
//判断是否可以购买
sku
.
IsBuy
=
ls
.
GetIsBuy
(
sku
)
sku
.
IsBuy
=
ls
.
GetIsBuy
(
sku
)
//
//
过期修改库存为0
//过期修改库存为0
//if sku.IsExpire == 1
{
if
sku
.
IsExpire
==
1
&&
sku
.
SupplierId
!=
17
{
//
sku.Stock = 0
sku
.
Stock
=
0
//
}
}
var
TagService
TagsService
var
TagService
TagsService
sku
.
GoodsTag
=
TagService
.
GetTags
(
sku
.
GoodsId
,
0
)
sku
.
GoodsTag
=
TagService
.
GetTags
(
sku
.
GoodsId
,
0
)
...
...
service/service_ly_common.go
View file @
0e7f9f90
...
@@ -2,17 +2,18 @@ package service
...
@@ -2,17 +2,18 @@ package service
import
(
import
(
"encoding/json"
"encoding/json"
"github.com/gomodule/redigo/redis"
_
"github.com/iancoleman/orderedmap"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/model"
"go_sku_server/pkg/common"
"go_sku_server/pkg/common"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/logger"
"go_sku_server/pkg/logger"
_
"go_sku_server/pkg/mongo"
_
"go_sku_server/pkg/mongo"
_
"gopkg.in/mgo.v2/bson"
"strings"
"strings"
"github.com/gomodule/redigo/redis"
_
"github.com/iancoleman/orderedmap"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
_
"gopkg.in/mgo.v2/bson"
)
)
//获取图片信息
//获取图片信息
...
@@ -40,8 +41,8 @@ func (ls *LyService) GetGoodsClass(sku model.LySku, spu string) model.LySku {
...
@@ -40,8 +41,8 @@ func (ls *LyService) GetGoodsClass(sku model.LySku, spu string) model.LySku {
spuClassId1
:=
gjson
.
Get
(
spu
,
"class_id1"
)
.
Int
()
spuClassId1
:=
gjson
.
Get
(
spu
,
"class_id1"
)
.
Int
()
spuClassId2
:=
gjson
.
Get
(
spu
,
"class_id2"
)
.
Int
()
spuClassId2
:=
gjson
.
Get
(
spu
,
"class_id2"
)
.
Int
()
spuClassId3
:=
gjson
.
Get
(
spu
,
"class_id3"
)
.
Int
()
spuClassId3
:=
gjson
.
Get
(
spu
,
"class_id3"
)
.
Int
()
if
spuClassId
3
!=
0
{
if
spuClassId
2
!=
0
{
sku
.
ClassName
=
ls
.
GetCacheClass
(
spuClassId
3
)
sku
.
ClassName
=
ls
.
GetCacheClass
(
spuClassId
2
)
sku
.
ClassName3
=
ls
.
GetCacheClass
(
spuClassId3
)
sku
.
ClassName3
=
ls
.
GetCacheClass
(
spuClassId3
)
sku
.
ClassName2
=
ls
.
GetCacheClass
(
spuClassId2
)
sku
.
ClassName2
=
ls
.
GetCacheClass
(
spuClassId2
)
sku
.
ClassName1
=
ls
.
GetCacheClass
(
spuClassId1
)
sku
.
ClassName1
=
ls
.
GetCacheClass
(
spuClassId1
)
...
@@ -79,7 +80,8 @@ func (ls *LyService) GetPoolSupplierName(supplierId int64) (supplierName string)
...
@@ -79,7 +80,8 @@ func (ls *LyService) GetPoolSupplierName(supplierId int64) (supplierName string)
func
(
ls
*
LyService
)
GetCacheClass
(
classId
int64
)
string
{
func
(
ls
*
LyService
)
GetCacheClass
(
classId
int64
)
string
{
redisCon
:=
gredis
.
Conn
(
"default_r"
)
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
redisCon
.
Close
()
defer
redisCon
.
Close
()
className
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"class"
,
classId
))
classStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"pool_class_info"
,
classId
))
className
:=
gjson
.
Get
(
classStr
,
"class_name"
)
.
String
()
return
className
return
className
}
}
...
...
service/service_zy.go
View file @
0e7f9f90
...
@@ -115,8 +115,8 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
...
@@ -115,8 +115,8 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
standardBrand
=
ly
.
GetStandardBrand
(
brandId
)
standardBrand
=
ly
.
GetStandardBrand
(
brandId
)
}
}
A
.
Set
(
"brand_id"
,
brandId
)
A
.
Set
(
"brand_id
_spu
"
,
brandId
)
A
.
Set
(
"brand_name"
,
brandName
)
A
.
Set
(
"brand_name
_spu
"
,
brandName
)
A
.
Set
(
"standard_brand"
,
standardBrand
)
A
.
Set
(
"standard_brand"
,
standardBrand
)
A
.
Set
(
"class_id1"
,
classId1
)
//
A
.
Set
(
"class_id1"
,
classId1
)
//
...
@@ -170,9 +170,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
...
@@ -170,9 +170,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
A
.
Set
(
"cn_delivery_time"
,
cnDeliveryTime
)
// 货期
A
.
Set
(
"cn_delivery_time"
,
cnDeliveryTime
)
// 货期
//查询品牌名称(作废,现在改成读联营的品牌库,之前有关联自营商品到spu_id)
//查询品牌名称(作废,现在改成读联营的品牌库,之前有关联自营商品到spu_id)
// brand_id := gjson.Get(info, "brand_id").Int()
brand_id
:=
gjson
.
Get
(
info
,
"brand_id"
)
.
Int
()
// brand_info, _ := gredis.String(redisConn.Do("HGET", "Self_Brand", brand_id))
brand_info
,
_
:=
gredis
.
String
(
redisConn
.
Do
(
"HGET"
,
"Self_Brand"
,
brand_id
))
// A.Set("brand_name", gjson.Get(brand_info, "brand_name").String())
A
.
Set
(
"brand_name"
,
gjson
.
Get
(
brand_info
,
"brand_name"
)
.
String
())
A
.
Set
(
"brand_id"
,
brand_id
)
if
fast
!=
"1"
{
//不是快速查询
if
fast
!=
"1"
{
//不是快速查询
// 供应商名称
// 供应商名称
...
...
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