zhuyifan

feat(order): 新增忌口备注字段并支持更新

- 在 ClientCustomerOrderService.proto 中新增忌口备注字段 avoidRemark
- 在 KdsDTO 中增加 mealTime 字段用于指定查询日期- 修改 KdsServiceImpl 中获取订单逻辑,使用 mealTime 替代当前日期
- 在 OrderDbDTO 中添加 avoidRemark 字段以存储忌口信息
- 更新 OrderServiceImpl 映射逻辑,包含 avoidRemark 字段
- 在 OrderServiceRpcClient 中实现 avoidRemark 的更新逻辑
......@@ -97,6 +97,7 @@ public class KdsDTO {
public static class KdsOrderSkuQueryDto {
private ServeStatusEnum serveStatus;
private Integer mealId;
private String mealTime;
}
@Data
......@@ -107,6 +108,7 @@ public class KdsDTO {
public static class KdsOrderLocationQueryDto {
private OrderStatusEnum orderStatus;
private Integer mealId;
private String mealTime;
}
@Data
......
......@@ -155,6 +155,7 @@ public class OrderDbDTO {
private String tableCode;
private Integer updatedBy;
private OrderSourceEnum updatedSource;
private String avoidRemark;
}
......@@ -440,6 +441,9 @@ public class OrderDbDTO {
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "忌口备注")
private String avoidRemark;
@ApiModelProperty(value = "下单客户当时的忌口、医嘱")
private CustomerNotice customerNoticeJson;
......
......@@ -180,6 +180,8 @@ public class OrderServiceRpcClient {
.setTableCode(tableCode)
.setShouldUpdateRoomNo(updateOrderDto.isShouldUpdateRoomNo())
.setRoomNo(roomNo)
.setShouldUpdateAvoidRemark(updateOrderDto.getAvoidRemark() != null)
.setAvoidRemark(updateOrderDto.getAvoidRemark() == null ? "" : updateOrderDto.getAvoidRemark())
.build();
final var request = UpdateClientCustomerOrderRpcRequest.newBuilder()
.setEnterpriseId(updateOrderDto.getEnterpriseId())
......@@ -188,7 +190,7 @@ public class OrderServiceRpcClient {
.setModification(modification)
.build();
final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request);
if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) {
if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() != null && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) {
final var orderById = getOrderById(updateOrderDto.getId());
if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) {
final var orderDetails = getOrderDetailsByOrderId(orderById.getId());
......
......@@ -53,7 +53,7 @@ public class KdsServiceImpl implements KdsService {
@Override
public List<KdsOrderSkuDto> getOrderDetailBySku(KdsOrderSkuQueryDto queryDto) {
// 获取当日所有的订单 和 订单明细
LocalDate today = LocalDate.now();
LocalDate today = LocalDate.parse(queryDto.getMealTime(), DateUtil.YYYY_MM_DD);
LocalDateTime todayZero = today.atStartOfDay();
LocalDate tomorrow = today.plusDays(1);
LocalDateTime tomorrowZero = tomorrow.atStartOfDay();
......@@ -281,7 +281,7 @@ public class KdsServiceImpl implements KdsService {
@Override
public List<KdsOrderLocationDto> getOrderDetailByLocation(KdsOrderLocationQueryDto queryDto) {
// 获取当日用餐的所有的订单 和 订单明细
LocalDate today = LocalDate.now();
LocalDate today = LocalDate.parse(queryDto.getMealTime(), DateUtil.YYYY_MM_DD);
LocalDateTime todayZero = today.atStartOfDay();
LocalDate tomorrow = today.plusDays(1);
LocalDateTime tomorrowZero = tomorrow.atStartOfDay().minusMinutes(1);
......
......@@ -487,6 +487,7 @@ public class OrderServiceImpl implements OrderService {
.mealTime(DateUtil.formatDate(r.getMealTime()))
.orderType(r.getOrderTypeValue())
.remark(r.getRemark())
.avoidRemark(r.getAvoidRemark())
.isDeleted(r.getIsDeleted())
.isRead(r.getIsRead())
.creationSource(r.getCreationSource().getNumber())
......
......@@ -89,6 +89,11 @@ enum OnlinePayEnum {
LEAVE_HOSPITAL = 3;//出院
EMPLOYEE_CARD = 4; //员工卡
PAPER_VERIFICATION = 5; //纸质核销
CASH = 6;//现金
MEAL_CARD = 7;//餐卡
BAND_CARD = 8;//银行卡
ALIPAY = 9;//支付宝
WECHATPAY = 10;//微信支付
}
enum ServeStatusEnum {
......@@ -141,6 +146,7 @@ message SingleClientCustomerOrderRpcResponse {
bool isAllocation = 35;
string syncRoomNo = 36;
bool isCanceled = 37;
string avoidRemark = 38;
}
message GetClientCustomerOrderByIdRpcRequest {
......@@ -385,6 +391,8 @@ message ClientCustomerOrderModification {
string syncRoomNo = 55;
bool shouldUpdateIsCanceled = 56;
bool isCanceled = 57;
bool shouldUpdateAvoidRemark = 58;
string avoidRemark = 59;
}
message UpdateClientCustomerOrderRpcRequest {
......