|
@@ -68,6 +68,7 @@ public class NewDataFittingService {
|
|
|
|
|
|
//1.数据获取
|
|
|
List<String> wtIds = Arrays.asList(vo.getWtIds().split(","));
|
|
|
+ deleteDir(config.getFilePathPrepare());
|
|
|
for (int k = 0; k < wtIds.size(); k++) {
|
|
|
String wt = wtIds.get(k);
|
|
|
List<List<TsDoubleData>> result = new ArrayList<>();
|
|
@@ -93,7 +94,7 @@ public class NewDataFittingService {
|
|
|
// 处理的数据保存在本地
|
|
|
String wtCode = InitialRunner.wtNewMap.get(wt).getId();
|
|
|
String fileName = config.getFilePathPrepare() + vo.getStation() + "_" + wtCode + "_" + System.currentTimeMillis() / 1000 + ".csv";
|
|
|
- deleteDir(config.getFilePathPrepare());
|
|
|
+
|
|
|
boolean flag = FileUtil.writeFile(fileName, content);
|
|
|
|
|
|
if (flag){ // TODO 保存数据库
|
|
@@ -122,6 +123,7 @@ public class NewDataFittingService {
|
|
|
//2.数据筛选
|
|
|
|
|
|
try {
|
|
|
+ deleteDir(config.getFilePathProcess());
|
|
|
for (String key : prepareMap.keySet()){
|
|
|
|
|
|
ProEconPowerFittingAnalySis obj = proEconPowerFittingAnalySisService.getById(key);
|
|
@@ -164,7 +166,7 @@ public class NewDataFittingService {
|
|
|
//3.数据拟合
|
|
|
|
|
|
AtomicReference<ProEconPowerFittingAnalySis> object = new AtomicReference<>();
|
|
|
-
|
|
|
+ deleteDir(config.getFilePathFitting());
|
|
|
if (vo.getMode() == 0){ //单台拟合
|
|
|
for (String processkey : processMap.keySet()){
|
|
|
List<ProEconPowerFittingAnalySis> list = proEconPowerFittingAnalySisService.selectListByIds(processkey);
|
|
@@ -183,14 +185,19 @@ public class NewDataFittingService {
|
|
|
AtomicReference<Double> maxP = new AtomicReference<>(0.0);
|
|
|
List<Double> arraySpeed = new ArrayList<>();
|
|
|
List<Double> arrayPower = new ArrayList<>();
|
|
|
+ StringBuffer ids = new StringBuffer();
|
|
|
for (String processkey : processMap.keySet()){
|
|
|
+ ids.append(processkey).append(",");
|
|
|
+ ProEconPowerFittingAnalySis fittingAnalySis = proEconPowerFittingAnalySisService.getById(processkey);
|
|
|
List<String> line = FileUtil.readFile(processMap.get(processkey), true);
|
|
|
csvParse(line, arraySpeed, arrayPower, vo.getMins(), vo.getMaxs(), vo.getMinp(), vo.getMaxp());
|
|
|
- List<ProBasicModelPower> mp = InitialRunner.modelPowerDetailNewMap.get(InitialRunner.wtNewMap.get(processkey).getModelId());
|
|
|
+ List<ProBasicModelPower> mp = InitialRunner.modelPowerDetailNewMap.get(InitialRunner.wtNewMap.get(fittingAnalySis.getWindturbineId()).getModelId());
|
|
|
Double maxPower = mp.stream().map(ProBasicModelPower::getEnsurePower).max(Comparator.comparing(Double::doubleValue)).get();
|
|
|
if (maxPower > maxP.get()) maxP.set(maxPower);
|
|
|
}
|
|
|
-// object.set(fittingMode(list, maxP.get(), arraySpeed, arrayPower, dimension, mode));
|
|
|
+ List<ProEconPowerFittingAnalySis> list = proEconPowerFittingAnalySisService.selectListByIds(ids.toString());
|
|
|
+
|
|
|
+ object.set(fittingMode(list, maxP.get(), arraySpeed, arrayPower, vo.getDimension(), vo.getMode()));
|
|
|
}
|
|
|
if (vo.getMode() == 2){ //同名拟合(暂时不支持)
|
|
|
//// List<ProEconPowerFittingAnalySis> list = powerService.selectListByIds(ids);
|