新增分类
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
package jdshop
|
package jdshop
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"regexp"
|
"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/platformapi/yinbaoapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"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) {
|
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
if globals.EnableJdShopWrite && vendorStoreID == model.JdShopMainVendorStoreID {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
|
|||||||
if len(storeSkuList) == 1 {
|
if len(storeSkuList) == 1 {
|
||||||
storeSku := storeSkuList[0]
|
storeSku := storeSkuList[0]
|
||||||
result, err := api.YinBaoAPI.QueryProductByBarcode(storeSku.VendorSkuID)
|
result, err := api.YinBaoAPI.QueryProductByBarcode(storeSku.VendorSkuID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(result.Barcode)
|
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(result.Barcode)
|
||||||
// resultp, err := getProductImages(vendorStoreID, storeSku.VendorSkuID)
|
// resultp, err := getProductImages(vendorStoreID, storeSku.VendorSkuID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user