| | |
| | | import com.xcong.excoin.modules.member.vo.MemberAuthenticationVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberCoinChargeVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberCoinWithdrawVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberDataInfoVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberQuickBuySaleVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberQuickSaleVo; |
| | | |
| | |
| | | |
| | | BigDecimal total = walletCoin.getTotalBalance().subtract(selectById.getAmount()).subtract(selectById.getFeeAmount()); |
| | | walletCoin.setTotalBalance(total); |
| | | BigDecimal frozen = walletCoin.getFrozenBalance().subtract(selectById.getAmount()).subtract(selectById.getFeeAmount()); |
| | | BigDecimal frozen = walletCoin.getFrozenBalance().subtract(selectById.getAmount()); |
| | | walletCoin.setFrozenBalance(frozen); |
| | | |
| | | memberWalletCoinMapper.updateById(walletCoin); |
| | |
| | | |
| | | BigDecimal available = walletCoin.getAvailableBalance().add(selectById.getAmount()).add(selectById.getFeeAmount()); |
| | | walletCoin.setAvailableBalance(available); |
| | | BigDecimal frozen = walletCoin.getFrozenBalance().subtract(selectById.getAmount()).subtract(selectById.getFeeAmount()); |
| | | BigDecimal frozen = walletCoin.getFrozenBalance().subtract(selectById.getAmount()); |
| | | walletCoin.setFrozenBalance(frozen); |
| | | |
| | | memberWalletCoinMapper.updateById(walletCoin); |
| | |
| | | if(!MemberEntity.CERTIFY_STATUS_ING.equals(certifyStatus)) { |
| | | return new FebsResponse().fail().message("只有【待审核】状态才能提交!"); |
| | | } |
| | | |
| | | MemberAuthenticationVo memberAuthenticationEntity = memberAuthenticationMapper.findMemberAuthenticationByMemberId(id); |
| | | selectById.setCertifyStatus(MemberEntity.CERTIFY_STATUS_Y); |
| | | selectById.setIdcardNo(memberAuthenticationEntity.getIdcardNo()); |
| | | |
| | | if(memberDetailConfirmDto.getIsok() == 1) { |
| | | selectById.setCertifyStatus(MemberEntity.CERTIFY_STATUS_Y); |
| | | }else { |
| | | selectById.setCertifyStatus(MemberEntity.CERTIFY_STATUS_N); |
| | | } |
| | | selectById.setIdcardNo(memberAuthenticationEntity.getIdcardNo()); |
| | | memberMapper.updateById(selectById); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MemberCoinChargeEntity> selectMemberDataInfoById(long id) { |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("member_id", id); |
| | | List<MemberCoinChargeEntity> selectByMap = memberCoinChargeMapper.selectByMap(columnMap); |
| | | return selectByMap; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MemberDataInfoVo> findMemberDataInfoDtoListInPage(MemberEntity memberEntity, |
| | | QueryRequest request) { |
| | | Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<MemberDataInfoVo> selectMemberListInPage = memberMapper.selectMemberDataInfoDtoListInPage(page, memberEntity); |
| | | //USDT充币总额+USDT提币总额 |
| | | String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForBasicRealData(); |
| | | String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicRealData(); |
| | | //USDT充值总额+USDT提现总额 |
| | | String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicRealData(); |
| | | String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicRealData(); |
| | | //佣金 |
| | | String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicRealData(); |
| | | //开仓手续费总额 |
| | | String closingpriceByMid = memberMapper.selectClosingpriceForBasicRealData(); |
| | | //平仓总手续费 |
| | | String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicRealData(); |
| | | //总盈亏 |
| | | String rewardratioByMid = memberMapper.selectRewardratioForBasicRealData(); |
| | | //持仓人数 |
| | | String notNullNumber = memberMapper.selectSFCCForBasicRealData(); |
| | | //币币账户不为空的人数 |
| | | String walletNumber = memberMapper.selectBBZHForBasicRealData(); |
| | | //合约账户不为空的人数 |
| | | String walletCoinNumber = memberMapper.selectHYZHForBasicRealData(); |
| | | //持仓手续费 |
| | | String doingPrice = memberMapper.selectprepriceForBasicRealData(); |
| | | |
| | | //账户金额 |
| | | String walletNum = memberMapper.selectBBZCForBasicRealData(); |
| | | String walletCoinNum = memberMapper.selectHYZCForBasicRealData(); |
| | | String agentNum = memberMapper.selectDLZCForBasicRealData(); |
| | | |
| | | double platformProfitAndLoss = 0 ; |
| | | platformProfitAndLoss = platformProfitAndLoss + (totalAmountUsdtB == null ? 0 : Double.parseDouble(totalAmountUsdtB)); |
| | | platformProfitAndLoss = platformProfitAndLoss + (totalAmountUsdtCZ == null ? 0 : Double.parseDouble(totalAmountUsdtCZ)); |
| | | platformProfitAndLoss = platformProfitAndLoss - (totalAmountUsdtS == null ? 0 : Double.parseDouble(totalAmountUsdtS)); |
| | | platformProfitAndLoss = platformProfitAndLoss - (totalAmountUsdtTX == null ? 0 : Double.parseDouble(totalAmountUsdtTX)); |
| | | List<MemberDataInfoVo> records = selectMemberListInPage.getRecords(); |
| | | for(MemberDataInfoVo memberDataInfoVo : records) { |
| | | memberDataInfoVo.setChargeUsdt(totalAmountUsdtCZ == null ? 0 : Double.parseDouble(totalAmountUsdtCZ)); |
| | | memberDataInfoVo.setAppealUsdt(totalAmountUsdtTX == null ? 0 : Double.parseDouble(totalAmountUsdtTX)); |
| | | memberDataInfoVo.setChargeCoin(totalAmountUsdtB == null ? 0 : Double.parseDouble(totalAmountUsdtB)); |
| | | memberDataInfoVo.setAppealCoin(totalAmountUsdtS == null ? 0 : Double.parseDouble(totalAmountUsdtS)); |
| | | memberDataInfoVo.setClosingPrice(closingpriceByMid == null ? "0" : closingpriceByMid); |
| | | memberDataInfoVo.setSellClosingPrice(sellClosingpriceByMid == null ? "0" : sellClosingpriceByMid); |
| | | memberDataInfoVo.setFee(returnMoneyByMid == null ? "0" : returnMoneyByMid); |
| | | memberDataInfoVo.setYingkui(rewardratioByMid == null ? "0" : rewardratioByMid); |
| | | memberDataInfoVo.setNotNullNumber(notNullNumber == null ? "0" : notNullNumber); |
| | | memberDataInfoVo.setWalletNumber(walletNumber == null ? "0" : walletNumber); |
| | | memberDataInfoVo.setWalletCoinNumber(walletCoinNumber == null ? "0" : walletCoinNumber); |
| | | memberDataInfoVo.setPlatformProfitAndLoss(platformProfitAndLoss == 0 ? "0" : platformProfitAndLoss+""); |
| | | memberDataInfoVo.setDoingPrice(doingPrice == null ? "0" : doingPrice); |
| | | memberDataInfoVo.setWalletNum(walletNum == null ? "0" : walletNum); |
| | | memberDataInfoVo.setWalletCoinNum(walletCoinNum == null ? "0" : walletCoinNum); |
| | | memberDataInfoVo.setAgentNum(agentNum == null ? "0" : agentNum); |
| | | } |
| | | selectMemberListInPage.setTotal(1); |
| | | return selectMemberListInPage; |
| | | } |
| | | |
| | | @Override |
| | | public MemberEntity selectMemberByid(long id) { |
| | | MemberEntity selectById = memberMapper.selectById(id); |
| | | return selectById; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse memberDataInfoList(@NotNull(message = "{required}") long id) { |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("member_id", id); |
| | | columnMap.put("STATUS", 2); |
| | | List<MemberCoinWithdrawEntity> selectByMap = memberCoinWithdrawMapper.selectByMap(columnMap); |
| | | return new FebsResponse().data(selectByMap); |
| | | } |
| | | |
| | | } |