读取永辉excel
This commit is contained in:
@@ -163,14 +163,13 @@ func LoadExcelBinByYongHui(ctx *jxcontext.Context, reader io.Reader, isAsync, is
|
|||||||
goods := batchItemList[0].(*weimobapi.GoodsInfo)
|
goods := batchItemList[0].(*weimobapi.GoodsInfo)
|
||||||
goodsDetail := goods.GoodsDetailInfo
|
goodsDetail := goods.GoodsDetailInfo
|
||||||
spuCode := goodsDetail.OuterGoodsCode
|
spuCode := goodsDetail.OuterGoodsCode
|
||||||
errTmp := ""
|
|
||||||
if spuCode != "" {
|
if spuCode != "" {
|
||||||
//如果微盟商品里找得到excel中的商品
|
//如果微盟商品里找得到excel中的商品
|
||||||
if skuMap[spuCode] != 0 {
|
if skuMap[spuCode] != 0 {
|
||||||
//获取京西库商品
|
//获取京西库商品
|
||||||
skuList, _ := dao.GetSkus(db, nil, []int{int(utils.Str2Int64(goodsDetail.SkuMap.SingleSku.OuterSkuCode))}, nil, nil)
|
skuList, _ := dao.GetSkus(db, nil, []int{int(utils.Str2Int64(goodsDetail.SkuMap.SingleSku.OuterSkuCode))}, nil, nil)
|
||||||
if len(skuList) == 0 {
|
if len(skuList) == 0 {
|
||||||
errTmp += fmt.Sprintf("在京西库中未找到该商品!name_id : [%v]\n", goodsDetail.SkuMap.SingleSku.OuterSkuCode)
|
return "", errors.New(fmt.Sprintf("在京西库中未找到该商品!name_id : [%v]\n", goodsDetail.SkuMap.SingleSku.OuterSkuCode))
|
||||||
} else {
|
} else {
|
||||||
if skuList[0].Unit == "份" {
|
if skuList[0].Unit == "份" {
|
||||||
if goodsDetail.SkuMap.SingleSku.B2CSku.Weight == 0 {
|
if goodsDetail.SkuMap.SingleSku.B2CSku.Weight == 0 {
|
||||||
@@ -190,12 +189,9 @@ func LoadExcelBinByYongHui(ctx *jxcontext.Context, reader io.Reader, isAsync, is
|
|||||||
retVal = []int64{goodsDetail.GoodsID}
|
retVal = []int64{goodsDetail.GoodsID}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if errTmp != "" {
|
|
||||||
return retVal, errors.New(errTmp)
|
|
||||||
}
|
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}
|
}
|
||||||
taskParallel3 := tasksch.NewParallelTask("根据获取的微盟所有商品并更新", tasksch.NewParallelConfig().SetParallelCount(parallelCount), ctx, taskFunc3, goodsList)
|
taskParallel3 := tasksch.NewParallelTask("根据获取的微盟所有商品并更新", tasksch.NewParallelConfig().SetParallelCount(parallelCount).SetIsContinueWhenError(isContinueWhenError), ctx, taskFunc3, goodsList)
|
||||||
tasksch.HandleTask(taskParallel3, task, true).Run()
|
tasksch.HandleTask(taskParallel3, task, true).Run()
|
||||||
goodsIDListForPutAwayInterface, err2 := taskParallel3.GetResult(0)
|
goodsIDListForPutAwayInterface, err2 := taskParallel3.GetResult(0)
|
||||||
if err = err2; err != nil {
|
if err = err2; err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user