| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.modules.yunding.dao.YdBasicSettingDao; |
| | | import com.xcong.excoin.modules.yunding.entity.YdBasicSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.service.XchProfitService; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | |
| | | |
| | | @Autowired |
| | | private YdBasicSettingDao ydBasicSettingDao; |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | @Autowired |
| | | private XchProfitService xchProfitService; |
| | | |
| | | @Scheduled(cron = "* */1 * * * ? ") |
| | | public void baseDataUpdate() { |
| | |
| | | BigDecimal netspace = new BigDecimal(netspaceStr).divide(baseUnit.multiply(baseUnit.multiply(baseUnit.multiply(baseUnit.multiply(baseUnit)))), 2, BigDecimal.ROUND_DOWN); |
| | | settingEntity.setAllPower(netspace); |
| | | |
| | | settingEntity.setCurrentPrice(new BigDecimal(jsonObject.getString("price"))); |
| | | BigDecimal newPrice = new BigDecimal(jsonObject.getString("price")); |
| | | redisUtils.set("XCH_NEW_PRICE", newPrice); |
| | | settingEntity.setCurrentPrice(newPrice); |
| | | List<String> data = JSONObject.parseArray(perTObject.getString("data"), String.class); |
| | | settingEntity.setPrifitT(new BigDecimal(data.get(0))); |
| | | settingEntity.setProfitDay(new BigDecimal(data.get(0)).multiply(BigDecimal.valueOf(1024))); |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | // @Scheduled(cron = "0 0 23 * * ?") |
| | | public void xchProfitJob() { |
| | | log.info("XCH收益返利任务"); |
| | | // xchProfitService.xchProfitDistributor(); |
| | | } |
| | | |
| | | // @Scheduled(cron = "0 0 22 * * ?") |
| | | public void usdtProfitJob() { |
| | | log.info("USDT返利任务"); |
| | | xchProfitService.agentUsdtProfitDistributor(); |
| | | } |
| | | } |