| | |
| | | List<DataDictionaryCustom> dataDices = dataDictionaryCustomMapper.selectDicByType(DataDictionaryEnum.INDIRECT_BONUS_SETTING.getType()); |
| | | |
| | | directCnt = directCnt == null ? 0 :directCnt; |
| | | // 隔代字典 |
| | | DataDictionaryCustom indrectDic = new DataDictionaryCustom(); |
| | | for (DataDictionaryCustom dataDic : dataDices) { |
| | | if (directCnt > Integer.parseInt(dataDic.getValue())) { |
| | | indrectDic = dataDic; |
| | | } |
| | | } |
| | | |
| | | // 隔代比例 |
| | | BigDecimal indrectDicProp = new BigDecimal(indrectDic.getValue()); |
| | | BigDecimal indrectDicProp = BigDecimal.ZERO; |
| | | for (DataDictionaryCustom dataDic : dataDices) { |
| | | JSONObject jsonObject = JSONObject.parseObject(dataDic.getValue()); |
| | | if (directCnt >= jsonObject.getInteger("pushCnt")) { |
| | | indrectDicProp = jsonObject.getBigDecimal("prop"); |
| | | } |
| | | } |
| | | |
| | | // 隔代推荐奖 收益 |
| | | direct = direct.divide(indrectDicProp, 2, RoundingMode.HALF_UP); |