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