|
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @ClassName : MatrixService
|
|
@@ -37,6 +38,9 @@ public class MatrixService {
|
|
|
Map<String, Map<String, Windturbinetestingpointnew>> wtPointmap = CacheContext.wtPointmap;
|
|
|
|
|
|
List<Windpowerstation> wpls = CacheContext.wpls;
|
|
|
+ Windpowerstation windpowerstation = new Windpowerstation();
|
|
|
+ windpowerstation.setId("0");
|
|
|
+ wpls.add(windpowerstation);
|
|
|
wpls.parallelStream().forEach(wp-> {
|
|
|
List<String> pointList = new ArrayList<>();
|
|
|
Map<String,String> pointMap = new HashMap<>();
|
|
@@ -46,14 +50,21 @@ public class MatrixService {
|
|
|
Windpowerstationpointnew windpowerstationtestingpoint = stringWindpowerstationtestingpointMap.get(uniformcode);
|
|
|
if (!windpowerstationtestingpoint.getCode().trim().equals("INITIAL")){
|
|
|
pointList.add(windpowerstationtestingpoint.getCode());
|
|
|
- pointMap.put(windpowerstationtestingpoint.getCode(),wp.getId()+"_"+uniformcode);
|
|
|
}
|
|
|
+ pointMap.put(windpowerstationtestingpoint.getCode(),wp.getId()+"_"+uniformcode);
|
|
|
});
|
|
|
try {
|
|
|
List<PointData> realData = edosUtil.getRealData(pointList);
|
|
|
realData.parallelStream().forEach(i -> {
|
|
|
wpMap.put(pointMap.get(i.getEdnaId()), i.getPointValueInDouble());
|
|
|
});
|
|
|
+ List<String> pointids = realData.stream().map(i -> i.getEdnaId()).collect(Collectors.toList());
|
|
|
+ Set<String> totalpointids = pointMap.keySet();
|
|
|
+ Collection notexists=new ArrayList<String>(totalpointids);
|
|
|
+ notexists.removeAll(pointids);
|
|
|
+ notexists.stream().forEach(n->{
|
|
|
+ wpMap.put(pointMap.get(n),0.0);
|
|
|
+ });
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|