- 整理partner.ReadStore

This commit is contained in:
gazebo
2019-07-22 15:04:07 +08:00
parent 71f6d0809a
commit a4470e5fb5
13 changed files with 92 additions and 84 deletions

View File

@@ -113,23 +113,21 @@ func rangeJX2Mtwm(coords string) string {
return ""
}
func openTimeMtwm2JX(vendorOpenTime string) [][2]int16 {
func openTimeMtwm2JX(vendorOpenTime string) (opTimeList []int16) {
timePairs := strings.Split(vendorOpenTime, ",")
jxOpenTimers := make([][2]int16, len(timePairs))
for k, v := range timePairs {
for _, v := range timePairs {
times := strings.Split(v, "-")
jxOpenTimers[k][0] = jxutils.StrTime2JxOperationTime(times[0], 700)
jxOpenTimers[k][1] = jxutils.StrTime2JxOperationTime(times[1], 2000)
opTimeList = append(opTimeList, jxutils.StrTime2JxOperationTime(times[0]+":00", 700), jxutils.StrTime2JxOperationTime(times[1]+":00", 2000))
}
return jxOpenTimers
return opTimeList
}
func openTimeJX2Mtwm(times []int16) string {
timesLen := len(times) / 2 * 2
func openTimeJX2Mtwm(opTimeList []int16) string {
timesLen := len(opTimeList) / 2 * 2
var strPairs []string
for i := 0; i < timesLen; i += 2 {
if times[i] != 0 {
strPairs = append(strPairs, jxutils.JxOperationTime2StrTime(times[i])+"-"+jxutils.JxOperationTime2StrTime(times[i+1]))
if opTimeList[i] != 0 {
strPairs = append(strPairs, jxutils.JxOperationTime2StrTime(opTimeList[i])+"-"+jxutils.JxOperationTime2StrTime(opTimeList[i+1]))
} else {
break
}