Helius
2022-08-05 e3edebdebd6d47c3c2c4542e3ec790433969dd1c
fix:openBox upgrade
3 files modified
66 ■■■■■ changed files
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java 60 ●●●● patch | view | raw | blame | history
src/main/resources/i18n/message_en_US.properties 3 ●●●●● patch | view | raw | blame | history
src/main/resources/i18n/message_zh_CN.properties 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -372,35 +372,39 @@
    @Override
    public int boxSurprise() {
        DappMemberEntity member = LoginUserUtil.getAppUser();
        DappWalletCoinEntity walletCoin = dappWalletCoinDao.selectByMemberId(member.getId());
        if (walletCoin.getBoxCnt() < 1) {
            throw new FebsException("盲盒数量不足");
        }
        // 功能升级
        throw new FebsException(MessageSourceUtils.getString("box_surprise_002"));
        walletCoin.setBoxCnt(walletCoin.getBoxCnt() - 1);
        dappWalletCoinDao.updateById(walletCoin);
        BoxUtil.Box box = BoxUtil.openBox();
        DappFundFlowEntity boxFundFlow = new DappFundFlowEntity(member.getId(), new BigDecimal(box.getIndex()), 6, 2, BigDecimal.ZERO);
        dappFundFlowDao.insert(boxFundFlow);
        new Thread(() -> {
            try {
                int count = box.getIndex();
                while (count > 0) {
                    ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).safeMintNFT(member.getAddress());
                    Thread.sleep(5000);
                    count--;
                }
            } catch (Exception e) {
                e.printStackTrace();
                log.error("发放卡牌错误", e);
            }
        }).start();
        return box.getIndex();
//        DappMemberEntity member = LoginUserUtil.getAppUser();
//
//        DappWalletCoinEntity walletCoin = dappWalletCoinDao.selectByMemberId(member.getId());
//        if (walletCoin.getBoxCnt() < 1) {
//            throw new FebsException(MessageSourceUtils.getString("box_surprise_001"));
//        }
//
//        walletCoin.setBoxCnt(walletCoin.getBoxCnt() - 1);
//        dappWalletCoinDao.updateById(walletCoin);
//
//        BoxUtil.Box box = BoxUtil.openBox();
//
//        DappFundFlowEntity boxFundFlow = new DappFundFlowEntity(member.getId(), new BigDecimal(box.getIndex()), 6, 2, BigDecimal.ZERO);
//        dappFundFlowDao.insert(boxFundFlow);
//
//        new Thread(() -> {
//            try {
//                int count = box.getIndex();
//                while (count > 0) {
//                    ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).safeMintNFT(member.getAddress());
//                    Thread.sleep(5000);
//                    count--;
//                }
//            } catch (Exception e) {
//                e.printStackTrace();
//                log.error("发放卡牌错误", e);
//            }
//        }).start();
//
//        return box.getIndex();
    }
}
src/main/resources/i18n/message_en_US.properties
@@ -8,5 +8,8 @@
transfer_msg_006=Not Enough Coin
transfer_msg_007=Buy up to 1000 per day
box_surprise_001=Not Enough Box
box_surprise_002=Feature upgrade
system_regist_error=Please contact the recommender to recommend registration.
src/main/resources/i18n/message_zh_CN.properties
@@ -8,4 +8,7 @@
transfer_msg_006=\u0054\u0046\u0043\u5e01\u4e0d\u8db3
transfer_msg_007=\u6bcf\u5929\u6700\u591a\u8d2d\u4e70\u0031\u0030\u0030\u0030\u0055\u0053\u0044\u0054
box_surprise_001=\u76f2\u76d2\u6570\u91cf\u4e0d\u8db3
box_surprise_002=\u529f\u80fd\u5347\u7ea7\u4e2d
system_regist_error=\u8bf7\u8054\u7cfb\u63a8\u8350\u4eba\u63a8\u8350\u6ce8\u518c