xiaoyong931011
2022-10-21 094ac833c36fba81421d7472ebd0f58bacf9e1a9
src/main/java/cc/mrbird/febs/dapp/service/impl/ApiIgtOnHookPlanServiceImpl.java
@@ -31,6 +31,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
@@ -135,7 +136,7 @@
            String levelMemberValue = levelMember.getValue();
            JSONObject levelMemberValueParse = JSONUtil.parseObj(levelMemberValue);
            hangingRevenue = new BigDecimal(levelMemberValueParse.get("hangingRevenue").toString())
                    .multiply(new BigDecimal(0.01)).setScale(2,BigDecimal.ROUND_DOWN);
                    .multiply(new BigDecimal(0.01)).setScale(4,BigDecimal.ROUND_DOWN);
        }
        //获取挂机字表的顺序
        LinkedList<String> isProfitPlan = new LinkedList<>();
@@ -156,7 +157,9 @@
        DateTime dateTime = DateUtil.offsetMinute(awardTime, 5);
        int orderNum = 1;
        for(String profitPlan : isProfitPlan){
            String yyyyMMddHHMM = DateUtil.format(dateTime, "yyyy-MM-dd hh:mm");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            String yyyyMMddHHMM = sdf.format(dateTime);
            DappOnHookAward dappOnHookAwardNext = dappOnHookAwardDao.selectByByAwardTime(yyyyMMddHHMM);
            JSONObject jsonObject = JSONUtil.parseObj(profitPlan);
@@ -210,7 +213,7 @@
        DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId);
        BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
        //如果中奖,返回本金加收益加剩余总挂机金额
        BigDecimal total = totalProfit.add(totalAmount).add(igtOnHookPlanOrder.getAvaAmount()).setScale(2, BigDecimal.ROUND_DOWN);
        BigDecimal total = totalProfit.add(totalAmount).add(igtOnHookPlanOrder.getAvaAmount()).setScale(4, BigDecimal.ROUND_DOWN);
        dappWalletCoinDao.addTotalAndaddAvailableById(memberId,total);
        //生成流水记录
        BigDecimal add = availableAmount.add(total);
@@ -239,7 +242,7 @@
                apiPlanInfoVo.setId(igtOnHookPlanOrder.getId());
                apiPlanInfoVo.setAvaAmount(igtOnHookPlanOrder.getAvaAmount());
                BigDecimal totalProfit = igtOnHookPlanOrderItemDao.selectTotalProfitByByOrderIdAndMemberIdAndState(igtOnHookPlanOrder.getId(),memberId,1,2);
                apiPlanInfoVo.setProfit(totalProfit.setScale(2,BigDecimal.ROUND_DOWN));
                apiPlanInfoVo.setProfit(totalProfit.setScale(4,BigDecimal.ROUND_DOWN));
            }
        }
        return new FebsResponse().success().data(apiPlanInfoVo);
@@ -257,7 +260,9 @@
        Long memberId = dappMemberEntity.getId();
        ArrayList<ApiAwardInfoVo> apiAwardInfoVos = new ArrayList<>();
        DateTime date = DateUtil.date();
        String yyyyMMddHHMM = DateUtil.format(date, "yyyy-MM-dd hh:mm");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
        String yyyyMMddHHMM = sdf.format(date);
        List<DappOnHookAward> dappOnHookAwards = dappOnHookAwardDao.selectInfoByByAwardTime(yyyyMMddHHMM);
        if(CollUtil.isNotEmpty(dappOnHookAwards)){
            for(DappOnHookAward dappOnHookAward : dappOnHookAwards){
@@ -288,7 +293,7 @@
                //挂机收益
                BigDecimal hangingRevenue = new BigDecimal(profitValue.get("hangingRevenue").toString()).divide(new BigDecimal(100));
                //预计收益
                BigDecimal expectProfit = balance.multiply(balance).setScale(2, BigDecimal.ROUND_DOWN);
                BigDecimal expectProfit = balance.multiply(balance).setScale(4, BigDecimal.ROUND_DOWN);
            }
        }