|  |  |  | 
|---|
|  |  |  | import com.xcong.excoin.common.LoginUserUtils; | 
|---|
|  |  |  | import com.xcong.excoin.common.enumerates.CoinTypeEnum; | 
|---|
|  |  |  | import com.xcong.excoin.common.response.Result; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.dao.MemberPaymentMethodDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.dao.MemberQuickBuySaleDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.dto.MemberQuickBuySaleCommitDto; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.dto.MemberQuickBuySaleDto; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.entity.MemberPaymentMethodEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.entity.MemberQuickBuySaleEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.mapper.MemberQuickBuySaleEntityMapper; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.service.MemberQuickBuySaleService; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.vo.MemberQuickBuySaleDetailVo; | 
|---|
|  |  |  | import com.xcong.excoin.modules.home.vo.MemberQuickBuySaleVo; | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.dao.MemberDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.dao.MemberPaymentMethodDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.entity.MemberEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.entity.MemberPaymentMethodEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity; | 
|---|
|  |  |  | import com.xcong.excoin.modules.platform.dao.PlatformPaymentMethodDao; | 
|---|
|  |  |  | import com.xcong.excoin.modules.platform.entity.PlatformPaymentMethodEntity; | 
|---|
|  |  |  | 
|---|
|  |  |  | MemberQuickBuySaleVo memberQuickBuySaleVo = new MemberQuickBuySaleVo(); | 
|---|
|  |  |  | memberQuickBuySaleVo.setId(memberQuickBuySaleEntity.getId()); | 
|---|
|  |  |  | // 返回前台付款方式 | 
|---|
|  |  |  | return Result.ok(memberQuickBuySaleVo); | 
|---|
|  |  |  | return Result.ok("提交成功",memberQuickBuySaleVo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | MemberQuickBuySaleEntity memberQuickBuySaleEntity = memberQuickBuySaleDao.selectByIdAndMemberId(member.getId(),id); | 
|---|
|  |  |  | memberQuickBuySaleEntity.setOrderStatus(MemberQuickBuySaleEntity.CHARGE_STATUS_CANCEL_USER); | 
|---|
|  |  |  | memberQuickBuySaleDao.updateById(memberQuickBuySaleEntity); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 判断是否存在足够余额 | 
|---|
|  |  |  | MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(member.getId(),CoinTypeEnum.USDT.toString()); | 
|---|
|  |  |  | boolean flag = true; | 
|---|
|  |  |  | while(flag) { | 
|---|
|  |  |  | walletCoin.setAvailableBalance(walletCoin.getAvailableBalance().add(memberQuickBuySaleEntity.getAmountUsdt())); | 
|---|
|  |  |  | walletCoin.setFrozenBalance(walletCoin.getFrozenBalance().subtract(memberQuickBuySaleEntity.getAmountUsdt())); | 
|---|
|  |  |  | int i = memberWalletCoinDao.updateById(walletCoin); | 
|---|
|  |  |  | if(i>0) { | 
|---|
|  |  |  | flag = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(member.getId(),CoinTypeEnum.USDT.toString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return Result.ok("成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|