|
@@ -164,6 +164,8 @@ public class WxJsjpController extends BaseController {
|
|
@ApiOperation("微信商品下单")
|
|
@ApiOperation("微信商品下单")
|
|
public Response<WxParamEntity> getPrepareGoodsOrder(@RequestBody WxOrderGoodsDTO wxOrderGoodsDTO) throws Exception{
|
|
public Response<WxParamEntity> getPrepareGoodsOrder(@RequestBody WxOrderGoodsDTO wxOrderGoodsDTO) throws Exception{
|
|
if(wxOrderGoodsDTO.getGoodsType()==2) {
|
|
if(wxOrderGoodsDTO.getGoodsType()==2) {
|
|
|
|
+ GzptUserInfo gzptUserInfo = userInfoService.getInfoById(wxOrderGoodsDTO.getUserId());
|
|
|
|
+
|
|
int count = vipUserExamService.getUserExamByUserIdAndGoodsId(wxOrderGoodsDTO.getUserId(), wxOrderGoodsDTO.getGoodsId());
|
|
int count = vipUserExamService.getUserExamByUserIdAndGoodsId(wxOrderGoodsDTO.getUserId(), wxOrderGoodsDTO.getGoodsId());
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
throw new CustomException("您已购买过该考场,退回上个页面,重新进入。");
|
|
throw new CustomException("您已购买过该考场,退回上个页面,重新进入。");
|
|
@@ -177,8 +179,11 @@ public class WxJsjpController extends BaseController {
|
|
order.setGoodsType(wxOrderGoodsDTO.getGoodsType());
|
|
order.setGoodsType(wxOrderGoodsDTO.getGoodsType());
|
|
order.setOutTradeNo(orderCode);
|
|
order.setOutTradeNo(orderCode);
|
|
order.setUserId(wxOrderGoodsDTO.getUserId());
|
|
order.setUserId(wxOrderGoodsDTO.getUserId());
|
|
|
|
+ order.setUserName(gzptUserInfo.getUserName());
|
|
|
|
+ order.setLogincode(gzptUserInfo.getLogincode());
|
|
order.setPhoneType(wxOrderGoodsDTO.getPhoneType()); //手机类型 1:苹果 2:安卓
|
|
order.setPhoneType(wxOrderGoodsDTO.getPhoneType()); //手机类型 1:苹果 2:安卓
|
|
order.setTotal(examInfo.getPrice());
|
|
order.setTotal(examInfo.getPrice());
|
|
|
|
+ order.setIsShare(0);
|
|
order.setOrderStatus(OrderStatusEnum.PROCESSING.getCode());
|
|
order.setOrderStatus(OrderStatusEnum.PROCESSING.getCode());
|
|
wxJsOrderService.save(order);
|
|
wxJsOrderService.save(order);
|
|
return Response.success(placeWxOrder(order, examInfo.getName()));
|
|
return Response.success(placeWxOrder(order, examInfo.getName()));
|