Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop

This commit is contained in:
richboo111
2022-12-29 14:01:25 +08:00
5 changed files with 6 additions and 17 deletions

View File

@@ -676,14 +676,12 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
// api.JdShop2API.SetCookieWithStr(configs[0].Value)
// }
}
if vendorID == model.VendorIDDD {
//createList, updateList []*dao.StoreSkuSyncInfo
//deleteList, stockList, onlineList, offlineList, priceList []*partner.StoreSkuInfo
//updateItems []*dao.KVUpdateItem
//reorderSkuMap map[string][]*dao.StoreSkuSyncInfo
globals.SugarLogger.Debugf("createList len = %d ", len(createList))
}
//createList, updateList []*dao.StoreSkuSyncInfo
//deleteList, stockList, onlineList, offlineList, priceList []*partner.StoreSkuInfo
//updateItems []*dao.KVUpdateItem
//reorderSkuMap map[string][]*dao.StoreSkuSyncInfo
globals.SugarLogger.Debugf("createList len = %d ", len(createList))
globals.SugarLogger.Debugf("====skuList %s", utils.Format4Output(skus, false))
task := tasksch.NewParallelTask("syncStoreSkuNew", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError2), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
step := batchItemList[0].(int)

View File

@@ -700,7 +700,6 @@ func GetStoreSkus(db *DaoDB, vendorID, storeID int, skuIDs []int) (skus []*Store
// 以sku为基础来做全同步
// 多门店模式厂商适用
func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInfo, err error) {
// 对于多门店平台商品库删除后不需要操作门店商品所以sku_name用JOIN, sku与sku_name也可以直接排除下架的
sql := `
SELECT

View File

@@ -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,

View File

@@ -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{

View File

@@ -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