diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index ab59b78c4..5cd8e4116 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -253,7 +253,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac if v.PricePercentage != 0 { percentage = v.PricePercentage } - actSkuMap.ActualActPrice = int64(jxutils.CaculateSkuVendorPrice(int(actSkuMap.VendorPrice), percentage, 0)) + actSkuMap.ActualActPrice = int64(jxutils.CaculateSkuActVendorPrice(int(actSkuMap.VendorPrice), percentage, 0)) if actSkuMap.ActualActPrice > 10 { actSkuMap.ActualActPrice = int64(math.Floor(float64(actSkuMap.ActualActPrice)/10) * 10) } @@ -596,7 +596,7 @@ func CreateAct(ctx *jxcontext.Context, act *model.Act, vendorIDs []int, vendorOr _, err = SyncAct(ctx, task, actID, nil, false) return retVal, err }, neeSyncActIDs) - + tasksch.HandleTask(task, nil, true).Run() if !isAsync { hint = utils.Int2Str(act.ID) diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index 774fe54a3..ebf749df0 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -259,9 +259,19 @@ func ConstrainPricePercentage(percentage int) int { return percentage } +func CaculateSkuActVendorPrice(price, percentage, priceAdd int) (vendorPrice int) { + percentage = ConstrainPricePercentage(percentage) + vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd + if vendorPrice < 1 { + vendorPrice = 1 + } + return vendorPrice +} + func CaculateSkuVendorPrice(price, percentage, priceAdd int) (vendorPrice int) { percentage = ConstrainPricePercentage(percentage) vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd + vendorPrice = int(math.Ceil(float64(vendorPrice)/10) * 10) if vendorPrice < 1 { vendorPrice = 1 }