| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | BigDecimal amountNow = runVipGrow.getAmountNow(); |
| | | RunVip runVipNext = runVips.stream().filter(vipItem -> vipItem.getOrderNumber() == runVip.getOrderNumber() + 1).findFirst().orElse(null); |
| | | if(runVipNext != null){ |
| | | |
| | | BigDecimal presentPrice = runVip.getPresentPrice(); |
| | | amountNow = amountNow.subtract(presentPrice); |
| | | |
| | | BigDecimal presentPriceNext = runVipNext.getPresentPrice(); |
| | | BigDecimal subtract = presentPriceNext.subtract(presentPrice); |
| | | |
| | |
| | | |
| | | BigDecimal growthAmountTotal = divide.multiply(new BigDecimal(growthNum)); |
| | | BigDecimal growthAmount = growthAmountTotal.divide(new BigDecimal(C1), 0, RoundingMode.DOWN); |
| | | V3 = V3.add(growthAmount); |
| | | if(growthAmount.intValue() > 0){ |
| | | V3 = V3.add(growthAmount); |
| | | } |
| | | } |
| | | } |
| | | //更新钱包数据 |
| | |
| | | continue; |
| | | } |
| | | for (MallMember item : directMembers) { |
| | | CompletableFuture.runAsync(() -> { |
| | | BigDecimal realScore = calculateDirectScore(memberRunVip, item, operationDate, runVipMap); |
| | | if(BigDecimal.ZERO.compareTo(realScore) >= 0){ |
| | | return; |
| | | } |
| | | walletService.addScore(realScore, memberId); |
| | | String orderNo = MallUtils.getOrderNum("ZLS"); |
| | | mallMoneyFlowService.runVipMoneyFlowAdd( |
| | | memberId, |
| | | item.getId(), |
| | | orderNo, |
| | | FlowTypeEnum.SCORE.getValue(), |
| | | RunVipMoneyFlowTypeEnum.DIRECT_SCORE.getValue(), |
| | | realScore, |
| | | StrUtil.format(RunVipMoneyFlowTypeEnum.DIRECT_SCORE.getDescription(), realScore), |
| | | YesOrNoEnum.YES.getValue() |
| | | ); |
| | | },febsConfigure.asyncThreadPoolTaskExecutor()); |
| | | BigDecimal realScore = calculateDirectScore(memberRunVip, item, operationDate, runVipMap); |
| | | if(BigDecimal.ZERO.compareTo(realScore) >= 0){ |
| | | return; |
| | | } |
| | | walletService.addScore(realScore, memberId); |
| | | String orderNo = MallUtils.getOrderNum("ZLS"); |
| | | mallMoneyFlowService.runVipMoneyFlowAdd( |
| | | memberId, |
| | | item.getId(), |
| | | orderNo, |
| | | FlowTypeEnum.SCORE.getValue(), |
| | | RunVipMoneyFlowTypeEnum.DIRECT_SCORE.getValue(), |
| | | realScore, |
| | | StrUtil.format(RunVipMoneyFlowTypeEnum.DIRECT_SCORE.getDescription(), realScore), |
| | | YesOrNoEnum.YES.getValue() |
| | | ); |
| | | // CompletableFuture.runAsync(() -> { |
| | | // BigDecimal realScore = calculateDirectScore(memberRunVip, item, operationDate, runVipMap); |
| | | // if(BigDecimal.ZERO.compareTo(realScore) >= 0){ |
| | | // return; |
| | | // } |
| | | // walletService.addScore(realScore, memberId); |
| | | // String orderNo = MallUtils.getOrderNum("ZLS"); |
| | | // mallMoneyFlowService.runVipMoneyFlowAdd( |
| | | // memberId, |
| | | // item.getId(), |
| | | // orderNo, |
| | | // FlowTypeEnum.SCORE.getValue(), |
| | | // RunVipMoneyFlowTypeEnum.DIRECT_SCORE.getValue(), |
| | | // realScore, |
| | | // StrUtil.format(RunVipMoneyFlowTypeEnum.DIRECT_SCORE.getDescription(), realScore), |
| | | // YesOrNoEnum.YES.getValue() |
| | | // ); |
| | | // },febsConfigure.asyncThreadPoolTaskExecutor()); |
| | | } |
| | | } |
| | | } catch (Exception e) { |