aa
This commit is contained in:
@@ -260,6 +260,31 @@ func SyncReorderCategories(ctx *jxcontext.Context, parentCatID int, isAsync bool
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func SyncReorderCategories2(ctx *jxcontext.Context, parentCatID, vendorID int, vendorOrgCode string) (err error) {
|
||||
globals.SugarLogger.Debugf("SyncReorderCategories parentCatID:%d", parentCatID)
|
||||
db := dao.GetDB()
|
||||
multiStoresHandler := CurVendorSync.GetMultiStoreHandler(vendorID)
|
||||
if multiStoresHandler != nil {
|
||||
var vendorCatIDList []string
|
||||
var parentVendorCatID string
|
||||
vendorCatList, _ := dao.GetVendorCategoryMapExt(db, parentCatID, 0, vendorID, vendorOrgCode, 0)
|
||||
for _, v := range vendorCatList {
|
||||
if v.VendorThingID != "" {
|
||||
vendorCatIDList = append(vendorCatIDList, v.VendorThingID)
|
||||
}
|
||||
}
|
||||
thingMaps, _ := dao.GetThingMapList(db, model.ThingTypeCategory, []int{vendorID}, []int{parentCatID}, []string{vendorOrgCode})
|
||||
parentVendorCatID = thingMaps[0].VendorThingID
|
||||
|
||||
if len(vendorCatIDList) > 0 {
|
||||
err = multiStoresHandler.ReorderCategories2(ctx, vendorOrgCode, parentVendorCatID, vendorCatIDList)
|
||||
}
|
||||
} else {
|
||||
err = fmt.Errorf("非法平台:%d", vendorID)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func getThingMap(db *dao.DaoDB, thingMap *model.ThingMap) (err error) {
|
||||
return dao.GetEntity(db, thingMap, "ThingID", "ThingType", "VendorID", "VendorOrgCode", model.FieldDeletedAt)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user