逻辑更新

This commit is contained in:
yan.y 2024-05-09 21:26:13 +08:00
parent 1c3540ebf1
commit de895227ef
3 changed files with 5 additions and 5 deletions

View File

@ -180,7 +180,7 @@ func DataInit() {
for _, value := range serviceTimesList {
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() {

View File

@ -228,6 +228,6 @@ type ReserveTimeFilter struct {
// AddrServiceTime 服务地址时间排期
type AddrServiceTime struct {
Id int `gorm:"primaryKey;autoIncrement" json:"id"` //id
ServiceAddrId int64 `gorm:"index;not null" json:"ServiceAddrId"` //服务地址ID
Times string `gorm:"index;not null" json:"times"` //时间列表
ServiceAddrId int64 `gorm:"not null" json:"ServiceAddrId"` //服务地址ID
Times string `gorm:"not null" json:"times"` //时间列表
}

View File

@ -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")]
if (nextHour.Hour() >= workStart && nextHour.Hour() < workEnd) && (!existsDay && !existsHour) && !existOrderTime {
key := nextHour.Format("2006-01-02")
if _, ok := serviceDaysMap[key]; !ok {
if _, ok := serviceDaysMap[key]; len(serviceDaysMap) > 0 && !ok {
//不存在服务配置中返回false
dayHoursMap[key] = append(dayHoursMap[key], TimeObject{
Time: nextHour.Format("15:04"),