| | |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.excoin.common.contants.AppContants; |
| | | import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao; |
| | | import com.xcong.excoin.modules.member.dao.MemberDao; |
| | | import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao; |
| | |
| | | import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdProductEntity; |
| | | import com.xcong.excoin.modules.yunding.service.XchProfitService; |
| | | import com.xcong.excoin.netty.common.Contans; |
| | | import com.xcong.excoin.rabbit.producer.YunDingProducter; |
| | | import com.xcong.excoin.utils.LogRecordUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | ydOrderDao.updateById(updateOrder); |
| | | } |
| | | |
| | | // 合伙人分红 |
| | | List<MemberEntity> partners = memberDao.selectPartnerMemberList(); |
| | | YdBasicSettingEntity setting = ydBasicSettingDao.selectById(1L); |
| | | if (CollUtil.isNotEmpty(partners)) { |
| | |
| | | } |
| | | } |
| | | |
| | | if(!AppContants.SYSTEM_REFERER.equals(memberEntity.getRefererId())) { |
| | | // 直推返利 |
| | | MemberEntity parentNode = memberDao.selectMemberInfoByInviteId(memberEntity.getRefererId()); |
| | | if (parentNode != null) { |
| | | BigDecimal parentAmount = order.getAmount().multiply(setting.getParentRatio()); |
| | | |
| | | String conent = "直推USDT返利"; |
| | | LogRecordUtils.insertMemberAccountMoneyChangeWithId(parentNode.getId(), conent, parentAmount, "USDT", 1, 10, order.getId()); |
| | | MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(parentNode.getId(), "USDT"); |
| | | |
| | | memberWalletCoinDao.updateBlockBalance(walletCoin.getId(), parentAmount, BigDecimal.ZERO, 0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Map<Long, BigDecimal> buildReturnRatioObj(List<MemberEntity> agents, int type) { |