This commit is contained in:
邹宗楠
2023-07-24 18:34:45 +08:00
parent 15beac082e
commit 6c04f1a71b
4 changed files with 100 additions and 77 deletions

View File

@@ -242,7 +242,7 @@ func UpdateTaoVegetable(api *tao_vegetable.API, storeSkuList []*dao.StoreSkuSync
OuCode: utils.String2Pointer(vendorStoreID),
SkuCode: utils.String2Pointer(utils.Int2Str(v.SkuID)),
SkuName: utils.String2Pointer(checkNameLength(v.SkuName)),
MemberPrice: price,
MemberPrice: utils.String2Pointer("0"),
SkuPrice: price, // 优先使用skuPrice 靠后SalePrice
SuggestedPrice: price, // 优先使用skuPrice 靠后SalePrice
CategoryCode: utils.String2Pointer(utils.Int2Str(v.CategoryID)),
@@ -256,19 +256,6 @@ func UpdateTaoVegetable(api *tao_vegetable.API, storeSkuList []*dao.StoreSkuSync
}
updateSku.SkuPicUrls = uploadImg(api, []string{v.Img, v.Img2, v.Img3, v.Img4, v.Img5, v.DescImg})
updateSkuList = append(updateSkuList, updateSku)
//if (index+model.YES)%tao_vegetable.MAXHandleCount == model.NO || index+model.YES == totalCount {
// param.ParamList = &updateSkuList
// result, err := api.UpdateStoreSku(param)
// if err != nil {
// globals.SugarLogger.Debugf("UpdateStoreSku Tao Vegetable err : %s", err.Error())
// }
// // 记录失败的同步数据
// createFailedList, _ := SelectStoreSkuListByFoodList(storeSkuList, *result, storeID, model.VendorChineseNames[model.VendorIDTaoVegetable], syncType)
// failedList = append(failedList, createFailedList...)
// // 记录同步成功的数据
// param.ParamList = nil
// updateSkuList = make([]domain585.AlibabaWdkSkuUpdateSkuDo, 0, 0)
//}
}
param.ParamList = &updateSkuList
@@ -311,9 +298,9 @@ func createTaoVegetable(ctx *jxcontext.Context, api *tao_vegetable.API, storeSku
SubTitle: utils.String2Pointer("小时达"),
SubTitle1: utils.String2Pointer("一小时速达"),
//DeliveryUnit: utils.String2Pointer(storeSku.Unit),
DeliveryUnit: utils.String2Pointer("份"),
DeliverySpec: utils.String2Pointer(utils.Int2Str(model.YES)),
MemberPrice: price,
DeliveryUnit: utils.String2Pointer("份"),
DeliverySpec: utils.String2Pointer(utils.Int2Str(model.YES)),
//MemberPrice: price,
Storage: utils.String2Pointer(tao_vegetable.CreateStorage),
PickFloatRate: utils.String2Pointer(utils.Int2Str(model.NO)), // ? 0
ForbidReceiveDays: utils.Int64ToPointer(tao_vegetable.CreateShelfLife), // ? 7
@@ -592,23 +579,10 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrg
SkuPrice: price,
CleanSkuMemberPrice: utils.Int64ToPointer(model.YES),
SuggestedPrice: price,
MemberPrice: price,
MemberPrice: utils.String2Pointer("0"),
SubTitle: utils.String2Pointer("小时达"),
}
updateSkuList = append(updateSkuList, updateSku)
//if (index+model.YES)%tao_vegetable.MAXHandleCount == model.NO || (index+1) == len(storeSkuList) {
// param.ParamList = &updateSkuList
// result, err := api.UpdateStoreSku(param)
// if err != nil {
// globals.SugarLogger.Debugf("UpdateStoreSku Tao Vegetable err : %s", err.Error())
// }
// // 记录失败的同步数据
// createFailedList, _ := SelectStoreSkuListByFoodList(storeSkuList, *result, storeID, model.VendorChineseNames[model.VendorIDTaoVegetable], "修改商品价格")
// failedList = append(failedList, createFailedList...)
// param.ParamList = nil
// updateSkuList = make([]domain585.AlibabaWdkSkuUpdateSkuDo, 0, 0)
//}
}
param.ParamList = &updateSkuList
result, err := api.UpdateStoreSku(param)