KKSU
2024-04-17 829f629756e5402bcd3e9f6ef1f9c6dbffbabb11
src/main/java/com/xcong/excoin/quartz/job/XchBaseDataUpdateJob.java
@@ -37,24 +37,24 @@
    private XchProfitService xchProfitService;
//        @Scheduled(cron = "0/1 * * * * ? ")
    @Scheduled(cron = "0 0/10 * * * ? ")
    public void baseDataUpdate() {
        log.info("基础数据更新任务");
        // 请求价格等数据 "https://api2.chiaexplorer.com/blockchainSummary"
        String result = pyExec();
        JSONObject xchPrice24HObj = (JSONObject) JSONObject.parse(result);
        List<YdBasicSettingEntity> list = ydBasicSettingDao.selectList(null);
        if (CollUtil.isNotEmpty(list)) {
            YdBasicSettingEntity settingEntity = list.get(0);
            List<String> xchPrice24H = JSONObject.parseArray(xchPrice24HObj.getString("data"), String.class);
            BigDecimal newestPrice = new BigDecimal(xchPrice24H.get(xchPrice24H.size() - 1));
            redisUtils.set("XCH_NEW_PRICE", newestPrice);
            settingEntity.setCurrentPrice(newestPrice);
            ydBasicSettingDao.updateById(settingEntity);
        }
    }
//    @Scheduled(cron = "0 0/10 * * * ? ")
//    public void baseDataUpdate() {
//        log.info("基础数据更新任务");
//        // 请求价格等数据 "https://api2.chiaexplorer.com/blockchainSummary"
//        String result = pyExec();
//        JSONObject xchPrice24HObj = (JSONObject) JSONObject.parse(result);
//        List<YdBasicSettingEntity> list = ydBasicSettingDao.selectList(null);
//        if (CollUtil.isNotEmpty(list)) {
//            YdBasicSettingEntity settingEntity = list.get(0);
//            List<String> xchPrice24H = JSONObject.parseArray(xchPrice24HObj.getString("data"), String.class);
//
//            BigDecimal newestPrice = new BigDecimal(xchPrice24H.get(xchPrice24H.size() - 1));
//
//            redisUtils.set("XCH_NEW_PRICE", newestPrice);
//            settingEntity.setCurrentPrice(newestPrice);
//            ydBasicSettingDao.updateById(settingEntity);
//        }
//    }
    private String getUrlResponse(String url) {
        BufferedReader reader = null;