银豹partner
This commit is contained in:
@@ -109,6 +109,9 @@ type StoreSkuSyncInfo struct {
|
|||||||
ActPercentage int `json:"actPercentage"` // 直降活动百分比
|
ActPercentage int `json:"actPercentage"` // 直降活动百分比
|
||||||
ActSyncStatus int8 `orm:"default(2)" json:"actSyncStatus"`
|
ActSyncStatus int8 `orm:"default(2)" json:"actSyncStatus"`
|
||||||
VendorActPrice int64 `json:"vendorActPrice"` // 保存数据用,实际的活动价
|
VendorActPrice int64 `json:"vendorActPrice"` // 保存数据用,实际的活动价
|
||||||
|
|
||||||
|
YbAppID string `orm:"column(yb_app_id)" json:"ybAppID"` //银豹对应门店的appID
|
||||||
|
YbAppKey string //银豹对应门店的appkey
|
||||||
}
|
}
|
||||||
|
|
||||||
type MissingStoreSkuInfo struct {
|
type MissingStoreSkuInfo struct {
|
||||||
@@ -509,7 +512,7 @@ func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInf
|
|||||||
// 对于多门店平台,商品库删除后,不需要操作门店商品,所以sku_name用JOIN, sku与sku_name也可以直接排除下架的
|
// 对于多门店平台,商品库删除后,不需要操作门店商品,所以sku_name用JOIN, sku与sku_name也可以直接排除下架的
|
||||||
sql := `
|
sql := `
|
||||||
SELECT
|
SELECT
|
||||||
sm.vendor_id, sm.vendor_org_code,
|
sm.vendor_id, sm.vendor_org_code, sm.yb_app_id, sm.yb_app_key,
|
||||||
t1.id bind_id, t1.price, t1.unit_price, t1.status store_sku_status,
|
t1.id bind_id, t1.price, t1.unit_price, t1.status store_sku_status,
|
||||||
t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,
|
t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,
|
||||||
t1.store_id, t1.deleted_at bind_deleted_at,
|
t1.store_id, t1.deleted_at bind_deleted_at,
|
||||||
|
|||||||
@@ -1,16 +1,35 @@
|
|||||||
package yb
|
package yb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner"
|
"git.rosy.net.cn/jx-callback/business/partner"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
stock = 100
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||||
|
storeSku := storeSkuList[0]
|
||||||
|
api.YinBaoAPI = yinbaoapi.New(storeSku.YbAppKey, storeSku.YbAppID)
|
||||||
|
api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
||||||
return failedList, err
|
return failedList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||||
return failedList, err
|
return failedList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func buildProductInfoParam(storeSku *dao.StoreSkuSyncInfo) (productInfoParam *yinbaoapi.ProductInfoParam) {
|
||||||
|
productInfoParam = &yinbaoapi.ProductInfoParam{}
|
||||||
|
productInfo := &yinbaoapi.ProductInfo{
|
||||||
|
Stock: stock,
|
||||||
|
Name: storeSku.SkuName,
|
||||||
|
Barcode: storeSku.SkuID,
|
||||||
|
BuyPrice: storeSku.pr
|
||||||
|
}
|
||||||
|
return productInfoParam
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user