| | |
| | | BigDecimal everyAmount = daDanTotal.divide(new BigDecimal(count)); |
| | | |
| | | if(everyAmount.compareTo(BigDecimal.ZERO) > 0){ |
| | | DappStorage dappStorageOne = dappStorageMapper.selectAmountByDesc(new Date(),0,1); |
| | | if(ObjectUtil.isNotEmpty(dappStorageOne)){ |
| | | List<DappStorage> dappStorageOne = dappStorageMapper.selectSumByAmountDesc(new Date(),0,1); |
| | | if(CollUtil.isNotEmpty(dappStorageOne)){ |
| | | BigDecimal multiply = everyAmount.multiply(new BigDecimal(oneCount)); |
| | | dappSystemService.updateBalanceInsertFlow( |
| | | multiply, |
| | | dappStorageOne.getMemberId(), |
| | | dappStorageOne.get(0).getMemberId(), |
| | | MoneyFlowEnum.DA_DAN_JI_LI_PERK.getValue(), |
| | | StrUtil.format(MoneyFlowEnum.DA_DAN_JI_LI_PERK.getDescrition(),daDanTotal,multiply)); |
| | | |
| | | realAmount = realAmount.add(multiply); |
| | | } |
| | | DappStorage dappStorageTwo = dappStorageMapper.selectAmountByDesc(new Date(),1,1); |
| | | if(ObjectUtil.isNotEmpty(dappStorageTwo)){ |
| | | List<DappStorage> dappStorageTwo = dappStorageMapper.selectSumByAmountDesc(new Date(),1,1); |
| | | if(CollUtil.isNotEmpty(dappStorageTwo)){ |
| | | BigDecimal multiply = everyAmount.multiply(new BigDecimal(twoCount)); |
| | | dappSystemService.updateBalanceInsertFlow( |
| | | multiply, |
| | | dappStorageTwo.getMemberId(), |
| | | dappStorageTwo.get(0).getMemberId(), |
| | | MoneyFlowEnum.DA_DAN_JI_LI_PERK.getValue(), |
| | | StrUtil.format(MoneyFlowEnum.DA_DAN_JI_LI_PERK.getDescrition(),daDanTotal,multiply)); |
| | | |
| | | realAmount = realAmount.add(multiply); |
| | | } |
| | | DappStorage dappStorageThree = dappStorageMapper.selectAmountByDesc(new Date(),2,1); |
| | | if(ObjectUtil.isNotEmpty(dappStorageThree)){ |
| | | List<DappStorage> dappStorageThree = dappStorageMapper.selectSumByAmountDesc(new Date(),2,1); |
| | | if(CollUtil.isNotEmpty(dappStorageThree)){ |
| | | BigDecimal multiply = everyAmount.multiply(new BigDecimal(threeCount)); |
| | | dappSystemService.updateBalanceInsertFlow( |
| | | multiply, |
| | | dappStorageThree.getMemberId(), |
| | | dappStorageThree.get(0).getMemberId(), |
| | | MoneyFlowEnum.DA_DAN_JI_LI_PERK.getValue(), |
| | | StrUtil.format(MoneyFlowEnum.DA_DAN_JI_LI_PERK.getDescrition(),daDanTotal,multiply)); |
| | | |
| | | realAmount = realAmount.add(multiply); |
| | | } |
| | | DappStorage dappStorageFour = dappStorageMapper.selectAmountByDesc(new Date(),3,1); |
| | | if(ObjectUtil.isNotEmpty(dappStorageFour)){ |
| | | List<DappStorage> dappStorageFour = dappStorageMapper.selectSumByAmountDesc(new Date(),3,1); |
| | | if(CollUtil.isNotEmpty(dappStorageFour)){ |
| | | BigDecimal multiply = everyAmount.multiply(new BigDecimal(fourCount)); |
| | | dappSystemService.updateBalanceInsertFlow( |
| | | multiply, |
| | | dappStorageFour.getMemberId(), |
| | | dappStorageFour.get(0).getMemberId(), |
| | | MoneyFlowEnum.DA_DAN_JI_LI_PERK.getValue(), |
| | | StrUtil.format(MoneyFlowEnum.DA_DAN_JI_LI_PERK.getDescrition(),daDanTotal,multiply)); |
| | | |