去掉Sku,SkuName和SkuCategory中的JdID与JdSyncStatus

This commit is contained in:
gazebo
2020-01-02 16:56:06 +08:00
parent c444202330
commit df927137da
6 changed files with 444 additions and 435 deletions

View File

@@ -379,23 +379,23 @@ func OnThingSync(ctx *jxcontext.Context, db *dao.DaoDB, thingMap *model.ThingMap
}
func updateThingMapEntity(db *dao.DaoDB, thingMap *model.ThingMap) {
if thingMap.VendorOrgCode == globals.JdOrgCode {
if thingMap.ThingType == model.ThingTypeCategory {
cat := &model.SkuCategory{
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")
}
}
// if thingMap.VendorOrgCode == globals.JdOrgCode {
// if thingMap.ThingType == model.ThingTypeCategory {
// cat := &model.SkuCategory{
// 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")
// }
// }
}
func amendAndPruneVendorStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, isAsync, isContinueWhenError bool, opType int, isForceUpdate bool) (hint string, err error) {