aa
This commit is contained in:
@@ -1829,33 +1829,24 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
vendorThingIDs []int64
|
vendorThingIDs []int64
|
||||||
|
thingIDs []int
|
||||||
)
|
)
|
||||||
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{667281}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406")
|
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{667281}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406")
|
||||||
things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, nil, []string{"320406"})
|
for _, v := range storeMaps {
|
||||||
|
storesSkus, _ := dao.GetStoresSkusInfo(db, []int{v.StoreID}, nil)
|
||||||
|
for _, vv := range storesSkus {
|
||||||
|
if vv.Stock > 0 && vv.Status == model.StoreSkuBindStatusNormal {
|
||||||
|
thingIDs = append(thingIDs, vv.SkuID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, thingIDs, []string{"320406"})
|
||||||
thingIDmap := make(map[int64]string)
|
thingIDmap := make(map[int64]string)
|
||||||
|
|
||||||
for _, v := range things {
|
for _, v := range things {
|
||||||
vendorThingIDs = append(vendorThingIDs, utils.Str2Int64(v.VendorThingID))
|
vendorThingIDs = append(vendorThingIDs, utils.Str2Int64(v.VendorThingID))
|
||||||
thingIDmap[utils.Str2Int64(v.VendorThingID)] = utils.Int64ToStr(v.ThingID)
|
thingIDmap[utils.Str2Int64(v.VendorThingID)] = utils.Int64ToStr(v.ThingID)
|
||||||
}
|
}
|
||||||
// for i := 0; i < len(things); i += 50 {
|
|
||||||
// // var idList []*jdapi.SkuIdEntity
|
|
||||||
// var idList2 []int64
|
|
||||||
// j := i + 50
|
|
||||||
// if j > len(things)-1 {
|
|
||||||
// j = len(things) - 1
|
|
||||||
// }
|
|
||||||
// for _, v := range things[i:j] {
|
|
||||||
// if v.VendorThingID != "" {
|
|
||||||
// // idList = append(idList, &jdapi.SkuIdEntity{
|
|
||||||
// // OutSkuId: utils.Int64ToStr(v.ThingID),
|
|
||||||
// // })
|
|
||||||
// idList2 = append(idList2, utils.Str2Int64(v.VendorThingID))
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // idLists = append(idLists, idList)
|
|
||||||
// idLists2 = append(idLists2, idList2)
|
|
||||||
// }
|
|
||||||
|
|
||||||
task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user