This commit is contained in:
邹宗楠
2022-10-27 15:07:09 +08:00
parent 8f42a925a9
commit 5a4fe56de7
3 changed files with 72 additions and 33 deletions

View File

@@ -2,6 +2,7 @@ package cms
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store"
"strings"
"time"
@@ -331,18 +332,19 @@ func OnCreateThing(ctx *jxcontext.Context, db *dao.DaoDB, vendorInfoList []*mode
return err
}
func OnCreateThing2Tiktok(ctx *jxcontext.Context, db *dao.DaoDB, appOrgCode string, vendorThingList map[string]int64, thingType, syncFlag int8, vendorFlag bool) (err error) {
func OnCreateThing2Tiktok(ctx *jxcontext.Context, db *dao.DaoDB, appOrgCode string, vendorThingList []*tiktok_store.TiktokIdAndLocalSkuId, thingType, syncFlag int8, vendorFlag bool) (err error) {
if thingType == model.ThingTypeSkuName {
return nil
}
errList := errlist.New()
for k, v := range vendorThingList {
for _, v := range vendorThingList {
thingMap := &model.ThingMap{
ThingID: v,
ThingID: v.LocalSkuId,
ThingType: thingType,
VendorID: model.VendorIDDD,
VendorOrgCode: appOrgCode,
VendorThingID: k,
VendorThingID: v.MainId,
Remark: v.SkuAttrId,
}
if thingType == model.ThingTypeCategory && !vendorFlag {
syncFlag = 0