fix: 只选择餐位费不允许创建订单

This commit is contained in:
张松
2024-11-07 11:07:53 +08:00
parent 6fd8a4f7d0
commit 68a8f6d3c5
2 changed files with 5 additions and 1 deletions

View File

@@ -42,6 +42,9 @@ public interface TableConstant {
Status(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
@Getter

View File

@@ -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("购物车为空");
}