叫号接口

This commit is contained in:
张松
2025-02-21 14:44:34 +08:00
parent 0e7475d894
commit 14a65c4787
31 changed files with 1594 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
package com.czg.account.dto.calltable;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class BaseCallTableDTO {
/**
* 叫号桌型id
*/
@NotNull(message = "台桌id不为空")
private Integer callTableId;
}

View File

@@ -0,0 +1,17 @@
package com.czg.account.dto.calltable;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class CallQueueDTO{
/**
* 叫号队列id
*/
@NotNull
private Integer callQueueId;
}

View File

@@ -0,0 +1,17 @@
package com.czg.account.dto.calltable;
import com.czg.account.entity.CallQueue;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class CallQueueListDTO extends CallQueue {
/**
* 等待人数
*/
private Long waitingCount;
}

View File

@@ -0,0 +1,22 @@
package com.czg.account.dto.calltable;
import com.czg.account.entity.CallQueue;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class CallRecordVO extends CallQueue {
/**
* 备注
*/
private String note;
/**
* 已过秒数
*/
private Long sinceAt;
}

View File

@@ -0,0 +1,55 @@
package com.czg.account.dto.calltable;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class CallTableDTO {
/**
* 台桌名称
*/
@NotEmpty(message = "台桌名称不为空")
private String name;
/**
* 备注
*/
private String note;
/**
* 等待时间
*/
@NotNull(message = "等待时间不为空")
@Min(1)
private Integer waitTime;
/**
* 前缀
*/
@NotBlank(message = "前缀不为空")
private String prefix;
/**
* 起始号码
*/
@NotNull(message = "起始号码不为空")
@Min(1)
private Integer start;
/**
* 临近几桌提醒
*/
@NotNull(message = "最近号码不为空")
@Min(1)
private Integer nearNum;
/**
* 是否顺延
*/
private Integer isPostpone;
/**
* 顺延数量
*/
private Integer postponeNum;
}

View File

@@ -0,0 +1,17 @@
package com.czg.account.dto.calltable;
import com.czg.account.entity.CallTable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class CallTableInfoDTO extends CallTable {
/**
* 已经排号人数
*/
private long totalCount;
}

View File

@@ -0,0 +1,24 @@
package com.czg.account.dto.calltable;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author Administrator
*/
@Data
@Accessors(chain = true)
public class CallTableNumDTO {
/**
* 桌型名称
*/
private String tableName;
/**
* 桌型备注
*/
private String tableNote;
/**
* 号码
*/
private String callNum;
}

View File

@@ -0,0 +1,18 @@
package com.czg.account.dto.calltable;
import com.czg.account.entity.CallTable;
import com.mybatisflex.core.paginate.Page;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class CallTablePage extends Page<CallTable> {
/**
* 总数
*/
private long totalCount;
}

View File

@@ -0,0 +1,33 @@
package com.czg.account.dto.calltable;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class TakeNumberDTO extends BaseCallTableDTO{
/**
* 对应小程序用户id
*/
private Integer userId;
/**
* 手机号
*/
@NotEmpty
@Pattern(regexp = "^1\\d{10}$|^(0\\d{2,3}-?|\\(0\\d{2,3}\\))?[1-9]\\d{4,7}(-\\d{1,8})?$",message = "手机号码格式错误")
private String phone;
/**
* 备注
*/
private String note;
/**
* 姓名
*/
private String name;
}

View File

@@ -0,0 +1,21 @@
package com.czg.account.dto.calltable;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
/**
* @author Administrator
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Getter
public class UpdateCallQueueDTO extends CallQueueDTO{
/**
* 状态 -1已取消 0排队中 1叫号中 2已入座 3 已过号
*/
@NotNull
private Integer state;
}

View File

@@ -0,0 +1,45 @@
package com.czg.account.dto.calltable;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class UpdateCallTableDTO{
/**
* 桌型id
*/
@NotNull(message = "台桌id不为空")
private Integer callTableId;
/**
* 桌型名称
*/
private String name;
/**
* 桌型备注
*/
private String note;
/**
* 每桌等待时间
*/
@Min(1)
private Integer waitTime;
/**
* 前缀
*/
private String prefix;
/**
* 叫号起始号码
*/
@Min(1)
private Integer start;
/**
* 临近几桌提醒
*/
@Min(1)
private Integer nearNum;
}

View File

@@ -0,0 +1,22 @@
package com.czg.account.dto.calltable;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class UpdateConfigDTO {
/**
* 是否线上取号
*/
private Integer isOnline;
/**
* 背景图片
*/
private String bgCover;
/**
* 临近几桌提醒
*/
private Integer nearNum;
}

View File

