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
|
||||
}
|
||||
|
||||
|
||||
@@ -886,21 +886,21 @@ func (c *SkuController) UpdateTiktokCategory() {
|
||||
item.VendorCategoryID = data2[v.DdId]
|
||||
skuVendorCategoryMap := &model.SkuVendorCategoryMap{}
|
||||
if err := dao.GetRow(db, skuVendorCategoryMap, `SELECT * FROM sku_vendor_category_map WHERE name_id = ? AND vendor_id = ? AND deleted_at = ?`, []interface{}{v.NameId, model.VendorIDDD, utils.DefaultTimeValue}); err != nil {
|
||||
globals.SugarLogger.Debugf("====================err3 %s", err)
|
||||
globals.SugarLogger.Errorf("get row err : %v", err)
|
||||
}
|
||||
if skuVendorCategoryMap != nil && skuVendorCategoryMap.ID > 0 {
|
||||
if _, err := dao.UpdateEntity(db, skuVendorCategoryMap, "VendorCategoryID"); err != nil {
|
||||
globals.SugarLogger.Debugf("====================err4 %s", err)
|
||||
globals.SugarLogger.Errorf("update err : %v", err)
|
||||
}
|
||||
} else {
|
||||
if err := dao.CreateEntity(db, item); err != nil {
|
||||
globals.SugarLogger.Debugf("====================err5 %s", err)
|
||||
globals.SugarLogger.Errorf("create err : %v", err)
|
||||
}
|
||||
}
|
||||
go func() {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
hit, err := cms.CurVendorSync.SyncStoresSkus(params.Ctx, nil, 0, db, []int{14}, []int{v.StoreId}, []int{v.Id}, true, false, true)
|
||||
globals.SugarLogger.Debugf("===============hit:%s err: %s", hit, err)
|
||||
globals.SugarLogger.Debugf("hit:%s err: %v", hit, err)
|
||||
}()
|
||||
}
|
||||
if page*pageSize < total {
|
||||
|
||||
@@ -157,7 +157,6 @@ func (c *LogisticsController) LogisticsQuery() {
|
||||
// 查询订单的运单是否存在
|
||||
data, err := dao.GetWayBillsByWayBillId(dao.GetDB(), param.TrackNo)
|
||||
if err != nil || len(data) == 0 {
|
||||
globals.SugarLogger.Debugf("根据单号查询运单数据错误:%s,运单号 :%s", err.Error(), param.TrackNo)
|
||||
c.Data["json"] = LogisticsQueryRest{
|
||||
Result: false,
|
||||
ReturnCode: "1002",
|
||||
|
||||
@@ -40,7 +40,6 @@ func (t *TiktokController) CallbackTiktokOrderMsg() {
|
||||
|
||||
for k, v := range orderStatus {
|
||||
for _, callback := range v {
|
||||
globals.SugarLogger.Debugf("CallbackTiktokOrderMsg v======%s", utils.Format4Output(v, false))
|
||||
resp2 := tiktok_store.OnOrderMsg(k, callback)
|
||||
if resp2.Code != 0 {
|
||||
t.Data["json"] = resp2
|
||||
|
||||
Reference in New Issue
Block a user