feat: 新增挂单支付

This commit is contained in:
张松 2024-11-27 15:12:21 +08:00
parent 1915c27b9b
commit 557f263643
3 changed files with 19 additions and 0 deletions

View File

@ -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 @Getter
public enum UseType { public enum UseType {
TAKEOUT("takeout"), TAKEOUT("takeout"),

View File

@ -31,5 +31,6 @@ public class PayDTO {
private Integer pointsNum; private Integer pointsNum;
private Integer staffId; private Integer staffId;
private String loginName; private String loginName;
private String creditBuyerId;
} }

View File

@ -134,6 +134,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
private final TbShopUserMapper tbShopUserMapper; private final TbShopUserMapper tbShopUserMapper;
private final ThirdPartyCouponService thirdPartyCouponService; private final ThirdPartyCouponService thirdPartyCouponService;
private final TbThirdPartyCouponRecordService thirdPartyCouponRecordService; private final TbThirdPartyCouponRecordService thirdPartyCouponRecordService;
private final TbCreditBuyerOrderService creditBuyerOrderService;
private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO) { private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO) {
// 获取当前台桌最新订单先付款模式不获取 // 获取当前台桌最新订单先付款模式不获取
@ -2281,6 +2282,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
boolean isOnline = false; boolean isOnline = false;
switch (payDTO.getPayType()) { 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": case "vipPay":
if (payDTO.getVipUserId() != null) { if (payDTO.getVipUserId() != null) {
orderInfo.setUserId(String.valueOf(payDTO.getVipUserId())); orderInfo.setUserId(String.valueOf(payDTO.getVipUserId()));