| | |
| | | import cn.hutool.crypto.asymmetric.KeyType; |
| | | import cn.hutool.crypto.asymmetric.RSA; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | mallMemberVo.setFcmCntFrozen(mallMemberAmount.getFcmCntFrozen()); |
| | | mallMemberVo.setTokenAva(mallMemberAmount.getTokenAva()); |
| | | mallMemberVo.setTokenFrozen(mallMemberAmount.getTokenFrozen()); |
| | | mallMemberVo.setTotalPerk(mallMemberAmount.getTotalPerk()); |
| | | DataDictionaryCustom startTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.YU_YUE_START_TIME.getType(), |
| | | DataDictionaryEnum.YU_YUE_START_TIME.getCode() |
| | |
| | | Integer pickCount = mallProductBuyMapper.selectListByMemberIdAndState(id); |
| | | mallMemberVo.setPickCount(pickCount); |
| | | |
| | | BigDecimal totalPerk = mallProductBuyMapper.selectTotalPerkByMemberId(mallMember.getId()); |
| | | mallMemberVo.setTotalPerk(totalPerk); |
| | | // BigDecimal totalPerk = mallProductBuyMapper.selectTotalPerkByMemberId(mallMember.getId()); |
| | | // mallMemberVo.setTotalPerk(totalPerk); |
| | | |
| | | DataDictionaryCustom insideNFTPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.FCM_INSIDE_NFT_PERCENT.getType(), |
| | | DataDictionaryEnum.FCM_INSIDE_NFT_PERCENT.getCode() |
| | | ); |
| | | mallMemberVo.setInsideNFTPercent(insideNFTPercentDic.getValue()); |
| | | return new FebsResponse().success().data(mallMemberVo); |
| | | } |
| | | |
| | |
| | | MoneyFlowTypeNewEnum.TOKEN_INSIDE_IN.getDescrition()); |
| | | } |
| | | if(3 == type){ |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.FCM_INSIDE_NFT_PERCENT.getType(), |
| | | DataDictionaryEnum.FCM_INSIDE_NFT_PERCENT.getCode() |
| | | ); |
| | | BigDecimal feePercent = new BigDecimal("0.01").multiply(new BigDecimal(dataDictionaryCustom.getValue())); |
| | | if (amount.compareTo(mallMemberAmountLogin.getTrendsNft()) > 0) { |
| | | throw new FebsException("卡牌不足"); |
| | | } |
| | | BigDecimal fee = amount.multiply(feePercent).setScale(2,BigDecimal.ROUND_DOWN); |
| | | BigDecimal amountReal = amount.subtract(fee); |
| | | mallMemberAmountLogin.setTrendsNft(mallMemberAmountLogin.getTrendsNft().subtract(amount)); |
| | | mallMemberAmountMapper.updateTrendsNftById(mallMemberAmountLogin); |
| | | String orderNo = MallUtils.getOrderNum("NFT"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | loginMember.getId(), |
| | | amount.negate(), |
| | | amountReal.negate(), |
| | | MoneyFlowTypeNewEnum.NFT_TRANS_OUT.getValue(), |
| | | orderNo, |
| | | mallMember.getId(), |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.NFT_TRANS_OUT.getDescrition()); |
| | | mallMemberAmount.setTrendsNft(mallMemberAmount.getTrendsNft().add(amount)); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | loginMember.getId(), |
| | | fee.negate(), |
| | | MoneyFlowTypeNewEnum.NFT_TRANS_OUT_FEE.getValue(), |
| | | orderNo, |
| | | mallMember.getId(), |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.NFT_TRANS_OUT_FEE.getDescrition()); |
| | | mallMemberAmount.setTrendsNft(mallMemberAmount.getTrendsNft().add(amountReal)); |
| | | mallMemberAmountMapper.updateTrendsNftById(mallMemberAmount); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | mallMember.getId(), |
| | | amount, |
| | | amountReal, |
| | | MoneyFlowTypeNewEnum.NFT_TRANS_IN.getValue(), |
| | | orderNo, |
| | | loginMember.getId(), |
| | |
| | | @Override |
| | | public FebsResponse updatePayment(UpdatePaymentDto updatePaymentDto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | QueryWrapper<MallProductBuy> objectQueryWrapper = new QueryWrapper<>(); |
| | | objectQueryWrapper.eq("member_id",memberId); |
| | | List<MallProductBuy> mallProductBuys = mallProductBuyMapper.selectList(objectQueryWrapper); |
| | | if(ObjectUtil.isNotEmpty(mallProductBuys)){ |
| | | throw new FebsException("信息无法修改"); |
| | | } |
| | | |
| | | MallMemberPayment mallMemberPayment = mallMemberPaymentMapper.selectByMemberId(memberId); |
| | | mallMemberPayment.setWxQrcode(updatePaymentDto.getWxQrcode()); |