|
@@ -5,15 +5,15 @@ import com.gyee.power.fitting.common.spring.InitialRunner;
|
|
|
import com.gyee.power.fitting.common.util.FileUtil;
|
|
|
import com.gyee.power.fitting.model.Modelpowerdetails;
|
|
|
import com.gyee.power.fitting.model.Powerfittinganalysis;
|
|
|
-import com.gyee.power.fitting.model.custom.PowerPointData;
|
|
|
+import com.gyee.power.fitting.model.anno.AnnotationTool;
|
|
|
+import com.gyee.power.fitting.model.anno.FixedVo;
|
|
|
+import com.gyee.power.fitting.model.custom.*;
|
|
|
import com.gyee.power.fitting.service.PowerfittinganalysisService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@Service
|
|
@@ -43,8 +43,8 @@ public class PowerTemperatureService {
|
|
|
Map<String, Object> mp = new HashMap<>();
|
|
|
mp.put("wt", obj.getWindturbine());
|
|
|
mp.put("power", InitialRunner.equipmentMap.get(InitialRunner.wtMap.get(obj.getWindturbine()).getModelid()));
|
|
|
- mp.put("res1", res);
|
|
|
- mp.put("res2", rp);
|
|
|
+ mp.put("res1", res); //额定功率vs.温度分析
|
|
|
+ mp.put("res2", rp); //额定功率vs.温度分析
|
|
|
result.add(mp);
|
|
|
}
|
|
|
|
|
@@ -52,6 +52,55 @@ public class PowerTemperatureService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public Object curveAnalysis(String id) {
|
|
|
+ Powerfittinganalysis obj = powerService.selectItemById(id);
|
|
|
+ if (obj == null)
|
|
|
+ return null;
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+
|
|
|
+ //实际功率
|
|
|
+ List<Object> sjglList = new ArrayList<>();
|
|
|
+ List<String> ls = FileUtil.readFile(obj.getPath(), true);
|
|
|
+ for (int i = 1; i < ls.size(); i++){
|
|
|
+ PowerFittingData data = new PowerFittingData(ls.get(i).split(","));
|
|
|
+ sjglList.add(new double[]{Double.valueOf(data.getSpeed()), data.getNhdata()});
|
|
|
+ }
|
|
|
+
|
|
|
+ //保证功率
|
|
|
+ List<Modelpowerdetails> modelPower = InitialRunner.modelPowerDetailMap.get(InitialRunner.wtMap.get(obj.getWindturbine()).getModelid());
|
|
|
+ List<Object> bzglList = modelPower.stream().sorted(Comparator.comparing(Modelpowerdetails::getSpeed)).map(m -> new double[]{m.getSpeed(), m.getEnsurepower()}).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //散点
|
|
|
+ List<Object[]> scatter = new ArrayList<>();
|
|
|
+
|
|
|
+ //散点ID
|
|
|
+ String[] ids = obj.getProcessid().split(",");
|
|
|
+ for (String pid : ids) {
|
|
|
+ Powerfittinganalysis pf = powerService.selectItemById(pid);
|
|
|
+ List<String> lp = FileUtil.readFile(pf.getPath(), true); //数据解析
|
|
|
+ for (int i = 1; i < lp.size(); i++){
|
|
|
+ String[] split = lp.get(i).split(",");
|
|
|
+ PowerPointData pd = new PowerPointData(split, true);
|
|
|
+ if (pd.getSpeed() < 0 || pd.getPower() < 0)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ Object[] temp = new Object[3];
|
|
|
+ temp[0] = pd.getSpeed();
|
|
|
+ temp[1] = pd.getPower();
|
|
|
+ temp[2] = pd.getHjwd();
|
|
|
+ scatter.add(temp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("sjgl", sjglList); //实际功率
|
|
|
+ map.put("llgl", bzglList); //保证功率
|
|
|
+ map.put("scatter", scatter); //散点
|
|
|
+ map.put("obj", obj); //对象
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* csv 文件解析成对象
|
|
@@ -80,4 +129,37 @@ public class PowerTemperatureService {
|
|
|
map.put("maxT", maxT);
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组装表格数据
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> temperatureDataShow(String id) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+
|
|
|
+ /** 添加标题 **/
|
|
|
+ List<FixedVo> fxList = AnnotationTool.getFixedVoList(PowerTemperatureData.class);
|
|
|
+ List<TableTitle> lt = fxList.stream().filter(f -> f.getRemark().equals("1"))
|
|
|
+ .map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ /** 添加内容 **/
|
|
|
+ List<PowerPointData> list = new ArrayList<>();
|
|
|
+ Powerfittinganalysis obj = powerService.selectItemById(id);
|
|
|
+ if (obj == null)
|
|
|
+ return map;
|
|
|
+ String[] ids = obj.getProcessid().split(",");
|
|
|
+ Powerfittinganalysis item = powerService.selectItemById(ids[0]);
|
|
|
+ List<String> ls = FileUtil.readFile(item.getPath(), false);
|
|
|
+ for (int i = 1; i < ls.size(); i++){
|
|
|
+ PowerPointData data = new PowerPointData(ls.get(i).split(","), false);
|
|
|
+ list.add(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("title", lt);
|
|
|
+ map.put("data", list);
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|