| | |
| | | |
| | | // 发送转账消息 |
| | | chainProducer.sendOnlineTransfer(JSONObject.toJSONString(map)); |
| | | |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_SYSTEM_START_TARGET); |
| | | BigDecimal target = new BigDecimal(dic.getValue()); |
| | | |
| | | // 若源池中的USDT达到或超过8万U,则启动整个系统 |
| | | BigDecimal balance = sourceUsdtInstance.balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress()); |
| | | if (target.compareTo(balance) < 1) { |
| | | redisUtils.set(AppContants.SYSTEM_START_FLAG, "start"); |
| | | |
| | | // 启动系统 |
| | | dappSystemService.startSystem(); |
| | | } |
| | | } else { |
| | | OnlineTransferUtil.addTransfer(e.from, fundFlow.getAmount(), 1, 1, ChainEnum.BSC_TFC_SOURCE.name(), AppContants.SYMBOL_COIN, fundFlow.getId().toString()); |
| | | |
| | |
| | | dappFundFlowDao.updateById(fundFlow); |
| | | } |
| | | } |
| | | |
| | | // 判断系统是否启动,如满足条件则启动系统 |
| | | String hasStart = redisUtils.getString(AppContants.SYSTEM_START_FLAG); |
| | | if (!"start".equals(hasStart)) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.DIC_TYPE_SYSTEM_SETTING, AppContants.DIC_VALUE_SYSTEM_START_TARGET); |
| | | BigDecimal target = new BigDecimal(dic.getValue()); |
| | | |
| | | // 若源池中的USDT达到或超过8万U,则启动整个系统 |
| | | BigDecimal balance = ChainService.getInstance(ChainEnum.BSC_USDT_SOURCE.name()).balanceOf(ChainEnum.BSC_USDT_SOURCE.getAddress()); |
| | | if (target.compareTo(balance) < 1) { |
| | | redisUtils.set(AppContants.SYSTEM_START_FLAG, "start"); |
| | | |
| | | // 启动系统 |
| | | startSystem(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |