1.代客下单 会员支付,支付修改台桌状态
This commit is contained in:
@@ -3,6 +3,7 @@ package com.chaozhanggui.system.cashierservice.controller;
|
||||
import com.chaozhanggui.system.cashierservice.annotation.LimitSubmit;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.VipPayDTO;
|
||||
import com.chaozhanggui.system.cashierservice.model.PaymentReq;
|
||||
import com.chaozhanggui.system.cashierservice.service.PayService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
@@ -185,17 +186,26 @@ public class PayController {
|
||||
* @param token
|
||||
* @param loginName
|
||||
* @param clientType
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("vipPay")
|
||||
@PostMapping("vipPay")
|
||||
@LimitSubmit(key = "vipPay:%s")
|
||||
public Result vipPay(@RequestHeader("token") String token,
|
||||
@RequestHeader("loginName") String loginName,
|
||||
@RequestHeader("clientType") String clientType,
|
||||
@RequestParam("orderId") String orderId,
|
||||
@RequestParam("vipUserId") Integer vipUserId){
|
||||
return payService.vipPay(orderId,token, vipUserId);
|
||||
@RequestBody VipPayDTO vipPayDTO
|
||||
){
|
||||
if (vipPayDTO.getOrderId() == null || vipPayDTO.getVipUserId() == null) {
|
||||
return Result.fail("参数缺失");
|
||||
}
|
||||
|
||||
if (
|
||||
(vipPayDTO.getPayAmount() != null && vipPayDTO.getPayAmount().compareTo(BigDecimal.ZERO) <= 0) ||
|
||||
(vipPayDTO.getDiscountAmount() != null && vipPayDTO.getDiscountAmount().compareTo(BigDecimal.ZERO) <= 0)
|
||||
) {
|
||||
return Result.fail("折扣金额必须大于0");
|
||||
}
|
||||
return payService.vipPay(vipPayDTO.getOrderId(),token, vipPayDTO.getVipUserId(), vipPayDTO.getPayAmount(), vipPayDTO.getDiscountAmount());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user