feat: 新增挂单支付
This commit is contained in:
parent
1915c27b9b
commit
557f263643
|
|
@ -97,6 +97,17 @@ public interface TableConstant {
|
|||
|
||||
}
|
||||
|
||||
@Getter
|
||||
public enum PayType {
|
||||
CREDIT_BUYER("creditBuyer");
|
||||
private final String value;
|
||||
|
||||
PayType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Getter
|
||||
public enum UseType {
|
||||
TAKEOUT("takeout"),
|
||||
|
|
|
|||
|
|
@ -31,5 +31,6 @@ public class PayDTO {
|
|||
private Integer pointsNum;
|
||||
private Integer staffId;
|
||||
private String loginName;
|
||||
private String creditBuyerId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
private final TbShopUserMapper tbShopUserMapper;
|
||||
private final ThirdPartyCouponService thirdPartyCouponService;
|
||||
private final TbThirdPartyCouponRecordService thirdPartyCouponRecordService;
|
||||
private final TbCreditBuyerOrderService creditBuyerOrderService;
|
||||
|
||||
private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO) {
|
||||
// 获取当前台桌最新订单,先付款模式不获取
|
||||
|
|
@ -2281,6 +2282,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
boolean isOnline = false;
|
||||
|
||||
switch (payDTO.getPayType()) {
|
||||
case "creditBuyer":
|
||||
if (payDTO.getCreditBuyerId() == null) {
|
||||
throw new BadRequestException("挂单人不为空");
|
||||
}
|
||||
creditBuyerOrderService.save(payDTO.getCreditBuyerId(), Long.valueOf(orderInfo.getId()));
|
||||
orderInfo.setPayType(TableConstant.OrderInfo.PayType.CREDIT_BUYER.getValue());
|
||||
case "vipPay":
|
||||
if (payDTO.getVipUserId() != null) {
|
||||
orderInfo.setUserId(String.valueOf(payDTO.getVipUserId()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue