订单计算相关
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
953 B

package ordercalc
import (
"testing"
)
func Test_DistributionPrice(t *testing.T) {
business := map[string]string{"Id": "4", "LevelId": "3", "Grade": "3"}
productSpecialPrice := make([]map[string]string, 0)
price := make(map[string]string)
price["BusinessId"] = "0"
price["BusinessLevelId"] = "2"
// price["DistributionPrice"] = "#distribution_price#+5"
price["DistributionPrice"] = "0.05"
// productSpecialPrice = append(productSpecialPrice, price)
price = make(map[string]string)
price["BusinessId"] = "0"
price["BusinessLevelId"] = "3"
price["DistributionPrice"] = "0.05"
// productSpecialPrice = append(productSpecialPrice, price)
price = make(map[string]string)
price["BusinessId"] = "0"
price["BusinessLevelId"] = ""
price["DistributionPrice"] = "12"
// productSpecialPrice = append(productSpecialPrice, price)
dis, err := DistributionPrice(business, productSpecialPrice, 0.07, "7:2:1", 0.5)
t.Log(dis)
t.Log(err)
}