fix
wzy
2022-11-10 db1734ef2e2da94c027bcb9e31ad7a5d13c3c8f9
fix
4 files modified
38 ■■■■■ changed files
src/main/java/cc/mrbird/febs/dapp/service/impl/AdminOperationServiceImpl.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java 11 ●●●● patch | view | raw | blame | history
src/main/resources/application-prod.yml 1 ●●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/ChainTest.java 18 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/AdminOperationServiceImpl.java
@@ -45,6 +45,10 @@
        if(ObjectUtil.isEmpty(memberCoinWithdrawEntity)){
            throw new FebsException("刷新页面重试");
        }
        if (MemberCoinWithdrawEntity.STATUS_DOING != memberCoinWithdrawEntity.getStatus()) {
            throw new FebsException("非可审核状态");
        }
        memberCoinWithdrawEntity.setStatus(MemberCoinWithdrawEntity.STATUS_YES);
        memberCoinWithdrawDao.updateById(memberCoinWithdrawEntity);
@@ -64,6 +68,10 @@
            throw new FebsException("刷新页面重试");
        }
        if (MemberCoinWithdrawEntity.STATUS_DOING != memberCoinWithdrawEntity.getStatus()) {
            throw new FebsException("非可审核状态");
        }
        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(memberCoinWithdrawEntity.getFlowId());
        if (dappFundFlowEntity == null) {
            throw new FebsException("审核失败,联系管理员");
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -211,7 +211,7 @@
        DappFundFlowEntity feeFlow = new DappFundFlowEntity(member.getId(), withdrawDto.getFee().negate(), 7, 2, null, null);
        dappFundFlowDao.insert(feeFlow);
        DappFundFlowEntity fundFlow = new DappFundFlowEntity(member.getId(), withdrawDto.getAmount().negate(), 5, 1, withdrawDto.getFee(), null);
        DappFundFlowEntity fundFlow = new DappFundFlowEntity(member.getId(), withdrawDto.getAmount().negate(), 5, 2, withdrawDto.getFee(), null);
        dappFundFlowDao.insert(fundFlow);
        MemberCoinWithdrawEntity memberCoinWithdraw = new MemberCoinWithdrawEntity();
@@ -219,15 +219,16 @@
        memberCoinWithdraw.setAddress(member.getAddress());
        memberCoinWithdraw.setAmount(withdrawDto.getAmount());
        memberCoinWithdraw.setFeeAmount(withdrawDto.getFee());
        memberCoinWithdraw.setStatus(MemberCoinWithdrawEntity.STATUS_DOING);
        memberCoinWithdraw.setStatus(MemberCoinWithdrawEntity.STATUS_YES);
        memberCoinWithdraw.setSymbol("USDT");
        memberCoinWithdraw.setFlowId(fundFlow.getId());
        memberCoinWithdrawDao.insert(memberCoinWithdraw);
//        String hash = ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(member.getAddress(), withdrawDto.getAmount());
//        fundFlow.setToHash(hash);
//        dappFundFlowDao.updateById(fundFlow);
        String hash = ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(member.getAddress(), withdrawDto.getAmount());
        fundFlow.setToHash(hash);
        dappFundFlowDao.updateById(fundFlow);
        chainProducer.sendFeeDistributeMsg(fundFlow.getId());
//        Map<String, Object> map = new HashMap<>();
//        map.put("fee", withdrawDto.getFee());
//        map.put("address", ChainEnum.BSC_TFC_FEE.getAddress());
src/main/resources/application-prod.yml
@@ -17,6 +17,7 @@
        base:
          username: db_sdm
          password: sdm123!@#
          # 47.111.90.145
          driver-class-name: com.mysql.cj.jdbc.Driver
          url: jdbc:mysql://127.0.0.1:3306/db_sdm?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8
src/test/java/cc/mrbird/febs/ChainTest.java
@@ -41,9 +41,9 @@
    @Test
    public void chainListener(){
        ChainService.contractEventListener(new BigInteger("20860433"), new BigInteger("20860433"), bscUsdtContractEvent, ChainEnum.BSC_USDT.name());
        ChainService.contractEventListener(new BigInteger("22934633"), new BigInteger("22934633"), bscUsdtContractEvent, ChainEnum.BSC_USDT.name());
        ChainService.contractEventListener(new BigInteger("20860178"), new BigInteger("20860178"), bscCoinContractEvent, ChainEnum.BSC_TFC.name());
//        ChainService.contractEventListener(new BigInteger("20860178"), new BigInteger("20860178"), bscCoinContractEvent, ChainEnum.BSC_TFC.name());
    }
@@ -53,11 +53,11 @@
        ChainService.wssContractEventListener(new BigInteger("22819014"), bscUsdtContractEvent, ChainEnum.BSC_USDT.name());
    }
    @Autowired
    private ProfitDailyJob profitDailyJob;
    @Test
    public void profitTest() {
        profitDailyJob.profitDailyJob();
    }
//    @Autowired
//    private ProfitDailyJob profitDailyJob;
//
//    @Test
//    public void profitTest() {
//        profitDailyJob.profitDailyJob();
//    }
}