aa
This commit is contained in:
@@ -903,7 +903,7 @@ func AddSkuName(ctx *jxcontext.Context, skuNameExt *model.SkuNameExt, userName s
|
||||
return nil, err
|
||||
}
|
||||
if sku.EclpID == "" {
|
||||
if err = OnCreateThing(ctx, db, nil, int64(sku.ID), model.ThingTypeSku, model.SyncFlagNewMask); err != nil {
|
||||
if err = OnCreateThing(ctx, db, nil, int64(sku.ID), model.ThingTypeSku, 0); err != nil {
|
||||
dao.Rollback(db)
|
||||
return nil, err
|
||||
}
|
||||
@@ -1248,7 +1248,7 @@ func AddSku(ctx *jxcontext.Context, nameID int, sku *model.Sku, userName string)
|
||||
dao.Rollback(db)
|
||||
return nil, err
|
||||
}
|
||||
if err = OnCreateThing(ctx, db, nil, int64(sku.ID), model.ThingTypeSku, model.SyncFlagNewMask); err != nil {
|
||||
if err = OnCreateThing(ctx, db, nil, int64(sku.ID), model.ThingTypeSku, 0); err != nil {
|
||||
dao.Rollback(db)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -1235,6 +1235,39 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
//下面这段很难受
|
||||
{
|
||||
//如果是京东关注,要去建商品
|
||||
list1, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{storeID}, nil, model.StoreStatusAll, 1, "", "", "")
|
||||
//表示这个门店绑定了京东
|
||||
if len(list1) > 0 {
|
||||
//thingmap里肯定存在,再判断有没有同步上去
|
||||
thingMaps, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, []int{v.RealSkuID}, []string{list1[0].VendorOrgCode})
|
||||
if len(thingMaps) > 0 {
|
||||
//如果平台ID为空(未创建到京东)
|
||||
if thingMaps[0].VendorThingID == "" {
|
||||
//并且同步标志还没有带待创建(因为addskuname现在建到thingmap上不会带待创建标志了)
|
||||
if !model.IsSyncStatusNew(thingMaps[0].SyncStatus) {
|
||||
OnCreateThing(ctx, db, []*MultiStoreVendorInfo{
|
||||
&MultiStoreVendorInfo{
|
||||
VendorID: model.VendorIDJD,
|
||||
OrgCode: list1[0].VendorOrgCode,
|
||||
},
|
||||
}, int64(v.RealSkuID), model.ThingTypeSku, model.SyncFlagNewMask)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//万一不存在
|
||||
OnCreateThing(ctx, db, []*MultiStoreVendorInfo{
|
||||
&MultiStoreVendorInfo{
|
||||
VendorID: model.VendorIDJD,
|
||||
OrgCode: list1[0].VendorOrgCode,
|
||||
},
|
||||
}, int64(v.RealSkuID), model.ThingTypeSku, model.SyncFlagNewMask)
|
||||
}
|
||||
_, err = SyncSkus(ctx, nil, []int{model.VendorIDJD}, []string{list1[0].VendorOrgCode}, nil, []int{v.RealSkuID}, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user