|
@@ -1,8 +1,10 @@
|
|
|
package com.ruoyi.ems.service.impl;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.ruoyi.ems.domain.vo.QueryIndex;
|
|
|
+import com.ruoyi.ems.util.PowerUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.ems.mapper.ElecLoadIndex15minMapper;
|
|
@@ -34,17 +36,38 @@ public class ElecLoadIndexServiceImpl implements IElecLoadIndexService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ElecLoadIndex> selectMin15IndexList(QueryIndex queryIndex) {
|
|
|
- return index15minMapper.selectIndexList(queryIndex);
|
|
|
+ List<ElecLoadIndex> indexList = index15minMapper.selectIndexList(queryIndex);
|
|
|
+
|
|
|
+ for (ElecLoadIndex index : indexList) {
|
|
|
+ index.setS(PowerUtils.getSPower(index.getP(), index.getQ()));
|
|
|
+ index.setPf(PowerUtils.getPF(index.getP(), index.getS()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return indexList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Double selectMin15IndexMaxLoad(QueryIndex queryIndex) {
|
|
|
- return index15minMapper.selectIndexMaxLoad(queryIndex);
|
|
|
+ public ElecLoadIndex selectMin15IndexMaxLoad(QueryIndex queryIndex) {
|
|
|
+ ElecLoadIndex index = index15minMapper.selectIndexMaxLoad(queryIndex);
|
|
|
+
|
|
|
+ if (null != index) {
|
|
|
+ index.setS(PowerUtils.getSPower(index.getP(), index.getQ()));
|
|
|
+ index.setPf(PowerUtils.getPF(index.getP(), index.getS()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return index;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ElecLoadIndex> selectDayIndexMaxLoad(QueryIndex queryIndex) {
|
|
|
- return index15minMapper.selectDayIndexMaxLoad(queryIndex);
|
|
|
+ List<ElecLoadIndex> indexList = index15minMapper.selectDayIndexMaxLoad(queryIndex);
|
|
|
+
|
|
|
+ for (ElecLoadIndex index : indexList) {
|
|
|
+ index.setS(PowerUtils.getSPower(index.getP(), index.getQ()));
|
|
|
+ index.setPf(PowerUtils.getPF(index.getP(), index.getS()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return indexList;
|
|
|
}
|
|
|
|
|
|
/**
|