1
This commit is contained in:
@@ -173,7 +173,6 @@ func SyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
|
||||
func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, vendorID, storeID int, vendorStoreID, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debugf("==SyncStoreSkuNew2=====================%d,%s", storeID, utils.Format4Output(skuIDs, false))
|
||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
if singleStoreHandler != nil { // 本地创建商品分类
|
||||
if err = CreateStoreCategoryByStoreSku(ctx, vendorID, storeID, vendorStoreID, nameIDs, skuIDs); err != nil {
|
||||
@@ -184,12 +183,10 @@ func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFla
|
||||
func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
switch step {
|
||||
case 0:
|
||||
globals.SugarLogger.Debugf("==SyncStoreCategories=====================%d,%s", storeID, utils.Format4Output(skuIDs, false))
|
||||
if singleStoreHandler != nil {
|
||||
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
||||
}
|
||||
case 1:
|
||||
globals.SugarLogger.Debugf("==syncStoreSkuNew=====================%d,%s", storeID, utils.Format4Output(skuIDs, false))
|
||||
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
||||
}
|
||||
return result, err
|
||||
@@ -454,6 +451,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
} else {
|
||||
skus, err = dao.GetStoreSkus(db, vendorID, storeID, skuIDs)
|
||||
}
|
||||
globals.SugarLogger.Debugf("===skus====================%d,%s", storeID, utils.Format4Output(skus, false))
|
||||
if err != nil || len(skus) == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -687,6 +687,8 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
||||
// }
|
||||
sql = fmt.Sprintf(sql, fmtParams...)
|
||||
sql += " ORDER BY t1.price"
|
||||
globals.SugarLogger.Debugf("====slq := %s",sql)
|
||||
globals.SugarLogger.Debugf("====param := %s",utils.Format4Output(panic,false))
|
||||
if err = GetRows(db, &skus, sql, sqlParams...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -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