| | |
| | | @ApiOperation(value = "创建支付订单", notes = "微信|支付宝") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "targetId", value = "目标id 订单类型为会员和充值时不传", dataType = "Long", required = false), |
| | | @ApiImplicitParam(name = "orderId", value = "订单id 待支付时传", dataType = "Long", required = false), |
| | | @ApiImplicitParam(name = "orderFrom", value = "订单来源 1=冥想音频 2=课程 3=购买会员 4充值", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(name = "receiverId", value = "被赠送课程APP用户id", dataType = "Long", required = false), |
| | | @ApiImplicitParam(name = "balanceFlag", value = "是否使用余额抵扣 1=是 2=否", dataType = "Integer", required = false), |
| | |
| | | }) |
| | | public R<ClientPlaceOrderVO> placeOrder( |
| | | @RequestParam(value = "targetId", required = false) Long targetId, |
| | | @RequestParam(value = "orderId", required = false) Long orderId, |
| | | @RequestParam(value = "orderFrom") Integer orderFrom, |
| | | @RequestParam(value = "receiverId", required = false) Long receiverId, |
| | | @RequestParam(value = "balanceFlag", required = false) Integer balanceFlag, |
| | |
| | | try { |
| | | |
| | | return R.ok( |
| | | orderService.placeOrder(targetId, orderFrom, receiverId, |
| | | orderService.placeOrder(targetId, orderFrom, receiverId,orderId, |
| | | balanceFlag, payType,amount,vipType)); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | |
| | | OrderPaymentRecord one1 = orderPaymentRecordService.lambdaQuery().eq(OrderPaymentRecord::getOrderId, one.getId()) |
| | | .eq(OrderPaymentRecord::getPaymentType, 4).one(); |
| | | AppUserWalletRecord appUserWalletRecord = new AppUserWalletRecord(); |
| | | appUserWalletRecord.setAppUserId(data.getInviteUserId()); |
| | | appUserWalletRecord.setAppUserId(one.getAppUserId()); |
| | | String reason=null; |
| | | switch (one.getOrderFrom()){ |
| | | case 1: |
| | | Meditation data1 = remoteMeditationService.getMeditationById(one.getBusinessId()).getData(); |
| | | appUserWalletRecord.setChangeType(2); |
| | | reason = "购买【"+data1.getMeditationTitle()+"】"; |
| | | reason = "购买疗愈【"+data1.getMeditationTitle()+"】"; |
| | | |
| | | break; |
| | | case 2: |
| | | Course data2 = remoteCourseService.getCourseById(one.getBusinessId()).getData(); |
| | | reason = "购买【"+data2.getCourseTitle()+"】"; |
| | | reason = "购买课程【"+data2.getCourseTitle()+"】"; |
| | | appUserWalletRecord.setChangeType(2); |
| | | // 增加用户与课程的关系表 |
| | | if (one.getGiveUserId()!=null){ |
| | |
| | | break; |
| | | case 3: |
| | | // 会员 |
| | | reason = "购买【"+one.getBuyContent()+"】"; |
| | | reason = "购买会员【"+one.getBuyContent()+"】"; |
| | | appUserWalletRecord.setChangeType(2); |
| | | break; |
| | | case 4: |
| | |
| | | } |
| | | appUserWalletRecord.setReason(reason); |
| | | appUserWalletRecord.setAmount(one1.getPayAmount()); |
| | | appUserWalletRecord.setChildAppUserId(one.getAppUserId()); |
| | | appUserWalletRecord.setOrderId(one.getId()); |
| | | remoteAppUserService.addBalanceRecord(appUserWalletRecord); |
| | | }else{ |
| | |
| | | case 1: |
| | | Meditation data1 = remoteMeditationService.getMeditationById(one.getBusinessId()).getData(); |
| | | appUserWalletRecord.setChangeType(2); |
| | | reason = "购买【"+data1.getMeditationTitle()+"】"; |
| | | reason = "购买疗愈【"+data1.getMeditationTitle()+"】"; |
| | | |
| | | break; |
| | | case 2: |
| | | Course data2 = remoteCourseService.getCourseById(one.getBusinessId()).getData(); |
| | | reason = "购买【"+data2.getCourseTitle()+"】"; |
| | | reason = "购买课程【"+data2.getCourseTitle()+"】"; |
| | | appUserWalletRecord.setChangeType(2); |
| | | // 增加用户与课程的关系表 |
| | | if (one.getGiveUserId()!=null){ |
| | |
| | | break; |
| | | case 3: |
| | | // 会员 |
| | | reason = "购买【"+one.getBuyContent()+"】"; |
| | | reason = "购买会员【"+one.getBuyContent()+"】"; |
| | | appUserWalletRecord.setChangeType(2); |
| | | break; |
| | | case 4: |
| | |
| | | } |
| | | break; |
| | | case 4: |
| | | remoteAppUserService.addBalance(one.getAppUserId(),one.getRealPayAmount()); |
| | | System.err.println("进入充值"); |
| | | remoteAppUserService.addBalance(one.getAppUserId(),one.getTotalAmount()); |
| | | AppUserWalletRecord appUserWalletRecord = new AppUserWalletRecord(); |
| | | appUserWalletRecord.setAppUserId(one.getAppUserId()); |
| | | appUserWalletRecord.setChangeType(1); |
| | | appUserWalletRecord.setReason("充值"); |
| | | appUserWalletRecord.setAmount(one.getRealPayAmount()); |
| | | appUserWalletRecord.setAmount(one.getTotalAmount()); |
| | | appUserWalletRecord.setChildAppUserId(one.getAppUserId()); |
| | | appUserWalletRecord.setOrderId(one.getId()); |
| | | remoteAppUserService.addBalanceRecord(appUserWalletRecord); |