xiaoyong931011
2023-02-09 e92b00089d8d57899df380135d79864dade09837
src/main/java/cc/mrbird/febs/dapp/enumerate/MemberOnHookPlanEnum.java
@@ -31,8 +31,8 @@
                    //当实际的收益小于预期的收益时,按照随机,否则只中奖第一方案
                    int randomInt = 1;
                    if(profitTotal.compareTo(profitTotalNow)>0){
                        randomInt = RandomUtil.randomInt(1, 4);
                    if(profitTotalNow.compareTo(profitTotal)>0){
                        randomInt = RandomUtil.randomInt(1, 3);
                    }
                    if(1 == randomInt){
                        String planKey = Integer.toString(randomInt);
@@ -63,7 +63,11 @@
                                    }
                                    BigDecimal amount = new BigDecimal(jsonObject.get("amount").toString());
                                    BigDecimal profit = amount.multiply(hangingRevenue).setScale(4, BigDecimal.ROUND_DOWN);
                                    profitTotalNow = profitTotalNow.add(profit).setScale(4, BigDecimal.ROUND_DOWN);
                                    if(j != randomInt){
                                        profitTotalNow = profitTotalNow.add(profit).subtract(amount).setScale(4, BigDecimal.ROUND_DOWN);
                                    }else{
                                        profitTotalNow = profitTotalNow.add(profit).setScale(4, BigDecimal.ROUND_DOWN);
                                    }
                                    jsonObject.set("profit",profit);
                                    linkedList.add(JSONUtil.toJsonStr(jsonObject));
                                    maxTimes --;