- GetVendorStore for ebai.
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
package jxutils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
// 合并得到最终的门店状态
|
||||
func MergeStoreStatus(status int, vendorStatus int) int {
|
||||
if status < vendorStatus {
|
||||
@@ -28,3 +36,31 @@ func SplitSlice(list []interface{}, batchCount int) (listInList [][]interface{})
|
||||
}
|
||||
return listInList
|
||||
}
|
||||
|
||||
func SplitStoreName(fullName, separator, defaultPrefix string) (prefix, bareName string) {
|
||||
names := strings.Split(fullName, separator)
|
||||
if len(names) == 2 {
|
||||
prefix = names[0]
|
||||
bareName = names[1]
|
||||
} else {
|
||||
prefix = defaultPrefix
|
||||
bareName = strings.Trim(strings.Trim(fullName, defaultPrefix), separator)
|
||||
|
||||
}
|
||||
return utils.TrimBlanChar(defaultPrefix), utils.TrimBlanChar(bareName)
|
||||
}
|
||||
|
||||
func ComposeStoreName(bareName, separator, prefix string) (fullName string) {
|
||||
return prefix + separator + utils.TrimBlanChar(strings.Trim(bareName, separator))
|
||||
}
|
||||
|
||||
func StrTime2JxOperationTime(strTime string, defValue int16) int16 {
|
||||
if timeValue, err := time.Parse("15:04:05", strTime); err == nil {
|
||||
return int16(timeValue.Hour()*100 + timeValue.Minute())
|
||||
}
|
||||
return defValue
|
||||
}
|
||||
|
||||
func JxOperationTime2StrTime(value int16) string {
|
||||
return fmt.Sprintf("%02d:%02d:00", value/100, value%100)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user