修复账号禁用及队列场次状态规则

问题与需求:后台禁用员工后旧会话仍可继续访问;实时队列跨天误读昨日场次;项目暂停后需禁止取号但允许叫号。

修复思路:账号权限变更时撤销会话并同步前端登录态;实时查询统一按项目时区当天场次过滤;拆分取号与叫号的状态校验,并补充前后端及 PostgreSQL 回归测试。
This commit is contained in:
2026-07-30 12:02:05 +08:00
parent 0e1ac400dc
commit 17d296263c
14 changed files with 752 additions and 54 deletions

View File

@@ -2,8 +2,6 @@ package httpapi
import (
"context"
"fmt"
"time"
"calllinesystem/server/internal/domain"
"calllinesystem/server/internal/model"
@@ -15,12 +13,11 @@ import (
func (s *Server) displayedExperiencedPeople(ctx context.Context, project model.Project, session *model.QueueSession) (int64, error) {
var actual int64
if session != nil {
location, err := time.LoadLocation(project.Timezone)
current, err := s.queueSessionIsCurrent(project, *session)
if err != nil {
return 0, fmt.Errorf("invalid project timezone: %w", err)
return 0, err
}
businessDate := s.now().In(location).Format("2006-01-02")
if session.BusinessDate.Format("2006-01-02") != businessDate {
if !current {
return domain.DisplayExperiencedPeople(project.ExperiencedPeopleStart, 0), nil
}
if err := s.db.WithContext(ctx).Model(&model.QueueTicket{}).