篮球入场下订单初始化
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.sv.api.controller;
|
||||
|
||||
import com.enums.EnterEnum;
|
||||
import com.enums.PayTypeEnum;
|
||||
import com.sv.api.context.PlatformContext;
|
||||
import com.sv.dto.BasketEnterResult;
|
||||
import com.sv.entity.Device;
|
||||
import com.sv.entity.Order;
|
||||
@@ -10,8 +12,10 @@ import com.sv.service.api.VenueService;
|
||||
import com.sv.service.common.BarcodeService;
|
||||
import com.sv.service.common.DoorLockUtil;
|
||||
import com.sv.service.oms.DeviceService;
|
||||
import com.ydd.framework.core.annotation.AccessToken;
|
||||
import com.ydd.framework.core.common.Pagination;
|
||||
import com.ydd.framework.core.common.dto.ResponseDTO;
|
||||
import com.ydd.framework.core.common.utils.RequestUtils;
|
||||
import com.ydd.framework.core.controller.BaseApiController;
|
||||
import com.ydd.framework.core.exception.ServiceException;
|
||||
import com.ydd.oms.entity.enums.PayStatusEnum;
|
||||
@@ -20,6 +24,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Controller - 场馆
|
||||
@@ -111,10 +116,11 @@ public class VenueController extends BaseApiController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/member/isPayed", method = RequestMethod.POST)
|
||||
public ResponseDTO isPayed(@RequestParam("venueId") Integer venueId) {
|
||||
Order orderSn = orderService.findOrderSn("230801205026443583", 535);
|
||||
public ResponseDTO isPayed(@RequestParam("venueId") Integer venueId,String orderSn) {
|
||||
Integer memberId = getMemberIdByAccessToken();
|
||||
Order order = orderService.findOrderSn(orderSn, memberId);
|
||||
boolean isPayed = false;
|
||||
if (orderSn != null && orderSn.getPayStatus() != null && PayStatusEnum.PAYED.getValue() == orderSn.getPayStatus()) {
|
||||
if (orderSn != null && order.getPayStatus() != null && PayStatusEnum.PAYED.getValue() == order.getPayStatus()) {
|
||||
isPayed = true;
|
||||
}
|
||||
return ResponseDTO.ok().addAttribute("isPayed", isPayed);
|
||||
@@ -199,4 +205,16 @@ public class VenueController extends BaseApiController {
|
||||
return ResponseDTO.ok().addAttribute("barcode", barcode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 余额充值
|
||||
*/
|
||||
@RequestMapping(value = "/venue/basketball/pay", method = RequestMethod.POST)
|
||||
@AccessToken
|
||||
public ResponseDTO recharge(@RequestParam("rechargeId") Integer rechargeId){
|
||||
Venue venue = new Venue();
|
||||
// TODO
|
||||
return ResponseDTO.ok().
|
||||
addAttribute("pay",orderService.createEnterVenueOrder(venue,getLoginMemberId(), PayTypeEnum.WEI_XIN,new BigDecimal(10)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class WxServiceTest {
|
||||
public void refund(){
|
||||
// wechatPayService.createUnifiedOrder("testlmq20231224",new BigDecimal(0.02),"127.0.0.1","JSAPI", 535);
|
||||
// 根据orderSn查出对应订单信息
|
||||
String orderSn = "231224213047442679";
|
||||
String orderSn = "231228000925924610";
|
||||
Integer memberId = 535;
|
||||
Order order = orderService.findOrderSn(orderSn,memberId);
|
||||
if (order == null){
|
||||
|
||||
Reference in New Issue
Block a user