fix: 只选择餐位费不允许创建订单
This commit is contained in:
@@ -42,6 +42,9 @@ public interface TableConstant {
|
||||
Status(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public boolean equalsVals(String value) {
|
||||
return this.value.equals(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -783,7 +783,7 @@ public class OrderService {
|
||||
.eq(TbCashierCart::getUseType, eatTypeInfoDTO.getUseType())
|
||||
.gt(TbCashierCart::getCreatedAt, DateUtil.offsetDay(DateUtil.date(), -1).getTime())
|
||||
.and(q -> q.eq(TbCashierCart::getMasterId, orderVo.getMasterId()).or().isNull(TbCashierCart::getMasterId))
|
||||
.eq(TbCashierCart::getStatus, "create");
|
||||
.in(TbCashierCart::getStatus, "create", "return");
|
||||
|
||||
// 外带模式
|
||||
if (eatTypeInfoDTO.isTakeout()) {
|
||||
@@ -838,6 +838,7 @@ public class OrderService {
|
||||
return Result.fail("请选择用餐人数");
|
||||
}
|
||||
|
||||
list = list.stream().filter(item -> TableConstant.OrderInfo.Status.CREATE.equalsVals(item.getStatus())).collect(Collectors.toList());
|
||||
if (eatTypeInfoDTO.isNeedSeatFee() && list.size() < 2) {
|
||||
return Result.fail("购物车为空");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user