新增分类

This commit is contained in:
苏尹岚
2020-05-09 08:57:12 +08:00
parent e48027a85c
commit 17ddd46c1b
2 changed files with 37 additions and 1 deletions

View File

@@ -1,8 +1,13 @@
package jdshop
import (
"fmt"
"regexp"
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -71,7 +76,35 @@ func (p *PurchaseHandler) GetStoreAllCategories(ctx *jxcontext.Context, storeID
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
if globals.EnableJdShopWrite && vendorStoreID == model.JdShopMainVendorStoreID {
fmt.Println("test1111111111111111111111", partner.GetMultiStoreVendorIDs())
var createShopCategoryParams []*jdshopapi.CreateShopCategoryParam
result, err := api.JdShopAPI.FindShopCategories()
if err != nil {
return err
}
for _, v := range result {
createShopCategoryParam := &jdshopapi.CreateShopCategoryParam{
HomeShow: "0",
ID: utils.Int64ToStr(v.CID),
Open: "",
OrderNo: utils.Int2Str(v.OrderNo),
ParentID: utils.Int64ToStr(v.ParentCID),
Title: v.Name,
Type: jdshopapi.UpdateCatType,
}
createShopCategoryParams = append(createShopCategoryParams, createShopCategoryParam)
}
createShopCategoryParam2 := &jdshopapi.CreateShopCategoryParam{
HomeShow: "0",
ID: "1",
Open: "",
OrderNo: utils.Int2Str(storeCat.Seq),
ParentID: storeCat.ParentVendorCatID,
Title: storeCat.Name,
Type: jdshopapi.CreateCatType,
}
createShopCategoryParams = append(createShopCategoryParams, createShopCategoryParam2)
err = api.JdShopAPI.CreateShopCategory(createShopCategoryParams)
}
return err
}

View File

@@ -101,6 +101,9 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
if len(storeSkuList) == 1 {
storeSku := storeSkuList[0]
result, err := api.YinBaoAPI.QueryProductByBarcode(storeSku.VendorSkuID)
if err != nil {
return nil, err
}
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(result.Barcode)
// resultp, err := getProductImages(vendorStoreID, storeSku.VendorSkuID)
if err != nil {