|
@@ -64,15 +64,20 @@ public class ApiAllServiceImpl implements IApiAllService {
|
|
public CurrYieldVO currYield() {
|
|
public CurrYieldVO currYield() {
|
|
CurrYieldVO vo = new CurrYieldVO();
|
|
CurrYieldVO vo = new CurrYieldVO();
|
|
vo.mock();
|
|
vo.mock();
|
|
- IndexData indexData = redisCache.getCacheObject(CacheConstants.INDEX_CALC);
|
|
|
|
- vo.getJb().setOpenRatio(BigDecimal.valueOf(indexData.getDevice().getRunningRatio()).setScale(0, RoundingMode.HALF_UP));
|
|
|
|
- IndexData indexData1 = redisCache.getCacheObject(CacheConstants.INDEX_ALARM);
|
|
|
|
- vo.getJb().setYield(BigDecimal.valueOf(indexData.getEfficiency().getTotalLength()).setScale(0, RoundingMode.HALF_UP));
|
|
|
|
|
|
+ IndexData todayData = redisCache.getCacheObject(CacheConstants.INDEX_CALC);
|
|
|
|
+ IndexData currData = redisCache.getCacheObject(CacheConstants.INDEX_ALARM);
|
|
|
|
+ vo.getJb().setYield(BigDecimal.valueOf(todayData.getEfficiency().getTotalLength()).setScale(0, RoundingMode.HALF_UP));
|
|
vo.getJb().setYieldMax(BigDecimal.valueOf(50000));
|
|
vo.getJb().setYieldMax(BigDecimal.valueOf(50000));
|
|
- BigDecimal jdl = BigDecimal.valueOf(indexData.getEfficiency().getAEfficiency() + indexData.getEfficiency().getBEfficiency()).divide(BigDecimal.valueOf(2), 0, RoundingMode.HALF_UP);
|
|
|
|
|
|
+ BigDecimal jdl = BigDecimal.valueOf(todayData.getEfficiency().getAEfficiency() + todayData.getEfficiency().getBEfficiency()).divide(BigDecimal.valueOf(2), 0, RoundingMode.HALF_UP);
|
|
|
|
+ if (todayData.getEfficiency().getBEfficiency() == 0f) {
|
|
|
|
+ jdl = BigDecimal.valueOf(todayData.getEfficiency().getAEfficiency()).setScale(0, RoundingMode.HALF_UP);
|
|
|
|
+ }
|
|
vo.getJb().setJdl(jdl);
|
|
vo.getJb().setJdl(jdl);
|
|
- vo.getJb().setOpenNum(indexData1.getDevice().getOnline());
|
|
|
|
- vo.getJb().setTotalNum(indexData1.getDevice().getTotal());
|
|
|
|
|
|
+// vo.getJb().setOpen(currData.getDevice().getOnline(),currData.getDevice().getTotal());
|
|
|
|
+ vo.getJb().setOpenNum(currData.getDevice().getOnline());
|
|
|
|
+ vo.getJb().setTotalNum(currData.getDevice().getTotal());
|
|
|
|
+
|
|
|
|
+ vo.getJb().setOpenRatio(BigDecimal.valueOf(currData.getDevice().getRunningRatio()).setScale(0, RoundingMode.HALF_UP));
|
|
redisCache.setCacheObject(CacheConstants.CURR_YIELD, vo);
|
|
redisCache.setCacheObject(CacheConstants.CURR_YIELD, vo);
|
|
return redisCache.getCacheObject(CacheConstants.CURR_YIELD);
|
|
return redisCache.getCacheObject(CacheConstants.CURR_YIELD);
|
|
}
|
|
}
|