预约段 接口
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
|
||||
package com.czg.account.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.account.entity.BkOrderTable;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 预约单 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class BkOrderDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
private Long shopId;
|
||||
/**
|
||||
* 预约用餐人数
|
||||
*/
|
||||
private Integer seatNum;
|
||||
|
||||
/**
|
||||
* 就餐类型 普通用餐
|
||||
*/
|
||||
private String seatType;
|
||||
|
||||
/**
|
||||
* 备注 80字以内
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 就餐时段类型 午餐/晚餐
|
||||
*/
|
||||
private String seatTimeType;
|
||||
|
||||
/**
|
||||
* 来电电话
|
||||
*/
|
||||
private String callPhone;
|
||||
|
||||
/**
|
||||
* 来电用户名
|
||||
*/
|
||||
private String callUsername;
|
||||
|
||||
/**
|
||||
* 预留电话
|
||||
*/
|
||||
private String bookingPhone;
|
||||
|
||||
/**
|
||||
* 预留称呼
|
||||
*/
|
||||
private String bookingUsername;
|
||||
|
||||
/**
|
||||
* 预定台桌
|
||||
*/
|
||||
private List<BkOrderTable> bookingTables;
|
||||
|
||||
/**
|
||||
* 预定台桌数
|
||||
*/
|
||||
private Integer bookingTableNum;
|
||||
|
||||
/**
|
||||
* 预约的到店时间
|
||||
*/
|
||||
private LocalDateTime bookingTime;
|
||||
|
||||
/**
|
||||
* 餐标
|
||||
*/
|
||||
private BigDecimal standardPrice;
|
||||
|
||||
/**
|
||||
* 元/人 元/桌
|
||||
*/
|
||||
private String standardPriceType;
|
||||
|
||||
|
||||
/**
|
||||
* 取消原因 80字限制
|
||||
*/
|
||||
private String cancelReason;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
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 ww
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("bk_contact_list")
|
||||
public class BkContactList implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 暂无意义
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 历史订单数
|
||||
*/
|
||||
@Column(ignore = true)
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 取消数
|
||||
*/
|
||||
@Column(ignore = true)
|
||||
private Integer cannelNum;
|
||||
|
||||
/**
|
||||
* 最后一次预约时间
|
||||
*/
|
||||
@Column(ignore = true)
|
||||
private LocalDateTime lastBookingTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 预约单 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("bk_order")
|
||||
public class BkOrder implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 暂无意义
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 预约订单号
|
||||
*/
|
||||
private String bookingOrderNo;
|
||||
|
||||
/**
|
||||
* 预约用餐人数
|
||||
*/
|
||||
private Integer seatNum;
|
||||
|
||||
/**
|
||||
* 就餐类型 普通用餐
|
||||
*/
|
||||
private String seatType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 备注 80字以内
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态 '待到店', '已到店', '已超时', '已取消'
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 就餐时段类型 午餐/晚餐
|
||||
*/
|
||||
private String seatTimeType;
|
||||
|
||||
/**
|
||||
* 来电电话
|
||||
*/
|
||||
private String callPhone;
|
||||
|
||||
/**
|
||||
* 来电用户名
|
||||
*/
|
||||
private String callUsername;
|
||||
|
||||
/**
|
||||
* 预留电话
|
||||
*/
|
||||
private String bookingPhone;
|
||||
|
||||
/**
|
||||
* 预留称呼
|
||||
*/
|
||||
private String bookingUsername;
|
||||
|
||||
/**
|
||||
* 预定台桌数
|
||||
*/
|
||||
private Integer bookingTableNum;
|
||||
|
||||
/**
|
||||
* 餐标 钱
|
||||
*/
|
||||
private BigDecimal standardPrice;
|
||||
/**
|
||||
* 餐标 元/人 元/桌 字符串表示
|
||||
*/
|
||||
private String standardPriceStr;
|
||||
|
||||
/**
|
||||
* 自留字段 钱 元/人
|
||||
*/
|
||||
private BigDecimal standardPricePerson;
|
||||
|
||||
/**
|
||||
* 预约的到店时间
|
||||
*/
|
||||
private LocalDateTime bookingTime;
|
||||
/**
|
||||
* 修改预约时间 (修改预约的到店时间) 触发的时间
|
||||
*/
|
||||
private LocalDateTime upBookingTime;
|
||||
|
||||
/**
|
||||
* 取消原因 80字限制
|
||||
*/
|
||||
private String cancelReason;
|
||||
|
||||
/**
|
||||
* 到店时间
|
||||
*/
|
||||
private LocalDateTime arrivalTime;
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
private LocalDateTime cancelTime;
|
||||
|
||||
/**
|
||||
* 预约的台桌名称
|
||||
*/
|
||||
@Column(ignore = true)
|
||||
private String tableInFos;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 预约单台桌关联 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("bk_order_table")
|
||||
public class BkOrderTable implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 暂无意义
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 预约单Id
|
||||
*/
|
||||
private Long bookOrderId;
|
||||
|
||||
/**
|
||||
* 台桌区域id
|
||||
*/
|
||||
private Long tableAreaId;
|
||||
|
||||
/**
|
||||
* 台桌区域名称
|
||||
*/
|
||||
private String tableAreaName;
|
||||
|
||||
/**
|
||||
* 台桌id
|
||||
*/
|
||||
private Long tableId;
|
||||
|
||||
/**
|
||||
* 台桌名称
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.BkContactList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 通讯录联系人列表 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
public interface BkContactListService extends IService<BkContactList> {
|
||||
|
||||
/**
|
||||
* 获取用户联系人列表
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param phones 电话号码列表
|
||||
* @return 联系人列表
|
||||
*/
|
||||
List<BkContactList> getUserList(Long shopId, Set<String> phones);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.BkOrderDTO;
|
||||
import com.czg.account.vo.BkTableVO;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.BkOrder;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预约单 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
public interface BkOrderService extends IService<BkOrder> {
|
||||
|
||||
/**
|
||||
* 查询预约单列表
|
||||
* @param shopId 店铺id
|
||||
* @param search 搜索关键词 客户姓名/客户手机号
|
||||
* @param start 开始日期
|
||||
* @param end 结束日期
|
||||
* @param status 预约单状态
|
||||
* @return 预约单列表
|
||||
*/
|
||||
List<BkOrder> bookings(Long shopId, String search, LocalDate start, LocalDate end, String status);
|
||||
|
||||
/**
|
||||
* 预约
|
||||
*/
|
||||
void booking(Long shopId, BkOrderDTO bkOrder);
|
||||
/**
|
||||
* 更新预约状态
|
||||
* @param shopId 店铺id
|
||||
* @param status 预约单状态 已取消/已到店
|
||||
* @param bkOrderId 预约单id
|
||||
* @param cancelReason 取消原因
|
||||
*/
|
||||
void upStatus(Long shopId, String status, Long bkOrderId,String cancelReason);
|
||||
|
||||
/**
|
||||
* 查询台桌列表
|
||||
* @param shopId 店铺id
|
||||
* @param areaId 区域id
|
||||
* @param day 预约日期
|
||||
* @param seatTimeType 预约时间类型
|
||||
* @return 台桌列表
|
||||
*/
|
||||
List<BkTableVO> table(Long shopId, Long areaId, LocalDate day, String seatTimeType);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.czg.account.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
public class BkTableVO {
|
||||
private Long areaId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
private List<BkTableVO.tableVO> tables;
|
||||
|
||||
record tableVO(
|
||||
String tableName, List<BkOrder> bkOrders
|
||||
) {
|
||||
}
|
||||
|
||||
record BkOrder(
|
||||
String callPhone, String callUsername, String bookingPhone, String bookingUsername
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user