1
This commit is contained in:
@@ -654,6 +654,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric
|
||||
t1.sell_point_times,
|
||||
t1.tiktok_attribute,
|
||||
t1.mt_attribute,
|
||||
t1.ebai_attribute,
|
||||
t1.qua_pictures,
|
||||
t1.qua_effective_date,
|
||||
t1.qua_approval_date,
|
||||
@@ -3469,6 +3470,7 @@ func GetSkuNamesNew(ctx *jxcontext.Context, keyword string, skuIDs, skuNameIDs [
|
||||
t1.jds_stock_switch,
|
||||
t1.preparation_time,
|
||||
t1.mt_attribute,
|
||||
t1.ebai_attribute,
|
||||
t1.qua_pictures,
|
||||
t1.qua_effective_date,
|
||||
t1.qua_approval_date,
|
||||
@@ -3515,6 +3517,7 @@ func GetSkuNamesNew(ctx *jxcontext.Context, keyword string, skuIDs, skuNameIDs [
|
||||
t1.preparation_time,
|
||||
t1.best_seller,
|
||||
t1.mt_attribute,
|
||||
t1.ebai_attribute,
|
||||
t1.qua_pictures,
|
||||
t1.qua_effective_date,
|
||||
t1.qua_approval_date,
|
||||
|
||||
@@ -219,12 +219,12 @@ func Init() {
|
||||
// 每分钟轮询一次,推送骑手信息(假的订单)
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
delivery.UpdateFakeWayBillToTiktok()
|
||||
}, 10*time.Second, 4*time.Minute)
|
||||
}, 10*time.Second, 20*time.Second)
|
||||
|
||||
// 每五分钟轮询一次推送骑手信息坐标给美团/抖音(真订单,真自送)
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
delivery.GetOrderRiderInfoToPlatform("", 0)
|
||||
}, 10*time.Second, 4*time.Minute)
|
||||
}, 10*time.Second, 20*time.Second)
|
||||
|
||||
// (自动发单拣货,设置骑手) 刷单用
|
||||
//ScheduleTimerFuncByInterval(func() {
|
||||
|
||||
@@ -111,6 +111,7 @@ type StoreSkuSyncInfo struct {
|
||||
NameCategoryID int `orm:"column(name_category_id)"`
|
||||
TiktokAttribute string `orm:"column(tiktok_attribute)"`
|
||||
MtAttribute string `orm:"column(mt_attribute)"`
|
||||
EbaiAttribute string `orm:"column(ebai_attribute)"`
|
||||
SellPoint string `orm:"column(sell_point)"` // 目前是美团买点
|
||||
SellPointTimes string `orm:"column(sell_point_times)"` // 目前是美团买点展示时间
|
||||
YbNameSuffix string //银豹的商品条码后缀
|
||||
@@ -592,7 +593,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
||||
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,t1.vendor_son_sku_id,t1.vendor_sku_attr_id,t1.vendor_main_id,
|
||||
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,t1.location_code,
|
||||
t2.*,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.ebai_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,
|
||||
t3.sell_point,t3.sell_point_times,t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
@@ -723,7 +724,7 @@ func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInf
|
||||
t1.store_id, t1.deleted_at bind_deleted_at, t1.stock,t1.location_code,
|
||||
t2.*, t2.id sku_id, t2m.vendor_thing_id vendor_sku_id,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.ex_prefix, t3.ex_prefix_begin, t3.ex_prefix_end, t3.category_id name_category_id,t3.tiktok_attribute,
|
||||
t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
t3.mt_attribute,t3.ebai_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
IF(t13.%s <> '', t13.%s, t3.desc_img) desc_img,
|
||||
|
||||
@@ -191,6 +191,7 @@ type SkuName struct {
|
||||
VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID
|
||||
TiktokAttribute string `orm:"column(tiktok_attribute);size(1024)" json:"tiktokAttribute"` //抖音分类属性的存储
|
||||
MtAttribute string `orm:"column(mt_attribute);size(1024)" json:"mtAttribute"` //美团分类属性的存储
|
||||
EbaiAttribute string `orm:"column(ebai_attribute);size(1024)" json:"ebaiAttribute"` //美团分类属性的存储
|
||||
SellPoint string `orm:"column(sell_point);size(128)" json:"sellPoint"` // 商品卖点 :(1)限制长度最多不能超过15个字符。 (2)不允许上传emoji等表情符。 (3)更新时传递EMPTY_VALUE支持置空。
|
||||
SellPointTimes string `orm:"column(sell_point_times);size(256)" json:"sellPointTimes"` // 商品卖点展示期,更新时传递EMPTY_VALUE支持置空。{"start_time":1,"end_time":2} 秒级时间戳
|
||||
QuaPictures string `orm:"column(qua_pictures);size(512)" json:"quaPictures"` // 商品资质图片,非必填,医疗器械必须传,保健食品、特殊医学配方食品建议传
|
||||
|
||||
@@ -550,6 +550,35 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE
|
||||
if storeSku.SkuSyncStatus&(model.SyncFlagSaleMask|model.SyncFlagNewMask) != 0 {
|
||||
params["status"] = jxSkuStatus2Ebai(storeSku.MergedStatus)
|
||||
}
|
||||
if storeSku.EbaiAttribute != "" && storeSku.EbaiAttribute != "{}" {
|
||||
attr := map[string]interface{}{}
|
||||
if storeSku.Upc != "" {
|
||||
attr["upc"] = storeSku.Upc
|
||||
} else {
|
||||
attr["upc"] = "upc-" + utils.Int2Str(storeSku.SkuID)
|
||||
}
|
||||
attr["sale_price"] = storeSku.VendorPrice
|
||||
attr["left_num"] = params["left_num"]
|
||||
attr["weight"] = storeSku.Weight
|
||||
attr["status"] = 1 // 正常
|
||||
|
||||
sepcProperty := make([]map[string]interface{}, 0, 0)
|
||||
attributeList := make([]*AttributeListEBai, 0, 0)
|
||||
err = utils.UnmarshalUseNumber(utils.MustMarshal(storeSku.EbaiAttribute), &attributeList)
|
||||
for _, al := range attributeList {
|
||||
for _, pv := range al.PropertyValues {
|
||||
property := map[string]interface{}{
|
||||
"prop_id": al.PropertyId,
|
||||
"prop_text": al.PropertyName,
|
||||
}
|
||||
property["value_id"] = pv.ValueId
|
||||
property["value_text"] = pv.ValueData
|
||||
sepcProperty = append(sepcProperty)
|
||||
}
|
||||
}
|
||||
attr["spec_property"] = sepcProperty
|
||||
params["sku_spec"] = []interface{}{attr}
|
||||
}
|
||||
// todo 饿百如果给的UPC是空要报错,但如果我要删除UPC怎么弄?
|
||||
// if storeSku.Upc != "" {
|
||||
// params["upc"] = storeSku.Upc
|
||||
@@ -566,6 +595,16 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE
|
||||
return params
|
||||
}
|
||||
|
||||
type AttributeListEBai struct {
|
||||
PropertyId int64 `json:"propertyId"`
|
||||
PropertyName string `json:"propertyName"`
|
||||
PropertyValues []struct {
|
||||
ValueId int64 `json:"ValueId"` // 属性值id
|
||||
ValueData string `json:"valueData"` // 属性值内容
|
||||
} `json:"propertyValues"` // 属性值列表
|
||||
|
||||
}
|
||||
|
||||
func ebaiSkuStatus2Jx(ebaiSkuStatus int) (jxSkuStatus int) {
|
||||
if ebaiSkuStatus == ebaiapi.SkuStatusOnline {
|
||||
jxSkuStatus = model.SkuStatusNormal
|
||||
@@ -776,3 +815,16 @@ func (p *PurchaseHandler) UpdateStoreSkusSpecTag(ctx *jxcontext.Context, vendorO
|
||||
func (p *PurchaseHandler) GetSkuCategoryIdByName(vendorOrgCode, skuName string) (vendorCategoryId string, err error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
//GetCategoryAttrValueList 查询特殊属性的属性值列表
|
||||
func GetCategoryAttrValueList(attrID int64) (categoryAttrValueListResult []*ebaiapi.CategoryAttr, err error) {
|
||||
switch beego.BConfig.RunMode {
|
||||
case model.ServerTypeFruits:
|
||||
categoryAttrValueListResult, err = api.EbaiAPI.CategoryAttrValueList(attrID, "800082")
|
||||
case model.ServerTypeVegetable:
|
||||
categoryAttrValueListResult, err = api.EbaiAPI.CategoryAttrValueList(attrID, "666667")
|
||||
case model.ServerTypePet:
|
||||
categoryAttrValueListResult, err = api.EbaiAPI.CategoryAttrValueList(attrID, "666667")
|
||||
}
|
||||
return categoryAttrValueListResult, err
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/ebai"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -843,16 +844,22 @@ func (c *SkuController) GetMTCategoryAttrList() {
|
||||
// @Title 根据美团属性id 查询特殊属性(品牌、产地)
|
||||
// @Description 根据美团属性id 查询特殊属性(品牌、产地)
|
||||
// @Param token header string true "认证token"
|
||||
// @Param appOrgCode query string true "美团app"
|
||||
// @Param appOrgCode query string true "平台code"
|
||||
// @Param attrId query int64 true "属性id"
|
||||
// @Param keyword query string true "属性值的关键词"
|
||||
// @Param vendorId query int true "所属平台[3-饿百/1-美团]"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetMTCategoryAttrValueList [get]
|
||||
func (c *SkuController) GetMTCategoryAttrValueList() {
|
||||
c.callGetMTCategoryAttrValueList(func(params *tSkuGetMTCategoryAttrValueListParams) (interface{}, string, error) {
|
||||
data, err := mtwm.GetCategoryAttrValueList(params.AppOrgCode, params.Keyword, params.AttrId)
|
||||
return data, "", err
|
||||
c.callGetMTCategoryAttrValueList(func(params *tSkuGetMTCategoryAttrValueListParams) (retVal interface{}, code string, err error) {
|
||||
switch params.VendorId {
|
||||
case model.VendorIDEBAI:
|
||||
retVal, err = ebai.GetCategoryAttrValueList(int64(params.AttrId))
|
||||
case model.VendorIDMTWM:
|
||||
retVal, err = mtwm.GetCategoryAttrValueList(params.AppOrgCode, params.Keyword, params.AttrId)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
123780
swagger/param_parser.go.txt
123780
swagger/param_parser.go.txt
File diff suppressed because it is too large
Load Diff
@@ -15302,7 +15302,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "appOrgCode",
|
||||
"description": "美团app",
|
||||
"description": "平台code",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@@ -15320,6 +15320,14 @@
|
||||
"description": "属性值的关键词",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "vendorId",
|
||||
"description": "所属平台[3-饿百/1-美团]",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
||||
@@ -10375,7 +10375,7 @@ paths:
|
||||
type: string
|
||||
- in: query
|
||||
name: appOrgCode
|
||||
description: 美团app
|
||||
description: 平台code
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
@@ -10389,6 +10389,12 @@ paths:
|
||||
description: 属性值的关键词
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: vendorId
|
||||
description: 所属平台[3-饿百/1-美团]
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
|
||||
Reference in New Issue
Block a user