From 045bd089a7c782a66ecf1f4d77bd78859fa6cb74 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 23 Jul 2020 17:46:19 +0800 Subject: [PATCH] 20200723 代码提交 --- src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java | 575 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 574 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java b/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java index b0c39a3..aef4b35 100644 --- a/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java @@ -1,14 +1,17 @@ package com.xcong.excoin.modules.member.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xcong.excoin.common.entity.FebsResponse; import com.xcong.excoin.common.entity.QueryRequest; +import com.xcong.excoin.modules.Sms106Send; import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto; import com.xcong.excoin.modules.member.entity.AgentFriendRelationEntity; import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity; +import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity; import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity; import com.xcong.excoin.modules.member.entity.MemberCoinChargeEntity; import com.xcong.excoin.modules.member.entity.MemberCoinWithdrawEntity; @@ -29,11 +32,13 @@ 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.MemberInfoDetailVo; import com.xcong.excoin.modules.member.vo.MemberQuickBuySaleVo; import com.xcong.excoin.modules.member.vo.MemberQuickSaleVo; import lombok.RequiredArgsConstructor; import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -44,6 +49,8 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; + +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +58,7 @@ * @author wzy * @date 2020-06-10 **/ +@Slf4j @Service @RequiredArgsConstructor public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberEntity> implements IMemberService { @@ -181,7 +189,16 @@ @Override public IPage<MemberEntity> findMemberListInPage(MemberEntity memberEntity, QueryRequest request) { Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); - return this.baseMapper.selectMemberListInPage(page, memberEntity); + IPage<MemberEntity> selectMemberListInPage = this.baseMapper.selectMemberListInPage(page, memberEntity); + List<MemberEntity> records = selectMemberListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberEntity memberEntitys : records) { + String firstName = (memberEntitys.getFirstName() == null ? "" : memberEntitys.getFirstName()); + String secondName = (memberEntitys.getSecondName() == null ? "" : memberEntitys.getSecondName()); + memberEntitys.setRealName(firstName+secondName); + } + } + return selectMemberListInPage; } @Override @@ -386,7 +403,17 @@ public IPage<MemberCoinWithdrawVo> findmemberWithdrawCoinListInPage( MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request) { Page<MemberCoinWithdrawEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberCoinWithdrawVo> findmemberQuickBuySaleListInPage = memberCoinWithdrawMapper.findmemberWithdrawCoinListInPage(page, memberCoinWithdrawEntity); + List<MemberCoinWithdrawVo> records = findmemberQuickBuySaleListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberCoinWithdrawVo memberCoinWithdrawVo : records) { + BigDecimal amount = memberCoinWithdrawVo.getAmount(); + BigDecimal feeAmount = memberCoinWithdrawVo.getFeeAmount(); + BigDecimal subtract = amount.subtract(feeAmount); + memberCoinWithdrawVo.setRealAmount(subtract); + } + } return findmemberQuickBuySaleListInPage; } @@ -457,6 +484,16 @@ selectById.setStatus(MemberCoinWithdrawEntity.IS_STATUS_Y); memberCoinWithdrawMapper.updateById(selectById); + MemberEntity memberEntity = memberMapper.selectById(memberId); + String phone = memberEntity.getPhone(); + //String email = memberEntity.getEmail(); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + String time = format.format(new Date()); // 将当前时间袼式化为指定的格式 + + log.info("---->{}", phone); + if(StrUtil.isNotBlank(phone)) { + Sms106Send.sendWithdrawalCoinMsg(phone, time); + } /** //短信提醒 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); @@ -529,9 +566,13 @@ selectById.setCertifyStatus(MemberEntity.CERTIFY_STATUS_Y); }else { selectById.setCertifyStatus(MemberEntity.CERTIFY_STATUS_N); + Map<String, Object> columnMap = new HashMap<>(); + columnMap.put("member_id", selectById.getId()); + memberAuthenticationMapper.deleteByMap(columnMap); } selectById.setIdcardNo(memberAuthenticationEntity.getIdcardNo()); memberMapper.updateById(selectById); + return new FebsResponse().success(); } @@ -670,4 +711,536 @@ return new FebsResponse().success(); } + + @Override + public MemberInfoDetailVo selectMemberInfoDetailById(long id) { + MemberCoinWithdrawEntity selectById = memberCoinWithdrawMapper.selectById(id); + Long memberId = selectById.getMemberId(); + MemberInfoDetailVo memberInfoDetailVo = new MemberInfoDetailVo(); + + //USDT充币总额+USDT提币总额 + String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setChargeCoin(totalAmountUsdtB == null ? 0 : Double.parseDouble(totalAmountUsdtB)); + String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setAppealCoin(totalAmountUsdtS == null ? 0 : Double.parseDouble(totalAmountUsdtS)); + //USDT充值总额+USDT提现总额 + String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setChargeUsdt(totalAmountUsdtCZ == null ? 0 : Double.parseDouble(totalAmountUsdtCZ)); + String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setAppealUsdt(totalAmountUsdtTX == null ? 0 : Double.parseDouble(totalAmountUsdtTX)); + //总剩余 + 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)); + memberInfoDetailVo.setTotalCoin(platformProfitAndLoss); + //佣金 + String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setFee(returnMoneyByMid == null ? 0 : Double.parseDouble(returnMoneyByMid)); + //开仓手续费总额 + String closingpriceByMid = memberMapper.selectClosingpriceForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setClosingPrice(closingpriceByMid == null ? 0 : Double.parseDouble(closingpriceByMid)); + //平仓总手续费 + String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setSellClosingPrice(sellClosingpriceByMid == null ? 0 : Double.parseDouble(sellClosingpriceByMid)); + + //总盈亏 + String rewardratioByMid = memberMapper.selectRewardratioForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setPlatformProfitAndLoss(rewardratioByMid == null ? 0 : Double.parseDouble(rewardratioByMid)); + + //持仓手续费 + String doingPrice = memberMapper.selectprepriceForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setDoingPrice(doingPrice == null ? 0 : Double.parseDouble(doingPrice)); + + //账户金额 + String walletNum = memberMapper.selectBBZCForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setWalletCoinNum(walletNum == null ? 0 : Double.parseDouble(walletNum)); + String walletCoinNum = memberMapper.selectHYZCForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setTotalContract(walletCoinNum == null ? 0 : Double.parseDouble(walletCoinNum)); + String agentNum = memberMapper.selectDLZCForBasicRealDataBymemberId(memberId); + memberInfoDetailVo.setAgentNum(agentNum == null ? 0 : Double.parseDouble(agentNum)); + + return memberInfoDetailVo; + } + + + @Override + public IPage<MemberCoinChargeVo> findmemberApplyCoinAloneInPage(MemberCoinChargeEntity memberCoinChargeEntity, + QueryRequest request) { + Page<MemberCoinChargeEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberCoinChargeVo> findmemberQuickBuySaleListInPage = memberCoinChargeMapper.findmemberApplyCoinAloneInPage(page, memberCoinChargeEntity); + List<MemberCoinChargeVo> records = findmemberQuickBuySaleListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberCoinChargeVo memberCoinChargeVo : records) { + Long memberId = memberCoinChargeVo.getMemberId(); + Map<String, Object> columnMap = new HashMap<>(); + columnMap.put("member_id", memberId); + List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap ); + if(selectByMap != null && selectByMap.size() > 0) { + MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0); + String firstName = memberAuthenticationEntity.getFirstName(); + String secondName = memberAuthenticationEntity.getSecondName(); + String realName = firstName + secondName; + memberCoinChargeVo.setRealName(realName); + } + } + } + return findmemberQuickBuySaleListInPage; + } + + + @Override + public IPage<MemberCoinWithdrawVo> findMemberWithdrawCoinAloneInPage( + MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request) { + Page<MemberCoinWithdrawEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + + IPage<MemberCoinWithdrawVo> findmemberQuickBuySaleListInPage = memberCoinWithdrawMapper.findMemberWithdrawCoinAloneInPage(page, memberCoinWithdrawEntity); + List<MemberCoinWithdrawVo> records = findmemberQuickBuySaleListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberCoinWithdrawVo memberCoinWithdrawVo : records) { + BigDecimal amount = memberCoinWithdrawVo.getAmount(); + BigDecimal feeAmount = memberCoinWithdrawVo.getFeeAmount(); + BigDecimal subtract = amount.subtract(feeAmount); + memberCoinWithdrawVo.setRealAmount(subtract); + + Long memberId = memberCoinWithdrawVo.getMemberId(); + Map<String, Object> columnMap = new HashMap<>(); + columnMap.put("member_id", memberId); + List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap ); + if(selectByMap != null && selectByMap.size() > 0) { + MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0); + String firstName = memberAuthenticationEntity.getFirstName(); + String secondName = memberAuthenticationEntity.getSecondName(); + String realName = firstName + secondName; + memberCoinWithdrawVo.setRealName(realName); + } + } + } + return findmemberQuickBuySaleListInPage; + } + + + @Override + public IPage<MemberEntity> findMemberAloneInPage(MemberEntity member, QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberEntity> selectMemberListInPage = this.baseMapper.findMemberAloneInPage(page, member); + List<MemberEntity> records = selectMemberListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberEntity memberEntitys : records) { + String firstName = (memberEntitys.getFirstName() == null ? "" : memberEntitys.getFirstName()); + String secondName = (memberEntitys.getSecondName() == null ? "" : memberEntitys.getSecondName()); + memberEntitys.setRealName(firstName+secondName); + } + } + return selectMemberListInPage; + } + + + @Override + public IPage<MemberDataInfoVo> findMemberDataInfoAloneDtoListInPage(MemberEntity memberEntity, + QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberDataInfoVo> selectMemberListInPage = memberMapper.selectMemberDataInfoDtoRealListInPageAlone(page, memberEntity); + //USDT充币总额+USDT提币总额 + String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForBasicRealDataAlone(); + String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicRealDataAlone(); + //USDT充值总额+USDT提现总额 + String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicRealDataAlone(); + String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicRealDataAlone(); + //佣金 + String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicRealDataAlone(); + //开仓手续费总额 + String closingpriceByMid = memberMapper.selectClosingpriceForBasicRealDataAlone(); + //平仓总手续费 + String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicRealDataAlone(); + + //总盈亏 + String rewardratioByMid = memberMapper.selectRewardratioForBasicRealDataAlone(); + + //持仓人数 + String notNullNumber = memberMapper.selectSFCCForBasicRealDataAlone(); + //币币账户不为空的人数 + String walletNumber = memberMapper.selectBBZHForBasicRealDataAlone(); + //合约账户不为空的人数 + String walletCoinNumber = memberMapper.selectHYZHForBasicRealDataAlone(); + //持仓手续费 + String doingPrice = memberMapper.selectprepriceForBasicRealDataAlone(); + + //账户金额 + String walletNum = memberMapper.selectBBZCForBasicRealDataAlone(); + String walletCoinNum = memberMapper.selectHYZCForBasicRealDataAlone(); + String agentNum = memberMapper.selectDLZCForBasicRealDataAlone(); + + 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 IPage<MemberDataInfoVo> findMemberDataInfoAllInPage(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.selectTotalAmountUsdtBForBasicData(); + String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicData(); + //USDT充值总额+USDT提现总额 + String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicData(); + String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicData(); + //佣金 + String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicRealData(); + //开仓手续费总额 + String closingpriceByMid = memberMapper.selectClosingpriceForBasicData(); + //平仓总手续费 + String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicData(); + + //总盈亏 + String rewardratioByMid = memberMapper.selectRewardratioForBasicData(); + + //持仓人数 + String notNullNumber = memberMapper.selectSFCCForBasicData(); + //币币账户不为空的人数 + String walletNumber = memberMapper.selectBBZHForBasicData(); + //合约账户不为空的人数 + String walletCoinNumber = memberMapper.selectHYZHForBasicData(); + //持仓手续费 + String doingPrice = memberMapper.selectprepriceForBasicData(); + + //账户金额 + String walletNum = memberMapper.selectBBZCForBasicData(); + String walletCoinNum = memberMapper.selectHYZCForBasicData(); + String agentNum = memberMapper.selectDLZCForBasicData(); + + 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 IPage<MemberDataInfoVo> findMemberDataInfoAllAloneListInPage(MemberEntity memberEntity, + QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberDataInfoVo> selectMemberListInPage = memberMapper.selectMemberDataInfoDtoListInPageAlone(page, memberEntity); + //USDT充币总额+USDT提币总额 + String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForBasicAllDataAlone(); + String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicAllDataAlone(); + //USDT充值总额+USDT提现总额 + String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicAllDataAlone(); + String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicAllDataAlone(); + //佣金 + String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicAllDataAlone(); + //开仓手续费总额 + String closingpriceByMid = memberMapper.selectClosingpriceForBasicAllDataAlone(); + //平仓总手续费 + String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicAllDataAlone(); + + //总盈亏 + String rewardratioByMid = memberMapper.selectRewardratioForBasicAllDataAlone(); + + //持仓人数 + String notNullNumber = memberMapper.selectSFCCForBasicAllDataAlone(); + //币币账户不为空的人数 + String walletNumber = memberMapper.selectBBZHForBasicAllDataAlone(); + //合约账户不为空的人数 + String walletCoinNumber = memberMapper.selectHYZHForBasicAllDataAlone(); + //持仓手续费 + String doingPrice = memberMapper.selectprepriceForBasicAllDataAlone(); + + //账户金额 + String walletNum = memberMapper.selectBBZCForBasicAllDataAlone(); + String walletCoinNum = memberMapper.selectHYZCForBasicAllDataAlone(); + String agentNum = memberMapper.selectDLZCForBasicAllDataAlone(); + + 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 IPage<MemberEntity> findMemberListTestInPage(MemberEntity member, QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberEntity> selectMemberListInPage = this.baseMapper.findMemberListTestInPage(page, member); + List<MemberEntity> records = selectMemberListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberEntity memberEntitys : records) { + String firstName = (memberEntitys.getFirstName() == null ? "" : memberEntitys.getFirstName()); + String secondName = (memberEntitys.getSecondName() == null ? "" : memberEntitys.getSecondName()); + memberEntitys.setRealName(firstName+secondName); + } + } + return selectMemberListInPage; + } + + + @Override + public IPage<MemberCoinWithdrawVo> findMemberWithdrawCoinTestListInPage( + MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request) { + Page<MemberCoinWithdrawEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + + IPage<MemberCoinWithdrawVo> findmemberQuickBuySaleListInPage = memberCoinWithdrawMapper.findMemberWithdrawCoinTestListInPage(page, memberCoinWithdrawEntity); + List<MemberCoinWithdrawVo> records = findmemberQuickBuySaleListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberCoinWithdrawVo memberCoinWithdrawVo : records) { + BigDecimal amount = memberCoinWithdrawVo.getAmount(); + BigDecimal feeAmount = memberCoinWithdrawVo.getFeeAmount(); + BigDecimal subtract = amount.subtract(feeAmount); + memberCoinWithdrawVo.setRealAmount(subtract); + + Long memberId = memberCoinWithdrawVo.getMemberId(); + Map<String, Object> columnMap = new HashMap<>(); + columnMap.put("member_id", memberId); + List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap ); + if(selectByMap != null && selectByMap.size() > 0) { + MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0); + String firstName = memberAuthenticationEntity.getFirstName(); + String secondName = memberAuthenticationEntity.getSecondName(); + String realName = firstName + secondName; + memberCoinWithdrawVo.setRealName(realName); + } + } + } + return findmemberQuickBuySaleListInPage; + } + + + @Override + public IPage<MemberCoinChargeVo> findMemberApplyCoinAloneTestInPage(MemberCoinChargeEntity memberCoinChargeEntity, + QueryRequest request) { + Page<MemberCoinChargeEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberCoinChargeVo> findmemberQuickBuySaleListInPage = memberCoinChargeMapper.findMemberApplyCoinAloneTestInPage(page, memberCoinChargeEntity); + List<MemberCoinChargeVo> records = findmemberQuickBuySaleListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberCoinChargeVo memberCoinChargeVo : records) { + Long memberId = memberCoinChargeVo.getMemberId(); + Map<String, Object> columnMap = new HashMap<>(); + columnMap.put("member_id", memberId); + List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap ); + if(selectByMap != null && selectByMap.size() > 0) { + MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0); + String firstName = memberAuthenticationEntity.getFirstName(); + String secondName = memberAuthenticationEntity.getSecondName(); + String realName = firstName + secondName; + memberCoinChargeVo.setRealName(realName); + } + } + } + return findmemberQuickBuySaleListInPage; + } + + + @Override + public IPage<MemberEntity> findMemberAloneTestInPage(MemberEntity member, QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberEntity> selectMemberListInPage = this.baseMapper.findMemberAloneTestInPage(page, member); + List<MemberEntity> records = selectMemberListInPage.getRecords(); + if(records != null && records.size() > 0) { + for(MemberEntity memberEntitys : records) { + String firstName = (memberEntitys.getFirstName() == null ? "" : memberEntitys.getFirstName()); + String secondName = (memberEntitys.getSecondName() == null ? "" : memberEntitys.getSecondName()); + memberEntitys.setRealName(firstName+secondName); + } + } + return selectMemberListInPage; + } + + + @Override + public IPage<MemberDataInfoVo> findMemberDataInfoAloneTestDtoListInPage(MemberEntity memberEntity, + QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberDataInfoVo> selectMemberListInPage = memberMapper.findMemberDataInfoAloneTestDtoListInPage(page, memberEntity); + //USDT充币总额+USDT提币总额 + String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForBasicRealTestDataAlone(); + String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicRealTestDataAlone(); + //USDT充值总额+USDT提现总额 + String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicRealTestDataAlone(); + String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicRealTestDataAlone(); + //佣金 + String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicRealTestDataAlone(); + //开仓手续费总额 + String closingpriceByMid = memberMapper.selectClosingpriceForBasicRealTestDataAlone(); + //平仓总手续费 + String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicRealTestDataAlone(); + + //总盈亏 + String rewardratioByMid = memberMapper.selectRewardratioForBasicRealTestDataAlone(); + + //持仓人数 + String notNullNumber = memberMapper.selectSFCCForBasicRealTestDataAlone(); + //币币账户不为空的人数 + String walletNumber = memberMapper.selectBBZHForBasicRealTestDataAlone(); + //合约账户不为空的人数 + String walletCoinNumber = memberMapper.selectHYZHForBasicRealTestDataAlone(); + //持仓手续费 + String doingPrice = memberMapper.selectprepriceForBasicRealTestDataAlone(); + + //账户金额 + String walletNum = memberMapper.selectBBZCForBasicRealTestDataAlone(); + String walletCoinNum = memberMapper.selectHYZCForBasicRealTestDataAlone(); + String agentNum = memberMapper.selectDLZCForBasicRealTestDataAlone(); + + 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 IPage<MemberDataInfoVo> findMemberDataInfoAllAloneTestListInPage(MemberEntity memberEntity, + QueryRequest request) { + Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); + IPage<MemberDataInfoVo> selectMemberListInPage = memberMapper.findMemberDataInfoAllAloneTestListInPage(page, memberEntity); + //USDT充币总额+USDT提币总额 + String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForBasicRealTestAllDataAlone(); + String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForBasicRealTestAllDataAlone(); + //USDT充值总额+USDT提现总额 + String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForBasicRealTestAllDataAlone(); + String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForBasicRealTestAllDataAlone(); + //佣金 + String returnMoneyByMid = memberMapper.selectReturnMoneyForBasicRealTestAllDataAlone(); + //开仓手续费总额 + String closingpriceByMid = memberMapper.selectClosingpriceForBasicRealTestAllDataAlone(); + //平仓总手续费 + String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForBasicRealTestAllDataAlone(); + + //总盈亏 + String rewardratioByMid = memberMapper.selectRewardratioForBasicRealTestAllDataAlone(); + + //持仓人数 + String notNullNumber = memberMapper.selectSFCCForBasicRealTestAllDataAlone(); + //币币账户不为空的人数 + String walletNumber = memberMapper.selectBBZHForBasicRealTestAllDataAlone(); + //合约账户不为空的人数 + String walletCoinNumber = memberMapper.selectHYZHForBasicRealTestAllDataAlone(); + //持仓手续费 + String doingPrice = memberMapper.selectprepriceForBasicRealTestAllDataAlone(); + + //账户金额 + String walletNum = memberMapper.selectBBZCForBasicRealTestAllDataAlone(); + String walletCoinNum = memberMapper.selectHYZCForBasicRealTestAllDataAlone(); + String agentNum = memberMapper.selectDLZCForBasicRealTestAllDataAlone(); + + 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; + } + } -- Gitblit v1.9.1