1
This commit is contained in:
@@ -42,18 +42,14 @@ func (c *DeliveryHandler) CreateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeDetail *dao.StoreDetail2, err error) {
|
||||
globals.SugarLogger.Debugf("storeID=======%d vendorStoreID==========%s", storeID, vendorStoreID)
|
||||
relInfo, err := dao.GetStoreDetailForDD(dao.GetDB(), storeID, model.VendorIDDD, vendorStoreID, "")
|
||||
if err != nil {
|
||||
return nil, errors.New("获取抖音平台账号信息失败,请重试")
|
||||
}
|
||||
globals.SugarLogger.Debugf("relInfo=========%s", utils.Format4Output(relInfo, false))
|
||||
apiObj := getAPI(relInfo.VendorOrgCode)
|
||||
globals.SugarLogger.Debugf("relInfo.VendorOrgCode===========%s,apiObj=============%v", relInfo.VendorOrgCode, apiObj)
|
||||
if storeInfo, err := apiObj.GetStoreDetail(&shop_getStoreDetail_request.ShopGetStoreDetailParam{
|
||||
StoreId: vendorStoreID,
|
||||
}); err == nil {
|
||||
globals.SugarLogger.Debugf("DYPS GetStore storeInfo=====%s", utils.Format4Output(storeInfo, false))
|
||||
storeDetail = &dao.StoreDetail2{
|
||||
Store: model.Store{
|
||||
Name: storeInfo.StoreDetail.Store.Name,
|
||||
|
||||
@@ -193,7 +193,6 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) CreateSku2(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (err error) {
|
||||
globals.SugarLogger.Debugf("是不是正儿八经的京东商城%s", "CreateSku2")
|
||||
param := skuInfo2Param(ctx, sku)
|
||||
if globals.EnableJdStoreWrite {
|
||||
sku.VendorSkuID, err = getAPI(sku.VendorOrgCode).AddSku2(param)
|
||||
@@ -228,7 +227,6 @@ func (p *PurchaseHandler) UpdateSku2(ctx *jxcontext.Context, sku *dao.StoreSkuSy
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) DeleteSku2(ctx *jxcontext.Context, vendorOrgCode string, sku *partner.StoreSkuInfo) (err error) {
|
||||
globals.SugarLogger.Debugf("是不是正儿八经的京东商城%s", "DeleteSku2")
|
||||
// 京东到家只能通过商家ID删除SKU,如果没有的话,先绑定,再删除
|
||||
if sku.SkuID == 0 {
|
||||
skuPairList := []*jdapi.SkuIDPair{
|
||||
|
||||
@@ -33,7 +33,6 @@ var (
|
||||
)
|
||||
|
||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
globals.SugarLogger.Debugf("======================================京东")
|
||||
if globals.EnableJdShopWrite {
|
||||
if vendorStoreID == model.JdShopMainVendorStoreID {
|
||||
for _, v := range storeSkuList {
|
||||
|
||||
@@ -292,12 +292,10 @@ func SpecialTreat(vendorOrgCode string, vendorStoreID, storeID, deliveryFeeDeduc
|
||||
}
|
||||
//3.设置门店起送价 默认为0
|
||||
if bindSaleLimitID, err := GetStoreSaleLimit(vendorOrgCode, vendorStoreID); err != nil {
|
||||
globals.SugarLogger.Debugf("进入获取门店起送价限售模板")
|
||||
errList.AddErr(fmt.Errorf("获取门店限售模板失败:%v", err))
|
||||
} else {
|
||||
if bindSaleLimitID == 0 || utils.IsNil(bindSaleLimitID) { //创建
|
||||
if createSaleLimitID, err := CreateAndBindMinPriceTemplate(vendorOrgCode, vendorStoreID, minPrice); err != nil {
|
||||
globals.SugarLogger.Debugf("进入创建门店起送价限售模板,minPrice=======%d", minPrice)
|
||||
errList.AddErr(fmt.Errorf("设置门店起送价限售模板失败:%v", err))
|
||||
} else {
|
||||
FreightTemplate.TradeLimitID = createSaleLimitID
|
||||
|
||||
Reference in New Issue
Block a user