| | |
| | | List<String> inviteIds = StrUtil.split(memberEntity.getRefererIds(), ','); |
| | | List<MemberEntity> agents = memberDao.selectYdParentAgent(inviteIds); |
| | | |
| | | if (CollUtil.isNotEmpty(agents)) { |
| | | Map<Long, BigDecimal> returnRatio = buildReturnRatioObj(agents, 1); |
| | | |
| | | for (Map.Entry<Long, BigDecimal> entry : returnRatio.entrySet()) { |
| | | String conent = "USDT返利"; |
| | | BigDecimal amount = order.getAmount().multiply(entry.getValue()); |
| | | LogRecordUtils.insertMemberAccountMoneyChangeWithId(entry.getKey(), conent, amount, "USDT", 1, 6, order.getId()); |
| | | MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(entry.getKey(), "USDT"); |
| | | |
| | | memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), amount, BigDecimal.ZERO, 0); |
| | | } |
| | | |
| | | YdOrderEntity updateOrder = new YdOrderEntity(); |
| | | updateOrder.setReturnState(2); |
| | | updateOrder.setId(order.getId()); |
| | | ydOrderDao.updateById(updateOrder); |
| | | } |
| | | // if (CollUtil.isNotEmpty(agents)) { |
| | | // Map<Long, BigDecimal> returnRatio = buildReturnRatioObj(agents, 1); |
| | | // |
| | | // for (Map.Entry<Long, BigDecimal> entry : returnRatio.entrySet()) { |
| | | // String conent = "USDT返利"; |
| | | // BigDecimal amount = order.getAmount().multiply(entry.getValue()); |
| | | // LogRecordUtils.insertMemberAccountMoneyChangeWithId(entry.getKey(), conent, amount, "USDT", 1, 6, order.getId()); |
| | | // MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(entry.getKey(), "USDT"); |
| | | // |
| | | // memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), amount, BigDecimal.ZERO, 0); |
| | | // } |
| | | // |
| | | // YdOrderEntity updateOrder = new YdOrderEntity(); |
| | | // updateOrder.setReturnState(2); |
| | | // updateOrder.setId(order.getId()); |
| | | // ydOrderDao.updateById(updateOrder); |
| | | // } |
| | | |
| | | // 合伙人分红 |
| | | List<MemberEntity> partners = memberDao.selectPartnerMemberList(); |
| | |
| | | for (MemberEntity partner : partners) { |
| | | String conent = "合伙人USDT分红"; |
| | | LogRecordUtils.insertMemberAccountMoneyChangeWithId(partner.getId(), conent, returnAmount, "USDT", 1, 9, order.getId()); |
| | | MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(partner.getId(), "USDT"); |
| | | |
| | | memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), returnAmount, BigDecimal.ZERO, 0); |
| | | // MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(partner.getId(), "USDT"); |
| | | // memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), returnAmount, BigDecimal.ZERO, 0); |
| | | } |
| | | } |
| | | |