- auto create jd promotion on jd new promotion event

This commit is contained in:
gazebo
2018-11-08 16:08:35 +08:00
parent bd6cf367a0
commit 69aad912cd
5 changed files with 227 additions and 40 deletions

View File

@@ -115,6 +115,16 @@ func IntMap2List(intMap map[int]int) []int {
return retVal
}
func Int64Map2List(int64Map map[int64]int) []int64 {
retVal := make([]int64, len(int64Map))
index := 0
for k := range int64Map {
retVal[index] = k
index++
}
return retVal
}
// 计算SKU价格unitPrice为一斤的单价specQuality为质量单位为克
func CaculateSkuPrice(unitPrice int, specQuality float32, specUnit string, skuNameUnit string) int {
if skuNameUnit != "份" {
@@ -170,3 +180,10 @@ func FormalizePageSize(pageSize int) int {
func FormalizeName(name string) string {
return utils.TrimBlankChar(strings.Replace(strings.Replace(name, "\t", "", -1), "\"", "", -1))
}
func Int2OneZero(value int) int {
if value != 0 {
return 1
}
return 0
}