diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 6fdb2d472..de159011b 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -450,7 +450,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag var skus []*dao.StoreSkuSyncInfo if isFull { skus, err = dao.GetFullStoreSkus(db, vendorID, storeID) - } else { skus, err = dao.GetStoreSkus(db, vendorID, storeID, skuIDs) } diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index 75adf6d44..9f25962cc 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -568,7 +568,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_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, 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.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.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin, IF(t11.%s <> '', t11.%s, t3.img) img, IF(t12.%s <> '', t12.%s, t3.img2) img2, diff --git a/business/model/sku.go b/business/model/sku.go index ef8fa96a7..4a9e66f30 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -199,12 +199,13 @@ type SkuName struct { // JdSyncStatus int8 `orm:"default(2)" json:"jdSyncStatus"` // LinkID int `orm:"column(link_id);null;index" json:"linkID"` - YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀 - JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` //京东商城总库存 - PreparationTime int `orm:"default(1)" json:"preparationTime"` //商品准备时长 - BestSeller int `json:"bestSeller"` //畅销品 0不是 1是 - Video string `json:"video"` //商品视频地址 - VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID + YbNameSuffix string `json:"ybNameSuffix"` //银豹商品后缀 + JdsStockSwitch int8 `orm:"default(1)" json:"jdsStockSwitch"` //京东商城总库存 + PreparationTime int `orm:"default(1)" json:"preparationTime"` //商品准备时长 + BestSeller int `json:"bestSeller"` //畅销品 0不是 1是 + Video string `json:"video"` //商品视频地址 + VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID + TiktokAttribute string `orm:"column(tiktok_attribute);size(512)" json:"tiktok_attribute"` //抖音分类属性的存储 } func (*SkuName) TableUnique() [][]string { diff --git a/business/partner/purchase/tiktok_store/store_sku2.go b/business/partner/purchase/tiktok_store/store_sku2.go index 49877dfd3..ad19dbf80 100644 --- a/business/partner/purchase/tiktok_store/store_sku2.go +++ b/business/partner/purchase/tiktok_store/store_sku2.go @@ -306,12 +306,12 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI // spec_prices param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, 0, storeSku) // ProductFormatNew 获取商品属性 - productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode) - globals.SugarLogger.Debugf("er=====productFormatNew=========%s", productFormatNew) - if err != nil { - return nil, err - } - param.ProductFormatNew = productFormatNew + //productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode) + //globals.SugarLogger.Debugf("er=====productFormatNew=========%s", productFormatNew) + //if err != nil { + // return nil, err + //} + //param.ProductFormatNew = productFormatNew // 获取品牌 param.StandardBrandId, err = api.GetSkuBrand(param.CategoryLeafId) @@ -431,11 +431,11 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI // spec_prices param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, utils.Str2Int64(storeSku.VendorSkuID), storeSku) // ProductFormatNew 获取商品属性 - productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode) - if err != nil { - return nil, err - } - param.ProductFormatNew = productFormatNew + //productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode) + //if err != nil { + // return nil, err + //} + //param.ProductFormatNew = productFormatNew // 获取品牌 //brandID, err := api.GetSkuBrand(param.CategoryLeafId) diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index a5171b8cf..9dd8a1926 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" freightTemplate_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_create/request" + product_getCatePropertyV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_getCatePropertyV2/response" shop_bindStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreFreight/request" shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request" trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request" @@ -125,30 +126,31 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao } // GetProductFormatNew 获取物品属性 -func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (string, error) { +func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (*product_getCatePropertyV2_response.ProductGetCatePropertyV2Response, error) { category, err := getAPI(vendorOrgCode, 0, "").GetCatePropertyV2(categoryLeftId) if err != nil { - return "", err + return nil, err } - format := make(map[string][]*tiktokShop.ProductFormatNewList, 0) - for _, v := range category.Data.Data { - if v.Required != 1 { // 必填属性必须填写 - continue - } - for _, d := range v.Options { - formateNew := &tiktokShop.ProductFormatNewList{ - Value: utils.Str2Int64(d.Value), - Name: d.Name, - DiyType: v.DiyType, - } - format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew) - } - } - productFormatNew, err := json.Marshal(format) - if err != nil { - return "", err - } - return string(productFormatNew), nil + return category, nil + //format := make(map[string][]*tiktokShop.ProductFormatNewList, 0) + //for _, v := range category.Data.Data { + // if v.Required != 1 { // 必填属性必须填写 + // continue + // } + // for _, d := range v.Options { + // formateNew := &tiktokShop.ProductFormatNewList{ + // Value: utils.Str2Int64(d.Value), + // Name: d.Name, + // DiyType: v.DiyType, + // } + // format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew) + // } + //} + //productFormatNew, err := json.Marshal(format) + //if err != nil { + // return "", err + //} + //return string(productFormatNew), nil } // GetTiktokImgList 获取抖音图片链接