| | |
| | | mallMemberAmountMapper.updateTotalPerkById(mallMemberAmountPerk); |
| | | } |
| | | // 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); |
| | | MallMember mallMemberMe = memberMapper.selectById(mallProductBuy.getMemberId()); |
| | | if(ProductEnum.MEMBER_FROZEN.getValue() == mallMemberMe.getIsFrozen()){ |
| | | //插入一条流水记录 |
| | | String orderNo = MallUtils.getOrderNum("FNFTW"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | mallProductBuy.getMemberId(), |
| | | profit.negate(), |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT_WRONG.getValue(), |
| | | orderNo, |
| | | null, |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT_WRONG.getDescrition(), |
| | | AppContants.MEMBER_FLOW_ING); |
| | | |
| | | }else{ |
| | | 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); |
| | | } |
| | | |
| | | BigDecimal remainderDirect = bigDecimal.divide(new BigDecimal(String.valueOf(cycle)),0,BigDecimal.ROUND_DOWN);//取余 |
| | | if(remainderDirect.compareTo(BigDecimal.ONE) == 0){ |
| | |
| | | ).getValue()).multiply(new BigDecimal("0.01")); |
| | | // BigDecimal basicPerkDirect = profit.multiply(basicPerkDirectPercent).setScale(2, BigDecimal.ROUND_DOWN); |
| | | BigDecimal basicPerkDirect = nftTotal.multiply(basicPerkDirectPercent).setScale(2, BigDecimal.ROUND_DOWN); |
| | | /** |
| | | * 先插入流水记录,然后定时器每小时,循环一次找寻对应的数据执行 |
| | | */ |
| | | String orderNo = MallUtils.getOrderNum("DNFT"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | directMember.getId(), |
| | | basicPerkDirect, |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT.getValue(), |
| | | orderNo, |
| | | null, |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT.getDescrition(), |
| | | AppContants.MEMBER_FLOW_ING); |
| | | |
| | | MallMemberAmount mallMemberAmountDirect = mallMemberAmountMapper.selectByMemberId(directMember.getId()); |
| | | mallMemberAmountDirect.setFrozenNft(mallMemberAmountDirect.getFrozenNft().add(basicPerkDirect)); |
| | | mallMemberAmountMapper.updateFrozenNftById(mallMemberAmountDirect); |
| | | if(ProductEnum.MEMBER_FROZEN.getValue() == directMember.getIsFrozen()){ |
| | | //插入一条流水记录 |
| | | String orderNo = MallUtils.getOrderNum("FNFTW"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | directMember.getId(), |
| | | profit.negate(), |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT_WRONG.getValue(), |
| | | orderNo, |
| | | null, |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT_WRONG.getDescrition(), |
| | | AppContants.MEMBER_FLOW_ING); |
| | | |
| | | }else{ |
| | | /** |
| | | * 先插入流水记录,然后定时器每小时,循环一次找寻对应的数据执行 |
| | | */ |
| | | String orderNo = MallUtils.getOrderNum("DNFT"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | directMember.getId(), |
| | | basicPerkDirect, |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT.getValue(), |
| | | orderNo, |
| | | null, |
| | | FlowTypeNewEnum.NFT.getValue(), |
| | | MoneyFlowTypeNewEnum.BASIC_PERK_DIRECT.getDescrition(), |
| | | AppContants.MEMBER_FLOW_ING); |
| | | |
| | | MallMemberAmount mallMemberAmountDirect = mallMemberAmountMapper.selectByMemberId(directMember.getId()); |
| | | mallMemberAmountDirect.setFrozenNft(mallMemberAmountDirect.getFrozenNft().add(basicPerkDirect)); |
| | | mallMemberAmountMapper.updateFrozenNftById(mallMemberAmountDirect); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |