|
@@ -3,6 +3,7 @@ package com.gyee.runeconomy.service.auto.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.runeconomy.config.GyeeConfig;
|
|
|
import com.gyee.runeconomy.dto.AlarmDataParser;
|
|
|
import com.gyee.runeconomy.dto.FiveLoss.AnnotationTool;
|
|
@@ -50,6 +51,8 @@ import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.gyee.runeconomy.init.CacheContext.wtpAimap;
|
|
|
+
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class NewDataFittingService {
|
|
@@ -97,16 +100,35 @@ public class NewDataFittingService {
|
|
|
// deleteDir(config.getFilePathPrepare());
|
|
|
for (int k = 0; k < wtIds.size(); k++) {
|
|
|
String wt = wtIds.get(k);
|
|
|
+ List<ProBasicEquipment> wtt = CacheContext.wtls.stream().filter(w -> w.getId().equals(wt)).collect(Collectors.toList());
|
|
|
List<List<TsDoubleData>> result = new ArrayList<>();
|
|
|
|
|
|
try {
|
|
|
List<String> points = config.getPoints();
|
|
|
+ String replacement = wtt.get(0).getProjectId().equals("NX_FGS_HAF01_EG") ? "JKZT" : "FJZT";
|
|
|
+
|
|
|
+ for (int i = 0; i < points.size(); i++) {
|
|
|
+ if (points.get(i).equals("MXZT")) {
|
|
|
+ points.set(i, replacement);
|
|
|
+ }
|
|
|
+ }
|
|
|
// Map<String, List<ProBasicEquipmentPoint>> collect = CacheContext.pointNewMap.get(wt).stream().collect(Collectors.groupingBy(w -> w.getUniformCode()));
|
|
|
- Map<String, List<ProBasicEquipmentPoint>> collect = CacheContext.pointNewMap.get(wt).stream().collect(Collectors.groupingBy(w -> w.getUniformCode()));
|
|
|
- if (collect.size() < 8)
|
|
|
+ Map<String, List<ProBasicEquipmentPoint>> collect = CacheContext.pointNewMap
|
|
|
+ .get(wt).stream().collect(Collectors.groupingBy(w -> w.getUniformCode()));
|
|
|
+ Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt);
|
|
|
+
|
|
|
+ Map<String, List<ProBasicEquipmentPoint>> collect1 = points.stream()
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ point -> point,
|
|
|
+ point -> Optional.ofNullable(equipmentPointMap.get(point))
|
|
|
+ .map(Collections::singletonList)
|
|
|
+ .orElse(new ArrayList<>())
|
|
|
+ ));
|
|
|
+
|
|
|
+ if (collect1.size() < 8)
|
|
|
continue;
|
|
|
for (int i = 0; i < points.size(); i++) {
|
|
|
- ProBasicEquipmentPoint point = collect.get(points.get(i)).get(0);
|
|
|
+ ProBasicEquipmentPoint point = collect1.get(points.get(i)).get(0);
|
|
|
if (point == null) continue;
|
|
|
log.info("测点:" + point.getId() + "----" + point.getName());
|
|
|
List<TsDoubleData> data = remoteService.adapterfd().getHistorySnap(point.getNemCode(), st, et, interval);
|
|
@@ -114,6 +136,19 @@ public class NewDataFittingService {
|
|
|
// List<PointData> data = edosUtil.getHistoryDatasSnap(point.getNemCode(), vo.getSt(), vo.getEt(), vo.getInterval());
|
|
|
if (data == null || data.size() == 0)
|
|
|
break;
|
|
|
+ if (point.getUniformCode().equals("JKZT")){
|
|
|
+ data.forEach(d -> {
|
|
|
+ if (d.getDoubleValue()==0){
|
|
|
+ d.setDoubleValue(2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else if (point.getUniformCode().equals("FJZT")){
|
|
|
+ data.forEach(d -> {
|
|
|
+ if (d.getDoubleValue()==5){
|
|
|
+ d.setDoubleValue(2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
result.add(data);
|
|
|
TimeUnit.MILLISECONDS.sleep(200);
|
|
|
}
|