update mona,grs,nexa,rxd 矿机收益定时任务修改
This commit is contained in:
@@ -99,14 +99,15 @@ public class IncomeTask {
|
||||
BigDecimal totalPower = nexaMinerIncomes.stream()
|
||||
.map(MinerIncomeDto::getAvgPower)
|
||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
||||
//3.获取当前nexa币价
|
||||
String price = redisService.getCacheObject(RedisKey.NEXA_PRICE);
|
||||
BigDecimal nexaPrice;
|
||||
if (price == null){
|
||||
nexaPrice = poolMapper.selectPrice("nexa");
|
||||
}else{
|
||||
nexaPrice = new BigDecimal(price);
|
||||
}
|
||||
//3.获取当前nexa币价(这个key是在6379 redis实例的 6 号数据库中,但是默认配置是0号库获取的币价一定为null)
|
||||
//String price = redisService.getCacheObject(RedisKey.NEXA_PRICE);
|
||||
//BigDecimal nexaPrice ;
|
||||
//if (price == null){
|
||||
// nexaPrice = poolMapper.selectPrice("nexa");
|
||||
//}else{
|
||||
// nexaPrice = new BigDecimal(price);
|
||||
//}
|
||||
BigDecimal nexaPrice = poolMapper.selectPrice("nexa");
|
||||
//4.获取nexa 1-2小时前的报块数
|
||||
BigDecimal nexaBlocks = incomeMapper.getVaildBlcoks("nexa", start, end);
|
||||
|
||||
@@ -140,13 +141,15 @@ public class IncomeTask {
|
||||
.map(MinerIncomeDto::getAvgPower)
|
||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
||||
//3.获取当前rxd币价
|
||||
String price = redisService.getCacheObject(RedisKey.RXD_PRICE);
|
||||
BigDecimal rxdPrice;
|
||||
if (price == null){
|
||||
rxdPrice = poolMapper.selectPrice("rxd");
|
||||
}else{
|
||||
rxdPrice = new BigDecimal(price);
|
||||
}
|
||||
//String price = redisService.getCacheObject(RedisKey.RXD_PRICE);
|
||||
//BigDecimal rxdPrice;
|
||||
//if (price == null){
|
||||
// rxdPrice = poolMapper.selectPrice("rxd");
|
||||
//}else{
|
||||
// rxdPrice = new BigDecimal(price);
|
||||
//}
|
||||
|
||||
BigDecimal rxdPrice = poolMapper.selectPrice("rxd");
|
||||
//4.获取rxd 1-2小时前的报块数
|
||||
BigDecimal rxdBlocks = incomeMapper.getVaildBlcoks("rxd", start, end);
|
||||
|
||||
@@ -180,13 +183,14 @@ public class IncomeTask {
|
||||
.map(MinerIncomeDto::getAvgPower)
|
||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
||||
//3.获取当前mona币价
|
||||
String price = redisService.getCacheObject(RedisKey.MONA_PRICE);
|
||||
BigDecimal monaPrice;
|
||||
if (price == null){
|
||||
monaPrice = poolMapper.selectPrice("mona");
|
||||
}else{
|
||||
monaPrice = new BigDecimal(price);
|
||||
}
|
||||
//String price = redisService.getCacheObject(RedisKey.MONA_PRICE);
|
||||
//BigDecimal monaPrice;
|
||||
//if (price == null){
|
||||
// monaPrice = poolMapper.selectPrice("mona");
|
||||
//}else{
|
||||
// monaPrice = new BigDecimal(price);
|
||||
//}
|
||||
BigDecimal monaPrice = poolMapper.selectPrice("mona");
|
||||
//4.获取mona 1-2小时前的报块数
|
||||
BigDecimal monaBlocks = incomeMapper.getVaildBlcoks("rxd", start, end);
|
||||
|
||||
@@ -220,13 +224,14 @@ public class IncomeTask {
|
||||
.map(MinerIncomeDto::getAvgPower)
|
||||
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
|
||||
//3.获取当前grs币价
|
||||
String price = redisService.getCacheObject(RedisKey.GRS_PRICE);
|
||||
BigDecimal grsPrice ;
|
||||
if (price == null){
|
||||
grsPrice = poolMapper.selectPrice("grs");
|
||||
}else{
|
||||
grsPrice = new BigDecimal(price);
|
||||
}
|
||||
//String price = redisService.getCacheObject(RedisKey.GRS_PRICE);
|
||||
//BigDecimal grsPrice ;
|
||||
//if (price == null){
|
||||
// grsPrice = poolMapper.selectPrice("grs");
|
||||
//}else{
|
||||
// grsPrice = new BigDecimal(price);
|
||||
//}
|
||||
BigDecimal grsPrice = poolMapper.selectPrice("grs");
|
||||
//4.获取rxd 1-2小时前的报块数
|
||||
BigDecimal grsBlocks = incomeMapper.getVaildBlcoks("grs", start, end);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user