订单部分代码
This commit is contained in:
1 parent
6cdc873a02
commit
bfa5dc6a26
10 files changed
+484
-44
No files matched your search
+1
-16
@@ -10,10 +10,6 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@@ -57,18 +53,7 @@ public class HardAppCreateOrderDto {
|
||||
// 地址
|
||||
private HardAppTakeOutAddressDto address;
|
||||
|
||||
// 预约时间信息
|
||||
// 预约时间信息(外卖:立即送/预约时段)
|
||||
private HardAppTakeOutApptDto appt;
|
||||
|
||||
@Schema(description = "IMMEDIATE立即送 | SCHEDULED预约时段")
|
||||
private String expectDeliveryType;
|
||||
|
||||
private LocalDate expectDeliveryDate;
|
||||
|
||||
private LocalTime expectDeliveryStart;
|
||||
|
||||
private LocalTime expectDeliveryEnd;
|
||||
|
||||
private LocalDateTime expectArriveTime;
|
||||
|
||||
}
|
||||
+1
-19
@@ -4,10 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
@Data
|
||||
public class HardAppCreateTakeOutOrderDto {
|
||||
|
||||
@@ -32,21 +28,7 @@ public class HardAppCreateTakeOutOrderDto {
|
||||
* 外卖预约信息
|
||||
*/
|
||||
@NotNull(message = "预约时间信息不能为空")
|
||||
@Schema(description = "立即送/预约时段;字段见 HardAppTakeOutApptDto")
|
||||
private HardAppTakeOutApptDto appt;
|
||||
|
||||
@Schema(description = "IMMEDIATE立即送(默认)| SCHEDULED预约时段")
|
||||
private String expectDeliveryType;
|
||||
|
||||
@Schema(description = "预约送达日期,SCHEDULED 时必填")
|
||||
private LocalDate expectDeliveryDate;
|
||||
|
||||
@Schema(description = "预约时段开始,SCHEDULED 时必填")
|
||||
private LocalTime expectDeliveryStart;
|
||||
|
||||
@Schema(description = "预约时段结束,SCHEDULED 时必填")
|
||||
private LocalTime expectDeliveryEnd;
|
||||
|
||||
@Schema(description = "立即送预计送达时间,可选")
|
||||
private LocalDateTime expectArriveTime;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.order.app;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 某一配送日的可预约时段列表(多天查询时按天分组)。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "单日可预约配送时段")
|
||||
public class HardTakeOutDeliveryTimeDayVO {
|
||||
|
||||
@Schema(description = "配送日")
|
||||
private LocalDate expectDate;
|
||||
|
||||
@Schema(description = "该日可选时段")
|
||||
private List<HardTakeOutDeliveryTimeSlotVO> slots;
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.order.app;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配送详情页:根据商户 {@code jobTime} 生成可预约时段;支持连续多天(今天/明天/后天等)。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "外卖可预约配送时段(按商户营业时间切分)")
|
||||
public class HardTakeOutDeliveryTimeOptionVO {
|
||||
|
||||
@Schema(description = "商户ID")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@Schema(description = "原始营业时间串,如 09:00-12:00,16:00-19:00")
|
||||
private String jobTime;
|
||||
|
||||
@Schema(description = "本次查询的起始配送日(未传 expectDate 时服务端为「今天」)")
|
||||
private LocalDate startDate;
|
||||
|
||||
@Schema(description = "连续查询的天数(含起始日),如 3 表示今天+明天+后天")
|
||||
private Integer dayCount;
|
||||
|
||||
@Schema(description = "每格时长(分钟)")
|
||||
private Integer slotMinutes;
|
||||
|
||||
@Schema(description = "「今天」时,过滤掉当前时刻之前不足 leadMinutes 分钟的格子;其它日期不按此过滤")
|
||||
private Integer leadMinutes;
|
||||
|
||||
@Schema(description = "jobTime 是否解析出有效营业时段")
|
||||
private Boolean jobTimeValid;
|
||||
|
||||
@Schema(description = "按天分组的时段;前端左侧「今天/明天」切换时取对应元素的 slots")
|
||||
private List<HardTakeOutDeliveryTimeDayVO> daySlots;
|
||||
|
||||
/**
|
||||
* 仅当 {@code dayCount == 1} 时与 {@link #daySlots} 中单日 slots 一致,便于旧前端兼容;多天时请使用 {@link #daySlots}。
|
||||
*/
|
||||
@Schema(description = "单日查询时与 daySlots[0].slots 相同;多天时为 null")
|
||||
private List<HardTakeOutDeliveryTimeSlotVO> slots;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.order.app;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 外卖预约可选时段(与 {@link com.bsd.pjcloud.hard.api.dto.order.app.HardAppTakeOutApptDto} 中 expectDeliveryStart/End 对应)。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "外卖预约可选时段")
|
||||
public class HardTakeOutDeliveryTimeSlotVO {
|
||||
|
||||
@Schema(description = "时段开始")
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime expectDeliveryStart;
|
||||
|
||||
@Schema(description = "时段结束")
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime expectDeliveryEnd;
|
||||
}
|
||||
Reference in new issue
Block a user