1
This commit is contained in:
@@ -784,7 +784,6 @@ func GetVendorStore(ctx *jxcontext.Context, vendorID int, vendorOrgCode, vendorS
|
||||
return nil, err
|
||||
}
|
||||
if handler := CurVendorSync.GetStoreHandler(vendorID); handler != nil {
|
||||
globals.SugarLogger.Debugf("step1 handler==============%s", handler)
|
||||
result, err2 := handler.ReadStore(ctx, vendorOrgCode, vendorStoreID, "")
|
||||
if err = err2; err == nil {
|
||||
retVal = &StoreExt{
|
||||
|
||||
@@ -288,7 +288,6 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs
|
||||
var vendorStoreID string
|
||||
storeMap := loopMapInfo.StoreMapList[0]
|
||||
if model.IsSyncStatusNew(storeMap.SyncStatus) {
|
||||
globals.SugarLogger.Debug("进入handler.CreateStore2")
|
||||
storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID, storeMap.VendorOrgCode)
|
||||
if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, storeDetail); err == nil {
|
||||
resultList = append(resultList, 1)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
@@ -50,8 +51,15 @@ func UpdateThingMap(thingMap *model.ThingMap) error {
|
||||
return err
|
||||
}
|
||||
|
||||
var thingMapList = make(map[string][]*model.ThingMap, 1024)
|
||||
|
||||
// GetThingToTiktokMapList 抖店获取同步类型
|
||||
func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCode string) (cats []*model.ThingMap, err error) {
|
||||
if _, ok := thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)]; ok {
|
||||
if len(thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)]) != 0 {
|
||||
return thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)], nil
|
||||
}
|
||||
}
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM thing_map t1
|
||||
@@ -65,6 +73,9 @@ func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCo
|
||||
}
|
||||
|
||||
err = GetRows(db, &cats, sql, sqlParams...)
|
||||
if len(cats) != 0 {
|
||||
thingMapList[fmt.Sprintf("%d_%s_%d", cats[0].VendorID, cats[0].VendorOrgCode, cats[0].ThingID)] = cats
|
||||
}
|
||||
return cats, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user