| | |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity; |
| | | import com.xcong.excoin.modules.yunding.dao.YdBasicLevelSettingDao; |
| | | import com.xcong.excoin.modules.yunding.dao.YdBasicSettingDao; |
| | | import com.xcong.excoin.modules.yunding.dao.YdOrderDao; |
| | | import com.xcong.excoin.modules.yunding.dao.YdProductDao; |
| | | import com.xcong.excoin.modules.yunding.entity.YdBasicLevelSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdBasicSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdProductEntity; |
| | | import com.xcong.excoin.modules.yunding.service.XchProfitService; |
| | |
| | | |
| | | @Autowired |
| | | private YunDingProducter yunDingProducter; |
| | | |
| | | @Autowired |
| | | private YdBasicSettingDao ydBasicSettingDao; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | updateOrder.setId(order.getId()); |
| | | ydOrderDao.updateById(updateOrder); |
| | | } |
| | | |
| | | List<MemberEntity> partners = memberDao.selectPartnerMemberList(); |
| | | YdBasicSettingEntity setting = ydBasicSettingDao.selectById(1L); |
| | | if (CollUtil.isNotEmpty(partners)) { |
| | | BigDecimal returnAmount = order.getAmount().multiply(setting.getPartnerRatio()).divide(BigDecimal.valueOf(partners.size()), 8, BigDecimal.ROUND_DOWN); |
| | | log.info("合伙人分红:{}", returnAmount); |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private Map<Long, BigDecimal> buildReturnRatioObj(List<MemberEntity> agents, int type) { |