| | |
| | | } |
| | | } |
| | | |
| | | BigDecimal needPower = basicLevelSetting.getCalculationPower().multiply(BigDecimal.valueOf(1024)); |
| | | BigDecimal needPower = BigDecimal.ZERO; |
| | | if ("P".equals(basicLevelSetting.getUnit())) { |
| | | needPower = basicLevelSetting.getCalculationPower().multiply(BigDecimal.valueOf(1024)); |
| | | } else { |
| | | needPower = basicLevelSetting.getCalculationPower(); |
| | | } |
| | | return totalPower.compareTo(needPower) > 0; |
| | | } |
| | | |
| | |
| | | private Map<Long, BigDecimal> buildReturnRatioObj(List<MemberEntity> agents, int type) { |
| | | Map<Long, BigDecimal> returnRatio = new HashMap<Long, BigDecimal>(); |
| | | Long lastId = null; |
| | | int i = 0; |
| | | for (MemberEntity agent : agents) { |
| | | YdBasicLevelSettingEntity settingEntity = agent.getYdBasicLevelSettingEntity(); |
| | | |
| | |
| | | } |
| | | if(settingEntity.getLevel() == 1) { |
| | | if (CollUtil.isNotEmpty(returnRatio)) { |
| | | if (i != 0) { |
| | | returnRatio.put(agent.getId(), BigDecimal.valueOf(0.01)); |
| | | } else { |
| | | BigDecimal lastRatio = returnRatio.get(lastId); |
| | | returnRatio.put(agent.getId(), ratio.subtract(lastRatio)); |
| | | } |
| | | } else { |
| | | returnRatio.put(agent.getId(), ratio); |
| | | } |
| | | |
| | | if (i >= 1) { |
| | | break; |
| | | } |
| | | i++; |
| | | } |
| | | |
| | | if (CollUtil.isEmpty(returnRatio)) { |
| | |
| | | if ("P".equals(order.getYdProductEntity().getProUnit())) { |
| | | count = count.multiply(BigDecimal.valueOf(1024)); |
| | | } |
| | | |
| | | // 订单总收益 |
| | | BigDecimal orderProfit = count.multiply(unitProfit); |
| | | BigDecimal remainProfit = orderProfit; |
| | | if (CollUtil.isNotEmpty(agents)) { |