1
This commit is contained in:
@@ -240,13 +240,14 @@ func UpdateTaoVegetable(api *tao_vegetable.API, storeSkuList []*dao.StoreSkuSync
|
|||||||
updateSkuList := make([]domain585.AlibabaWdkSkuUpdateSkuDo, 0, 0)
|
updateSkuList := make([]domain585.AlibabaWdkSkuUpdateSkuDo, 0, 0)
|
||||||
totalCount := len(storeSkuList)
|
totalCount := len(storeSkuList)
|
||||||
for index, v := range storeSkuList {
|
for index, v := range storeSkuList {
|
||||||
|
price := utils.String2Pointer(utils.Float64ToStr(float64(v.VendorPrice) / float64(100)))
|
||||||
updateSku := domain585.AlibabaWdkSkuUpdateSkuDo{
|
updateSku := domain585.AlibabaWdkSkuUpdateSkuDo{
|
||||||
OuCode: utils.String2Pointer(vendorStoreID),
|
OuCode: utils.String2Pointer(vendorStoreID),
|
||||||
SkuCode: utils.String2Pointer(utils.Int2Str(v.SkuID)),
|
SkuCode: utils.String2Pointer(utils.Int2Str(v.SkuID)),
|
||||||
SkuName: utils.String2Pointer(v.SkuName),
|
SkuName: utils.String2Pointer(v.SkuName),
|
||||||
MemberPrice: utils.String2Pointer(utils.Float64ToStr(float64(v.VendorPrice) / float64(100))),
|
MemberPrice: price,
|
||||||
SkuPrice: utils.String2Pointer(utils.Float64ToStr(float64(v.VendorPrice) / float64(100))), // 优先使用skuPrice 靠后SalePrice
|
SkuPrice: price, // 优先使用skuPrice 靠后SalePrice
|
||||||
SuggestedPrice: utils.String2Pointer(utils.Float64ToStr(float64(v.VendorPrice) / float64(100))), // 优先使用skuPrice 靠后SalePrice
|
SuggestedPrice: price, // 优先使用skuPrice 靠后SalePrice
|
||||||
CategoryCode: utils.String2Pointer(utils.Int2Str(v.CategoryID)),
|
CategoryCode: utils.String2Pointer(utils.Int2Str(v.CategoryID)),
|
||||||
MerchantCatCode: utils.String2Pointer(v.VendorCatID), // 优先使用 靠后 category_code
|
MerchantCatCode: utils.String2Pointer(v.VendorCatID), // 优先使用 靠后 category_code
|
||||||
}
|
}
|
||||||
@@ -284,6 +285,7 @@ func createTaoVegetable(ctx *jxcontext.Context, api *tao_vegetable.API, storeSku
|
|||||||
vendorSkuIdMap := make(map[string]string, 0)
|
vendorSkuIdMap := make(map[string]string, 0)
|
||||||
|
|
||||||
for index, storeSku := range storeSkuList {
|
for index, storeSku := range storeSkuList {
|
||||||
|
price := utils.String2Pointer(utils.Float64ToStr(utils.Int64ToFloat64(storeSku.VendorPrice) / utils.Int64ToFloat64(100)))
|
||||||
sku := domain585.AlibabaWdkSkuAddSkuDo{
|
sku := domain585.AlibabaWdkSkuAddSkuDo{
|
||||||
Barcodes: utils.String2Pointer(utils.Int2Str(storeSku.SkuID)),
|
Barcodes: utils.String2Pointer(utils.Int2Str(storeSku.SkuID)),
|
||||||
BrandName: utils.String2Pointer(tao_vegetable.CreateSkuBrandName),
|
BrandName: utils.String2Pointer(tao_vegetable.CreateSkuBrandName),
|
||||||
@@ -294,7 +296,7 @@ func createTaoVegetable(ctx *jxcontext.Context, api *tao_vegetable.API, storeSku
|
|||||||
SkuCode: utils.String2Pointer(utils.Int2Str(storeSku.SkuID)),
|
SkuCode: utils.String2Pointer(utils.Int2Str(storeSku.SkuID)),
|
||||||
SkuName: utils.String2Pointer(storeSku.SkuName),
|
SkuName: utils.String2Pointer(storeSku.SkuName),
|
||||||
StorageType: utils.Int64ToPointer(tao_vegetable.CreateSkuStorageType),
|
StorageType: utils.Int64ToPointer(tao_vegetable.CreateSkuStorageType),
|
||||||
SuggestedPrice: utils.String2Pointer(utils.Float64ToStr(utils.Int64ToFloat64(storeSku.VendorPrice) / utils.Int64ToFloat64(100))),
|
SuggestedPrice: price,
|
||||||
Weight: utils.String2Pointer(utils.Float32ToStr(storeSku.SpecQuality)),
|
Weight: utils.String2Pointer(utils.Float32ToStr(storeSku.SpecQuality)),
|
||||||
ShelfLife: utils.Int64ToPointer(tao_vegetable.CreateShelfLife),
|
ShelfLife: utils.Int64ToPointer(tao_vegetable.CreateShelfLife),
|
||||||
NetContent: utils.String2Pointer(utils.Float32ToStr(storeSku.SpecQuality)),
|
NetContent: utils.String2Pointer(utils.Float32ToStr(storeSku.SpecQuality)),
|
||||||
@@ -308,7 +310,7 @@ func createTaoVegetable(ctx *jxcontext.Context, api *tao_vegetable.API, storeSku
|
|||||||
//DeliveryUnit: utils.String2Pointer(storeSku.Unit),
|
//DeliveryUnit: utils.String2Pointer(storeSku.Unit),
|
||||||
DeliveryUnit: utils.String2Pointer("份"),
|
DeliveryUnit: utils.String2Pointer("份"),
|
||||||
DeliverySpec: utils.String2Pointer(utils.Int2Str(model.YES)),
|
DeliverySpec: utils.String2Pointer(utils.Int2Str(model.YES)),
|
||||||
MemberPrice: utils.String2Pointer(utils.Float64ToStr(float64(storeSku.VendorPrice) / float64(100))),
|
MemberPrice: price,
|
||||||
Storage: utils.String2Pointer(tao_vegetable.CreateStorage),
|
Storage: utils.String2Pointer(tao_vegetable.CreateStorage),
|
||||||
PickFloatRate: utils.String2Pointer(utils.Int2Str(model.NO)), // ? 0
|
PickFloatRate: utils.String2Pointer(utils.Int2Str(model.NO)), // ? 0
|
||||||
ForbidReceiveDays: utils.Int64ToPointer(tao_vegetable.CreateShelfLife), // ? 7
|
ForbidReceiveDays: utils.Int64ToPointer(tao_vegetable.CreateShelfLife), // ? 7
|
||||||
@@ -321,7 +323,7 @@ func createTaoVegetable(ctx *jxcontext.Context, api *tao_vegetable.API, storeSku
|
|||||||
PurchaseUnit: utils.String2Pointer("份"), // ? 同上
|
PurchaseUnit: utils.String2Pointer("份"), // ? 同上
|
||||||
LabelStyleType: utils.String2Pointer(tao_vegetable.CreateLabelStyleType), // 库存单位
|
LabelStyleType: utils.String2Pointer(tao_vegetable.CreateLabelStyleType), // 库存单位
|
||||||
ItemTypeNew: utils.Int64ToPointer(tao_vegetable.CreateItemTypeNewVegetable),
|
ItemTypeNew: utils.Int64ToPointer(tao_vegetable.CreateItemTypeNewVegetable),
|
||||||
SkuPrice: utils.String2Pointer(utils.Float64ToStr(float64(storeSku.VendorPrice) / float64(100))), // 优先使用skuPrice 靠后SalePrice
|
SkuPrice: price, // 优先使用skuPrice 靠后SalePrice
|
||||||
Period: utils.Int64ToPointer(tao_vegetable.CreateShelfLife), // 优先使用period 靠后shelf_life
|
Period: utils.Int64ToPointer(tao_vegetable.CreateShelfLife), // 优先使用period 靠后shelf_life
|
||||||
FragileFlag: utils.Int64ToPointer(model.YES),
|
FragileFlag: utils.Int64ToPointer(model.YES),
|
||||||
DeliveryStorage: utils.String2Pointer(tao_vegetable.CreateItemDeliveryStorage),
|
DeliveryStorage: utils.String2Pointer(tao_vegetable.CreateItemDeliveryStorage),
|
||||||
@@ -330,6 +332,10 @@ func createTaoVegetable(ctx *jxcontext.Context, api *tao_vegetable.API, storeSku
|
|||||||
MerchantCatCode: utils.String2Pointer(storeSku.VendorCatID), // 优先使用 靠后 category_code
|
MerchantCatCode: utils.String2Pointer(storeSku.VendorCatID), // 优先使用 靠后 category_code
|
||||||
}
|
}
|
||||||
sku.SkuPicUrls = uploadImg(api, []string{storeSku.ImgOrigin, storeSku.Img, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5, storeSku.DescImg})
|
sku.SkuPicUrls = uploadImg(api, []string{storeSku.ImgOrigin, storeSku.Img, storeSku.Img2, storeSku.Img3, storeSku.Img4, storeSku.Img5, storeSku.DescImg})
|
||||||
|
if sku.SkuPicUrls == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if storeSku.MinOrderCount <= model.YES {
|
if storeSku.MinOrderCount <= model.YES {
|
||||||
sku.PurchaseQuantity = utils.Int64ToPointer(model.YES) // 起购单位
|
sku.PurchaseQuantity = utils.Int64ToPointer(model.YES) // 起购单位
|
||||||
} else {
|
} else {
|
||||||
@@ -523,12 +529,14 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrg
|
|||||||
updateSkuList := make([]domain585.AlibabaWdkSkuUpdateSkuDo, 0, 0)
|
updateSkuList := make([]domain585.AlibabaWdkSkuUpdateSkuDo, 0, 0)
|
||||||
api := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID)
|
api := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID)
|
||||||
for index, v := range storeSkuList {
|
for index, v := range storeSkuList {
|
||||||
|
price := utils.String2Pointer(fmt.Sprintf("%.2f", float64(v.VendorPrice)/float64(100)))
|
||||||
updateSku := domain585.AlibabaWdkSkuUpdateSkuDo{
|
updateSku := domain585.AlibabaWdkSkuUpdateSkuDo{
|
||||||
OuCode: utils.String2Pointer(vendorStoreID),
|
OuCode: utils.String2Pointer(vendorStoreID),
|
||||||
SkuCode: utils.String2Pointer(utils.Int2Str(v.SkuID)),
|
SkuCode: utils.String2Pointer(utils.Int2Str(v.SkuID)),
|
||||||
SkuPrice: utils.String2Pointer(fmt.Sprintf("%.2f", (float64(1000)/float64(v.SpecQuality))*(float64(v.JxUnitPrice)/float64(100)))),
|
SkuPrice: price,
|
||||||
CleanSkuMemberPrice: utils.Int64ToPointer(model.YES),
|
CleanSkuMemberPrice: utils.Int64ToPointer(model.YES),
|
||||||
SuggestedPrice: utils.String2Pointer(fmt.Sprintf("%.2f", (float64(1000)/float64(v.SpecQuality))*(float64(v.JxUnitPrice)/float64(100)))),
|
SuggestedPrice: price,
|
||||||
|
MemberPrice: price,
|
||||||
}
|
}
|
||||||
updateSkuList = append(updateSkuList, updateSku)
|
updateSkuList = append(updateSkuList, updateSku)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user