From cf200a1f92c01ba22c326c49391f748ffb006910 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 05 Jul 2021 17:28:35 +0800
Subject: [PATCH] 20210617 开售开关
---
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 160 insertions(+), 8 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 8a0198b..a64a272 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
@@ -3,14 +3,20 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.configure.FebsConfigure;
import com.xcong.excoin.common.entity.FebsResponse;
import com.xcong.excoin.common.entity.QueryRequest;
+import com.xcong.excoin.common.exception.GlobalException;
import com.xcong.excoin.modules.Sms106Send;
import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto;
+import com.xcong.excoin.modules.member.entity.ActivityReceiveRecord;
import com.xcong.excoin.modules.member.entity.AgentFriendRelationEntity;
import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity;
import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity;
@@ -30,6 +36,7 @@
import com.xcong.excoin.modules.member.mapper.MemberQuickBuySaleMapper;
import com.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper;
import com.xcong.excoin.modules.member.service.IMemberService;
+import com.xcong.excoin.modules.member.vo.MemberActivityReceiveVo;
import com.xcong.excoin.modules.member.vo.MemberAuthenticationVo;
import com.xcong.excoin.modules.member.vo.MemberCoinChargeVo;
import com.xcong.excoin.modules.member.vo.MemberCoinWithdrawVo;
@@ -40,6 +47,7 @@
import lombok.RequiredArgsConstructor;
import java.math.BigDecimal;
+import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -93,10 +101,10 @@
if(records != null && records.size() > 0) {
for(AgentFriendRelationEntity agentFriendRelation : records) {
String inviteId = agentFriendRelation.getInviteId();
- if("90457646".equals(inviteId)) {
+ if("rxadr3".equals(inviteId)) {
//该邀请码下的所有代理
Map<String, Object> columnMap = new HashMap<>();
- columnMap.put("referer_id", "90457646");
+ columnMap.put("referer_id", "rxadr3");
List<AgentFriendRelationEntity> selectByMap = agentFriendRelationMapper.selectByMap(columnMap);
if(selectByMap != null && selectByMap.size() > 0) {
@@ -396,6 +404,23 @@
@Override
public IPage<MemberCoinChargeVo> findMemberApplyCoinListInPage(MemberCoinChargeEntity memberCoinChargeEntity,
QueryRequest request) {
+ //查询条件 查询某条线下的所有数据
+ String account = memberCoinChargeEntity.getAccount();
+ //如果account为空,查询全部,account不为空查询对应的memberEntity
+ if(StrUtil.isNotEmpty(account)) {
+ MemberEntity selectMemberByAccount = memberMapper.selectMemberByAccount(account);
+ String inviteId = selectMemberByAccount.getInviteId();
+ Long id = selectMemberByAccount.getId();
+ memberCoinChargeEntity.setMemberId(id);
+ memberCoinChargeEntity.setInviteId(inviteId);
+ }else {
+ MemberEntity memberEntity = memberMapper.selectMemberByAccount(MemberEntity.SYSTEM_REFERER);
+ String inviteId = memberEntity.getInviteId();
+ Long id = memberEntity.getId();
+ memberCoinChargeEntity.setMemberId(id);
+ memberCoinChargeEntity.setInviteId(inviteId);
+ }
+
Page<MemberCoinChargeEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
IPage<MemberCoinChargeVo> findmemberQuickBuySaleListInPage = memberCoinChargeMapper.findMemberApplyCoinListInPage(page, memberCoinChargeEntity);
List<MemberCoinChargeVo> records = findmemberQuickBuySaleListInPage.getRecords();
@@ -421,8 +446,24 @@
@Override
public IPage<MemberCoinWithdrawVo> findmemberWithdrawCoinListInPage(
MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request) {
- Page<MemberCoinWithdrawEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
+ //查询条件 查询某条线下的所有数据
+ String account = memberCoinWithdrawEntity.getAccount();
+ //如果account为空,查询全部,account不为空查询对应的memberEntity
+ if(StrUtil.isNotEmpty(account)) {
+ MemberEntity selectMemberByAccount = memberMapper.selectMemberByAccount(account);
+ String inviteId = selectMemberByAccount.getInviteId();
+ Long id = selectMemberByAccount.getId();
+ memberCoinWithdrawEntity.setMemberId(id);
+ memberCoinWithdrawEntity.setInviteId(inviteId);
+ }else {
+ MemberEntity memberEntity = memberMapper.selectMemberByAccount(MemberEntity.SYSTEM_REFERER);
+ String inviteId = memberEntity.getInviteId();
+ Long id = memberEntity.getId();
+ memberCoinWithdrawEntity.setMemberId(id);
+ memberCoinWithdrawEntity.setInviteId(inviteId);
+ }
+ 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) {
@@ -459,7 +500,7 @@
String address = selectById.getAddress();
int status = selectById.getStatus();
if(status != 1) {
- return new FebsResponse().fail().message("只有等待审核的状态才能确认!");
+ return new FebsResponse().message("只有等待审核的状态才能确认!");
}
// 查询币币钱包
@@ -478,10 +519,19 @@
columnMap.put("address", address);
// 如果是内部转账 则需要将币加到内部地址
List<MemberCoinAddressEntity> selectByMap = memberCoinAddressMapper.selectByMap(columnMap);
- if(selectByMap == null || selectByMap.isEmpty()) {
- return new FebsResponse().fail().message("地址有误,请拒绝!");
+ Long aimMemberId = null;
+ if(CollUtil.isEmpty(selectByMap)) {
+// return new FebsResponse().message("地址有误,请拒绝!");
+// throw new GlobalException("地址有误,请拒绝!");
+ MemberEntity memberEntity = memberMapper.selectMemberInfoByQueryKey(address);
+ if (memberEntity == null) {
+ throw new GlobalException("地址有误或用户不存在,请拒绝!");
+ }
+
+ aimMemberId = memberEntity.getId();
+ } else {
+ aimMemberId = selectByMap.get(0).getMemberId();
}
- Long aimMemberId = selectByMap.get(0).getMemberId();
MemberWalletCoinEntity aimWalletCoin = memberWalletCoinMapper.findWalletCoinByMemberIdAndWalletCode(aimMemberId, symbol);
BigDecimal addTotal = aimWalletCoin.getTotalBalance().add(selectById.getAmount());
@@ -524,7 +574,7 @@
log.info("---->{}", phone);
if(StrUtil.isNotBlank(phone)) {
- Sms106Send.sendWithdrawalCoinMsg(phone, time);
+ Sms106Send.sendWithdrawalCoinMsg(phone, new Date(), selectById.getAmount().toString());
}
/**
//短信提醒
@@ -2173,4 +2223,106 @@
return selectMemberListInPage;
}
+
+ @Override
+ public IPage<MemberAccountMoneyChangeEntity> memberBoBiList(
+ MemberAccountMoneyChangeEntity memberAccountMoneyChangeEntity, QueryRequest request) {
+ Page<MemberAccountMoneyChangeEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
+ IPage<MemberAccountMoneyChangeEntity> findmemberQuickBuySaleListInPage = memberMapper.memberBoBiList(page, memberAccountMoneyChangeEntity);
+ return findmemberQuickBuySaleListInPage;
+ }
+
+ @Override
+ public IPage<MemberDataInfoVo> findAllDataInfoListInPage(MemberEntity memberEntity, QueryRequest request) {
+ String account = memberEntity.getAccount();
+// String isTest = memberEntity.getIsTest();
+ //如果account为空,查询全部,account不为空查询对应的memberEntity
+ if(StrUtil.isNotEmpty(account)) {
+ memberEntity = memberMapper.selectMemberByAccount(account);
+ }else {
+ memberEntity = memberMapper.selectMemberByAccount(MemberEntity.SYSTEM_REFERER);
+ }
+// memberEntity.setIsTest("");
+ Page<MemberEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
+ IPage<MemberDataInfoVo> selectMemberListInPage = memberMapper.findMemberDataInfoOneAllRealInPage(page, memberEntity);
+ //USDT充币总额+USDT提币总额
+ String totalAmountUsdtB = memberMapper.selectTotalAmountUsdtBForAllDataInfo(memberEntity);
+ String totalAmountUsdtS = memberMapper.selectTotalAmountUsdtSForAllDataInfo(memberEntity);
+ String totalAmountUsdtCZ = memberMapper.selectTotalAmountUsdtCZForAllDataInfo(memberEntity);
+ String totalAmountUsdtTX = memberMapper.selectTotalAmountUsdtTXForAllDataInfo(memberEntity);
+ //佣金
+ String returnMoneyByMid = memberMapper.selectReturnMoneyForAllDataInfo(memberEntity);
+ //开仓手续费
+ String closingpriceByMid = memberMapper.selectClosingpriceForAllDataInfo(memberEntity);
+ //平仓总手续费
+ String sellClosingpriceByMid = memberMapper.selectSellClosingpriceForForAllDataInfo(memberEntity);
+ //总盈亏
+ String rewardratioByMid = memberMapper.selectRewardratioForAllDataInfo(memberEntity);
+
+ //持仓人数
+// String notNullNumber = memberMapper.selectSFCCForAllDataInfo(memberEntity);
+ //币币账户不为空的人数
+ String walletNumber = memberMapper.selectBBZHForAllDataInfo(memberEntity);
+ //合约账户不为空的人数
+ String walletCoinNumber = memberMapper.selectHYZHForAllDataInfo(memberEntity);
+ //持仓手续费
+ String doingPrice = memberMapper.selectprepriceForAllDataInfo(memberEntity);
+
+ //账户金额
+ String walletNum = memberMapper.selectBBZCForAllDataInfo(memberEntity);
+ String walletCoinNum = memberMapper.selectHYZCForAllDataInfo(memberEntity);
+ String agentNum = memberMapper.selectDLZCForAllDataInfo(memberEntity);
+ double allCoin = 0 ;
+ allCoin = (walletNum == null ? 0 : Double.parseDouble(walletNum))
+ +(walletCoinNum == null ? 0 : Double.parseDouble(walletCoinNum))
+ +(agentNum == null ? 0 : Double.parseDouble(agentNum));
+
+ double platformProfitAndLoss = 0.00 ;
+ 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) {
+ DecimalFormat df = new DecimalFormat("0.00");
+ 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 == "0" ? "0" : df.format(Double.parseDouble(closingpriceByMid)));
+ memberDataInfoVo.setSellClosingPrice(sellClosingpriceByMid == "0" ? "0" : df.format(Double.parseDouble(sellClosingpriceByMid)));
+ memberDataInfoVo.setFee(returnMoneyByMid == "0" ? "0" : df.format(Double.parseDouble(returnMoneyByMid)));
+ memberDataInfoVo.setYingkui(rewardratioByMid == null ? "0" : df.format(Double.parseDouble(rewardratioByMid)));
+// memberDataInfoVo.setNotNullNumber(notNullNumber == null ? "0" : notNullNumber);
+ memberDataInfoVo.setWalletNumber(walletNumber == null ? "0" : walletNumber);
+ memberDataInfoVo.setWalletCoinNumber(walletCoinNumber == null ? "0" : walletCoinNumber);
+ memberDataInfoVo.setPlatformProfitAndLoss(platformProfitAndLoss == 0.00 ? "0" : df.format(platformProfitAndLoss));
+ memberDataInfoVo.setDoingPrice(doingPrice == "0" ? "0" : df.format(Double.parseDouble(doingPrice)));
+ memberDataInfoVo.setWalletNum(walletNum == null ? "0" : df.format(Double.parseDouble(walletNum)));
+ memberDataInfoVo.setWalletCoinNum(walletCoinNum == null ? "0" : df.format(Double.parseDouble(walletCoinNum)));
+ memberDataInfoVo.setAgentNum(agentNum == null ? "0" : df.format(Double.parseDouble(agentNum)));
+ memberDataInfoVo.setAllCoin(allCoin);
+ }
+ selectMemberListInPage.setTotal(1);
+ return selectMemberListInPage;
+ }
+
+
+ @Override
+ public IPage<MemberActivityReceiveVo> memberActivityReceive(ActivityReceiveRecord activityReceiveRecord,
+ QueryRequest request) {
+
+ Page<ActivityReceiveRecord> page = new Page<>(request.getPageNum(), request.getPageSize());
+ return memberMapper.memberActivityReceive(page, activityReceiveRecord);
+ }
+
+
+ @Override
+ public IPage<ActivityReceiveRecord> seeReceiveInfo(QueryRequest request,
+ ActivityReceiveRecord activityReceiveRecord) {
+ Page<ActivityReceiveRecord> page = new Page<>(request.getPageNum(), request.getPageSize());
+ return memberMapper.seeReceiveInfo(page, activityReceiveRecord);
+ }
+
}
--
Gitblit v1.9.1