@@ -0,0 +1,82 @@
package com.czg.account.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.io.Serial;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 叫号配置表 实体类。
*
* @author zs
* @since 2025-02-21
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("tb_call_config")
public class CallConfig implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id(keyType = KeyType.Auto)
private Long id;
/**
* 小程序页面地址
*/
private String pageAddress;
/**
* 线上取号 1是 0否
*/
private Integer isOnline;
/**
* 背景图片
*/
private String bgCover;
/**
* 成功提示
*/
private String successMsg;
/**
* 临近提示
*/
private String nearMsg;
/**
* 过号提示
*/
private String callingMsg;
/**
* 店铺id
*/
private Long shopId;
/**
* 临近几桌提醒
*/
private Integer nearNum;
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,126 @@
package com.czg.account.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.io.Serial;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 叫号排号队列表 实体类。
*
* @author zs
* @since 2025-02-21
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("tb_call_queue")
public class CallQueue implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id(keyType = KeyType.Auto)
private Long id;
private Long userId;
private String openId;
/**
* 叫号台桌类型id
*/
private Long callTableId;
/**
* 手机号
*/
private String phone;
/**
* 姓名
*/
private String name;
/**
* 店铺名称
*/
private String shopName;
/**
* 店铺id
*/
private Long shopId;
/**
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
*/
private Integer state;
/**
* 订阅提醒 0未订阅 1已订阅
*/
private Integer subState;
/**
* 备注
*/
private String note;
/**
* 叫号号码
*/
private String callNum;
/**
* 创建年月日
*/
private String createDay;
/**
* 是否已经顺延 0 未顺延 1已顺延一次 2顺延一次仍然过号
*/
private Integer isPostpone;
/**
* 排号时间
*/
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
/**
* 叫号时间
*/
private LocalDateTime callTime;
/**
* 叫号次数
*/
private Integer callCount;
/**
* 过号时间
*/
private LocalDateTime passTime;
/**
* 取消时间
*/
private LocalDateTime cancelTime;
/**
* 确认时间
*/
private LocalDateTime confirmTime;
}

View File

@@ -0,0 +1,97 @@
package com.czg.account.entity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.io.Serial;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 叫号桌型表 实体类。
*
* @author zs
* @since 2025-02-21
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("tb_call_table")
public class CallTable implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id(keyType = KeyType.Auto)
private Long id;
/**
* 店铺id
*/
private Long shopId;
/**
* 名称
*/
private String name;
/**
* 描述
*/
private String note;
/**
* 等待时间分钟
*/
private Integer waitTime;
/**
* 前缀
*/
private String prefix;
/**
* 起始号码
*/
private Integer start;
/**
* 临近几桌提醒
*/
private Integer nearNum;
/**
* 0禁用 1使用
*/
private Integer state;
/**
* 二维码地址
*/
private String qrcode;
/**
* 顺延号码数量
*/
private Integer postponeNum;
/**
* 顺延号码数量
*/
private Integer isPostpone;
@Column(onInsertValue = "now()")
private LocalDateTime createTime;
@Column(onInsertValue = "now()", onUpdateValue = "now()")
private LocalDateTime updateTime;
}

View File

@@ -0,0 +1,14 @@
package com.czg.account.service;
import com.mybatisflex.core.service.IService;
import com.czg.account.entity.CallConfig;
/**
* 叫号配置表 服务层。
*
* @author zs
* @since 2025-02-21
*/
public interface CallConfigService extends IService<CallConfig> {
}

View File

@@ -0,0 +1,14 @@
package com.czg.account.service;
import com.mybatisflex.core.service.IService;
import com.czg.account.entity.CallQueue;
/**
* 叫号排号队列表 服务层。
*
* @author zs
* @since 2025-02-21
*/
public interface CallQueueService extends IService<CallQueue> {
}

View File

@@ -0,0 +1,39 @@
package com.czg.account.service;
import com.czg.account.dto.calltable.*;
import com.czg.account.entity.CallConfig;
import com.czg.account.entity.CallQueue;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.czg.account.entity.CallTable;
/**
* 叫号桌型表 服务层。
*
* @author zs
* @since 2025-02-21
*/
public interface CallTableService extends IService<CallTable> {
CallTablePage get(Long shopId, Long callTableId, Integer state);
boolean add(Long shopId, CallTableDTO addCallTableDTO);
boolean update(Long shopId, UpdateCallTableDTO callTableDTO);
CallTableNumDTO takeNumber(Long shopId, TakeNumberDTO takeNumberDTO);
String takeNumberCode(Long shopId, Integer callTableId);
Integer call(Long shopId, CallQueueDTO callQueueDTO);
boolean updateInfo(Long shopId, UpdateCallQueueDTO updateCallQueueDTO);
Page<CallQueue> getQueue(Long shopId, Long callTableId, Integer state);
Page<CallRecordVO> getCallRecord(Long shopId, Integer callTableId);
CallConfig getConfig(Long shopId);
boolean updateConfig(Long shopId, UpdateConfigDTO configDTO);
}