|
@@ -118,7 +118,7 @@ public class FiveLossService {
|
|
|
public void fiveLossCal() {
|
|
|
log.info("======风机绩效榜计算开始.............");
|
|
|
Map<String, Windturbine> wtmap = InitialRunner.wtMap;
|
|
|
- Map<String, List<Powermodel>> modelmap = InitialRunner.zsllglMap;
|
|
|
+ Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglMap;
|
|
|
|
|
|
List<Powerfittinganalysis> analyses = analysisService.selectListByIsCal(Constants.DATA_PREPARE, 0);
|
|
|
if (analyses.size() == 0){
|
|
@@ -149,17 +149,17 @@ public class FiveLossService {
|
|
|
double xnssdl = 0;//性能损失电量
|
|
|
|
|
|
List<PowerPointData> pdl = ls.stream().map(mp -> new PowerPointData(mp.split(","), false)).collect(Collectors.toList());
|
|
|
- double zcfd = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 2); //正常发电
|
|
|
- xdssdl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 5); //限电损失电量
|
|
|
- double qxjcl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 3); //缺陷降出力损失电量
|
|
|
- double xdjcl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 4); //限电降出力损失电量
|
|
|
- double cnsltj = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 7); //场内受累停机损失电量
|
|
|
- double cnsljx = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 9); //场内受累检修损失电量
|
|
|
- double dwsl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 10); //电网受累损失电量
|
|
|
- double hjsl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 11); //环境受累损失电量
|
|
|
-
|
|
|
- gzssdl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 6);
|
|
|
- jhjxssdl = generalLoss(pdl, modelmap.get(p.getWindturbine()), p.getInterp(), 8);
|
|
|
+ double zcfd = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 2); //正常发电
|
|
|
+ xdssdl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 5); //限电损失电量
|
|
|
+ double qxjcl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 3); //缺陷降出力损失电量
|
|
|
+ double xdjcl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 4); //限电降出力损失电量
|
|
|
+ double cnsltj = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 7); //场内受累停机损失电量
|
|
|
+ double cnsljx = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 9); //场内受累检修损失电量
|
|
|
+ double dwsl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 10); //电网受累损失电量
|
|
|
+ double hjsl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 11); //环境受累损失电量
|
|
|
+
|
|
|
+ gzssdl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 6);
|
|
|
+ jhjxssdl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 8);
|
|
|
fjhjxssdl = gzssdl;
|
|
|
xdssdl = xdssdl + xdjcl;
|
|
|
slssdl = cnsltj + dwsl + hjsl + cnsljx + cnsljx;
|
|
@@ -205,31 +205,32 @@ public class FiveLossService {
|
|
|
* @param status 风机当前状态
|
|
|
* @return
|
|
|
*/
|
|
|
- private double generalLoss(List<PowerPointData> ztmxData, List<Powermodel> zsglData, int interval, double status) {
|
|
|
+ private double generalLoss(List<PowerPointData> ztmxData, Map<Double, Double> zsglData, int interval, double status) {
|
|
|
double ssdl = 0.0;
|
|
|
List<PowerPointData> pointData = ztmxData.stream().filter(zt -> zt.getMxzt() == status).collect(Collectors.toList());
|
|
|
- List<Powermodel> theoryData = zsglData.stream().filter(f -> f.getPower() > 0.0).collect(Collectors.toList());
|
|
|
- if (status == 0.0 || status == 2.0 || status == 3.0 || status == 4.0 || status == 9.0 || status == 11.0) {
|
|
|
+ if (status == 0.0 || status == 2.0 || status == 3.0 || status == 4.0 || status == 9.0 || status == 10.0 || status == 11.0) {
|
|
|
for (PowerPointData obj : pointData) {
|
|
|
- for (int i = 0; i < theoryData.size(); i++) {
|
|
|
- if (String.format("%.2f", obj.getSpeed()).equals(String.format("%.2f", theoryData.get(i).getSpeed()))) {
|
|
|
- double zsgl = theoryData.get(i).getPower();
|
|
|
- double power = obj.getPower();
|
|
|
- double temp = (zsgl - power) > 0 ? zsgl - power : 0;
|
|
|
- ssdl = ssdl + (temp / 60) * (interval / 60);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ double speed = new BigDecimal(obj.getSpeed()).setScale(2, RoundingMode.FLOOR).doubleValue();
|
|
|
+ double zsgl = zsglData.get(speed);
|
|
|
+ double power = obj.getPower();
|
|
|
+ double temp = (zsgl - power) > 0 ? zsgl - power : 0;
|
|
|
+ ssdl = ssdl + (temp / 60) * (interval / 60);
|
|
|
}
|
|
|
} else {
|
|
|
for (PowerPointData obj : pointData) {
|
|
|
- for (int i = 0; i < theoryData.size(); i++) {
|
|
|
- if (String.format("%.2f", obj.getSpeed()).equals(String.format("%.2f", theoryData.get(i).getSpeed()))) {
|
|
|
- double zsgl = theoryData.get(i).getPower();
|
|
|
- ssdl = ssdl + (zsgl / 60) * (interval / 60);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (obj.getSpeed() < 3.0) continue;
|
|
|
+ double speed = new BigDecimal(obj.getSpeed()).setScale(2, RoundingMode.FLOOR).doubleValue();
|
|
|
+ double zsgl = zsglData.get(speed);
|
|
|
+ ssdl = ssdl + (zsgl / 60) * (interval / 60);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //理论发电量 status < 0
|
|
|
+ if (status < 0){
|
|
|
+ for (PowerPointData obj : ztmxData) {
|
|
|
+ if (obj.getSpeed() < 3.0) continue;
|
|
|
+ double speed = new BigDecimal(obj.getSpeed()).setScale(2, RoundingMode.FLOOR).doubleValue();
|
|
|
+ double zsgl = zsglData.get(speed);
|
|
|
+ ssdl = ssdl + (zsgl / 60) * (interval / 60);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -348,25 +349,25 @@ public class FiveLossService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 使用文件计算五损数据
|
|
|
+ * 使用文件,通过自诉案功率计算五损数据
|
|
|
* @param ids 准备的数据ID
|
|
|
*/
|
|
|
- public Map<String, Object> fiveLossCal(String ids) {
|
|
|
+ public Map<String, Object> fiveLossCalByZSGL(String ids) {
|
|
|
log.info("======风机绩效榜计算开始.............");
|
|
|
Map<String, Object> promise = new HashMap<>();
|
|
|
List<FjjxbVo> result = new ArrayList<>();
|
|
|
- Map<String, List<Powermodel>> zsglmap = InitialRunner.zsllglMap;
|
|
|
+ Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglMap;
|
|
|
|
|
|
List<Powerfittinganalysis> analyses = analysisService.selectListByIds(ids);
|
|
|
- if (analyses.size() == 0 || zsglmap.size() == 0){
|
|
|
- log.info("======风机榜效帮计算结束,自算理论功率数据为空.............");
|
|
|
+ if (analyses.size() == 0){
|
|
|
+ log.info("======风机榜效帮计算结束,数据为空.............");
|
|
|
throw new CustomException(ResultCode.ERROR);
|
|
|
}
|
|
|
|
|
|
for (Powerfittinganalysis p : analyses) {
|
|
|
List<String> content = FileUtil.readFile(p.getPath(), true);
|
|
|
- if (content.size() == 0){
|
|
|
- log.info("======风机榜效帮计算结束,文件内容为空.............");
|
|
|
+ if (content.size() == 0 || zsglmap.size() == 0 || zsglmap.get(p.getWindturbine()) == null){
|
|
|
+ log.info("======风机榜效帮计算结束," + p.getWindturbine() + "文件内容或当前风机的自算功率为空.............");
|
|
|
continue;
|
|
|
}
|
|
|
log.info("======风机绩效榜计算:" + p.getWindturbine());
|
|
@@ -409,18 +410,19 @@ public class FiveLossService {
|
|
|
FjjxbVo vo = new FjjxbVo();
|
|
|
vo.setId(p.getWindturbine());
|
|
|
vo.setName(p.getWindturbine());
|
|
|
- vo.setLlfdl(llfdl);
|
|
|
- vo.setSjfdl(rfdl);
|
|
|
- vo.setJhjx(jhjxssdl);
|
|
|
- vo.setFjhjx(fjhjxssdl);
|
|
|
- vo.setXd(xdssdl);
|
|
|
- vo.setXn(xnssdl);
|
|
|
- vo.setSl(slssdl);
|
|
|
- vo.setSpeed(new BigDecimal(speed/content.size()).setScale(2, RoundingMode.CEILING).doubleValue());
|
|
|
- vo.setFnlly(llfdl > 0 ? new BigDecimal(rfdl / llfdl).setScale(2, RoundingMode.CEILING).doubleValue() : 0);
|
|
|
+ vo.setLlfdl(new BigDecimal(llfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setSjfdl(new BigDecimal(rfdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setJhjx(new BigDecimal(jhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setFjhjx(new BigDecimal(fjhjxssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setXd(new BigDecimal(xdssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setXn(new BigDecimal(xnssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setSl(new BigDecimal(slssdl).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setSpeed(new BigDecimal(speed/content.size()).setScale(2, RoundingMode.FLOOR).doubleValue());
|
|
|
+ vo.setFnlly(llfdl > 0 ? new BigDecimal(rfdl / llfdl).setScale(2, RoundingMode.FLOOR).doubleValue() : 0);
|
|
|
result.add(vo);
|
|
|
}
|
|
|
log.info("======风机榜效帮计算结束.............");
|
|
|
+ result.stream().sorted(Comparator.comparing(FjjxbVo::getId));
|
|
|
/** 添加标题 **/
|
|
|
List<FixedVo> fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
|
|
|
List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
|
|
@@ -429,4 +431,5 @@ public class FiveLossService {
|
|
|
|
|
|
return promise;
|
|
|
}
|
|
|
+
|
|
|
}
|