| | |
| | | import com.xcong.excoin.modules.contract.service.impl.OrderWebsocketServiceImpl; |
| | | import com.xcong.excoin.modules.member.dao.AgentReturnDao; |
| | | import com.xcong.excoin.modules.member.dao.MemberWalletAgentDao; |
| | | import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao;
|
| | | import com.xcong.excoin.modules.member.entity.AgentReturnEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
|
| | | import com.xcong.excoin.utils.SpringContextHolder; |
| | | import com.xcong.excoin.utils.ThreadPoolUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private MemberWalletAgentDao memberWalletAgentDao; |
| | | @Resource |
| | | private MemberAccountMoneyChangeDao memberAccountMoneyChangeDao; |
| | | @Resource
|
| | | private MemberWalletCoinDao memberWalletCoinDao;
|
| | | |
| | | /*@Test |
| | | public void returnTest() { |
| | |
| | | for (AgentReturnEntity agentReturn : list) { |
| | | BigDecimal needReturn = agentReturn.getReturnAmount(); |
| | | Long refererId = agentReturn.getRefererId(); |
| | | MemberWalletAgentEntity walletAgent = memberWalletAgentDao.selectWalletAgentBymIdAndCode(refererId, "USDT"); |
| | | if (walletAgent == null) { |
| | | //查询币币钱包
|
| | | MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinDao.selectWalletCoinBymIdAndCode(refererId, "USDT");
|
| | | // MemberWalletAgentEntity walletAgent = memberWalletAgentDao.selectWalletAgentBymIdAndCode(refererId, "USDT");
|
| | | // if (walletAgent == null) {
|
| | | // continue;
|
| | | // }
|
| | | if (memberWalletCoinEntity == null) {
|
| | | continue; |
| | | } |
| | | |
| | | log.info("用户ID:{}, 当前余额:{},总金额:{}, 返佣金额:{}", refererId, walletAgent.getAvailableBalance().toPlainString(), walletAgent.getTotalBalance().toPlainString(), needReturn); |
| | | walletAgent.setAvailableBalance(walletAgent.getAvailableBalance().add(needReturn)); |
| | | walletAgent.setTotalBalance(walletAgent.getTotalBalance().add(needReturn)); |
| | | log.info("用户ID:{}, 当前余额:{},总金额:{}, 返佣金额:{}", refererId, memberWalletCoinEntity.getAvailableBalance().toPlainString(), memberWalletCoinEntity.getTotalBalance().toPlainString(), needReturn);
|
| | | memberWalletCoinEntity.setAvailableBalance(memberWalletCoinEntity.getAvailableBalance().add(needReturn));
|
| | | memberWalletCoinEntity.setTotalBalance(memberWalletCoinEntity.getTotalBalance().add(needReturn));
|
| | | |
| | | |
| | | MemberAccountMoneyChange moneyChange = new MemberAccountMoneyChange(); |
| | |
| | | moneyChange.setSymbol("USDT"); |
| | | |
| | | // // 更新代理钱包金额 |
| | | memberWalletAgentDao.updateById(walletAgent); |
| | | memberWalletCoinDao.updateById(memberWalletCoinEntity);
|
| | | // // 更新返佣明细中状态 |
| | | agentReturnDao.updateAgentReturnStatusByRefererId(AgentReturnEntity.IS_RETURN_Y, refererId); |
| | | // // 插入财务流水记录 |