updateThingMapEntity
This commit is contained in:
@@ -316,20 +316,22 @@ func OnThingSync(ctx *jxcontext.Context, db *dao.DaoDB, thingMap *model.ThingMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateThingMapEntity(db *dao.DaoDB, thingMap *model.ThingMap) {
|
func updateThingMapEntity(db *dao.DaoDB, thingMap *model.ThingMap) {
|
||||||
if thingMap.ThingType == model.ThingTypeCategory {
|
if thingMap.VendorOrgCode == globals.JdOrgCode {
|
||||||
cat := &model.SkuCategory{
|
if thingMap.ThingType == model.ThingTypeCategory {
|
||||||
JdID: utils.Str2Int64WithDefault(thingMap.VendorThingID, 0),
|
cat := &model.SkuCategory{
|
||||||
JdSyncStatus: thingMap.SyncStatus,
|
JdID: utils.Str2Int64WithDefault(thingMap.VendorThingID, 0),
|
||||||
|
JdSyncStatus: thingMap.SyncStatus,
|
||||||
|
}
|
||||||
|
cat.ID = int(thingMap.ThingID)
|
||||||
|
dao.UpdateEntity(db, cat, "JdID", "JdSyncStatus")
|
||||||
|
} else if thingMap.ThingType == model.ThingTypeSku {
|
||||||
|
sku := &model.Sku{
|
||||||
|
JdID: utils.Str2Int64WithDefault(thingMap.VendorThingID, 0),
|
||||||
|
JdSyncStatus: thingMap.SyncStatus,
|
||||||
|
}
|
||||||
|
sku.ID = int(thingMap.ThingID)
|
||||||
|
dao.UpdateEntity(db, sku, "JdID", "JdSyncStatus")
|
||||||
}
|
}
|
||||||
cat.ID = int(thingMap.ThingID)
|
|
||||||
dao.UpdateEntity(db, cat, "JdID", "JdSyncStatus")
|
|
||||||
} else if thingMap.ThingType == model.ThingTypeSku {
|
|
||||||
sku := &model.Sku{
|
|
||||||
JdID: utils.Str2Int64WithDefault(thingMap.VendorThingID, 0),
|
|
||||||
JdSyncStatus: thingMap.SyncStatus,
|
|
||||||
}
|
|
||||||
sku.ID = int(thingMap.ThingID)
|
|
||||||
dao.UpdateEntity(db, sku, "JdID", "JdSyncStatus")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user