逻辑更新
This commit is contained in:
parent
1c3540ebf1
commit
de895227ef
|
|
@ -180,7 +180,7 @@ func DataInit() {
|
||||||
for _, value := range serviceTimesList {
|
for _, value := range serviceTimesList {
|
||||||
AddrServiceMap[value.ServiceAddrId] = value
|
AddrServiceMap[value.ServiceAddrId] = value
|
||||||
}
|
}
|
||||||
zap_server.ZAPLOG.Info("dataInit AddrServiceMap : ", zap.Any("AddrServiceMap", CarMap))
|
zap_server.ZAPLOG.Info("dataInit AddrServiceMap : ", zap.Any("AddrServiceMap", AddrServiceMap))
|
||||||
}
|
}
|
||||||
|
|
||||||
func DataCacheJob() {
|
func DataCacheJob() {
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ type ReserveTimeFilter struct {
|
||||||
|
|
||||||
// AddrServiceTime 服务地址时间排期
|
// AddrServiceTime 服务地址时间排期
|
||||||
type AddrServiceTime struct {
|
type AddrServiceTime struct {
|
||||||
Id int `gorm:"primaryKey;autoIncrement" json:"id"` //id
|
Id int `gorm:"primaryKey;autoIncrement" json:"id"` //id
|
||||||
ServiceAddrId int64 `gorm:"index;not null" json:"ServiceAddrId"` //服务地址ID
|
ServiceAddrId int64 `gorm:"not null" json:"ServiceAddrId"` //服务地址ID
|
||||||
Times string `gorm:"index;not null" json:"times"` //时间列表
|
Times string `gorm:"not null" json:"times"` //时间列表
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ func GetStrDays(day int, minute int, reserveMap map[string]models.ReserveTimeFil
|
||||||
orderNum, existOrderNum := orderNumMap[nextHour.Format("2006-01-02 15:04")]
|
orderNum, existOrderNum := orderNumMap[nextHour.Format("2006-01-02 15:04")]
|
||||||
if (nextHour.Hour() >= workStart && nextHour.Hour() < workEnd) && (!existsDay && !existsHour) && !existOrderTime {
|
if (nextHour.Hour() >= workStart && nextHour.Hour() < workEnd) && (!existsDay && !existsHour) && !existOrderTime {
|
||||||
key := nextHour.Format("2006-01-02")
|
key := nextHour.Format("2006-01-02")
|
||||||
if _, ok := serviceDaysMap[key]; !ok {
|
if _, ok := serviceDaysMap[key]; len(serviceDaysMap) > 0 && !ok {
|
||||||
//不存在服务配置中返回false
|
//不存在服务配置中返回false
|
||||||
dayHoursMap[key] = append(dayHoursMap[key], TimeObject{
|
dayHoursMap[key] = append(dayHoursMap[key], TimeObject{
|
||||||
Time: nextHour.Format("15:04"),
|
Time: nextHour.Format("15:04"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue