| | |
| | | BigDecimal remainder = bigDecimal.remainder(new BigDecimal(String.valueOf(cycle)));//取余 |
| | | if (remainder.compareTo(BigDecimal.ZERO) == 0) { |
| | | /** |
| | | * 更新买单状态 |
| | | * 收益生成一条卖单 |
| | | * 本金生成一条卖单 |
| | | * 用户的账户增加对应的收益 |
| | | */ |
| | | // mallProductBuy.setMateState(ProductEnum.PRODUCT_BUY_MATE_STATE_SUCCESS.getValue()); |
| | | // mallProductBuyMapper.updateById(mallProductBuy); |
| | | BigDecimal nftTotal = mallProductBuy.getNftTotal(); |
| | | BigDecimal profit = nftTotal.multiply(profitPercent.multiply(new BigDecimal(0.01))); |
| | | // BigDecimal add = nftTotal.add(profit); |
| | | // insertSell(mallProductBuy.getMemberId(),add,add,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | BigDecimal add = nftTotal.add(profit); |
| | | insertSell(mallProductBuy.getMemberId(),profit,profit,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | // insertSell(mallProductBuy.getMemberId(),profit,profit,BigDecimal.ZERO,BigDecimal.ZERO); |
| | | String orderNoSY = MallUtils.getOrderNum("SYNFT"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | mallProductBuy.getMemberId(), |
| | | profit, |
| | | MoneyFlowTypeNewEnum.PERK_CYCLE.getValue(), |
| | | orderNoSY, |
| | | null, |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.PERK_CYCLE.getDescrition(), |
| | | AppContants.MEMBER_FLOW_DONE); |
| | | |
| | | MallMemberAmount mallMemberAmountMine = mallMemberAmountMapper.selectByMemberId(mallProductBuy.getMemberId()); |
| | | mallMemberAmountMine.setTrendsNft(mallMemberAmountMine.getTrendsNft().add(profit)); |
| | | mallMemberAmountMapper.updateTrendsNftById(mallMemberAmountMine); |
| | | |
| | | |
| | | /** |
| | | * 更新用户上级收益,冻结7天,7天时间到期自动释放到动态钱包 |