Helius
2021-05-24 0b10fd71ce7a6c32b70eef96f0ceb5a516306d6b
src/main/java/com/xcong/excoin/modules/yunding/service/Impl/XchProfitServiceImpl.java
@@ -167,23 +167,23 @@
        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();
@@ -194,9 +194,8 @@
            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);
            }
        }