发送录波指令、调用录波算法、解析录波数据

This commit is contained in:
caozehui
2025-09-05 15:26:46 +08:00
parent e11107eb8f
commit ecafa996a3
29 changed files with 924 additions and 196 deletions

View File

@@ -22,6 +22,7 @@
A_Value_0 float NULL COMMENT 'A相基波有效值',
B_Value_0 float NULL COMMENT 'B相基波有效值',
C_Value_0 float NULL COMMENT 'B相基波有效值',
Wave_Num tinyint(1) unsigned DEFAULT null COMMENT '录波数据第几组',
PRIMARY KEY (Id)
</when>
<otherwise>
@@ -59,6 +60,7 @@
A_Value_0 json NULL COMMENT 'A相基波有效值',
B_Value_0 json NULL COMMENT 'B相基波有效值',
C_Value_0 json NULL COMMENT 'B相基波有效值',
Wave_Num tinyint(1) unsigned DEFAULT null COMMENT '录波数据第几组',
PRIMARY KEY (Id)
</when>
<otherwise>

View File

@@ -1,5 +1,6 @@
package com.njcn.gather.storage.pojo.po;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -23,7 +24,12 @@ public class ContrastBaseResult extends BaseResult {
private String stdDevMonitorId;
/**
* 0表示被检设备数据1表示标准设备数据
* 0表示被检设备数据1表示标准设备数据
*/
private Integer flag;
/**
* 录波数据第几组
*/
private Integer waveNum;
}

View File

@@ -12,10 +12,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -157,7 +154,13 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
for (String id : ids) {
wrapper1.like(ContrastNonHarmonicResult::getDevMonitorId, id);
}
noHarm.addAll(contrastNonHarmonicService.list(wrapper1));
List<ContrastNonHarmonicResult> nonHarmonicResultList = contrastNonHarmonicService.list(wrapper1);
Map<String, List<ContrastNonHarmonicResult>> chnMap1 = nonHarmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getDevMonitorId().split("_")[1], Collectors.toList()));
chnMap1.forEach((chn, vList) -> {
ContrastNonHarmonicResult contrastNonHarmonicResult = vList.stream().max(Comparator.comparing(ContrastNonHarmonicResult::getNum)).get();
List<ContrastNonHarmonicResult> maxList = vList.stream().filter(x -> x.getNum() == contrastNonHarmonicResult.getNum()).collect(Collectors.toList());
noHarm.addAll(maxList);
});
DynamicTableNameHandler.remove();
DynamicTableNameHandler.setTableName("ad_harmonic_result_" + code);
@@ -166,7 +169,13 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
for (String id : ids) {
wrapper2.like(ContrastHarmonicResult::getDevMonitorId, id);
}
harm.addAll(contrastHarmonicService.list(wrapper2));
List<ContrastHarmonicResult> harmonicResultList = contrastHarmonicService.list(wrapper2);
Map<String, List<ContrastHarmonicResult>> chnMap2 = harmonicResultList.stream().collect(Collectors.groupingBy(x -> x.getDevMonitorId().split("_")[1], Collectors.toList()));
chnMap2.forEach((chn, vList) -> {
ContrastHarmonicResult contrastHarmonicResult = vList.stream().max(Comparator.comparing(ContrastHarmonicResult::getNum)).get();
List<ContrastHarmonicResult> maxList = vList.stream().filter(x -> x.getNum() == contrastHarmonicResult.getNum()).collect(Collectors.toList());
harm.addAll(maxList);
});
DynamicTableNameHandler.remove();
} else {
List<Integer> disabledScriptDtlIndexs = detectionDataDealMapper.listDisabledScriptDtlIndexs(ids.get(0));

View File

@@ -49,6 +49,7 @@ public class TableGenServiceImpl implements TableGenService {
"A_Value_0 float NULL COMMENT 'A相基波有效值',\n" +
"C_Value_0 float NULL COMMENT 'B相基波有效值',\n" +
"B_Value_0 float NULL COMMENT 'B相基波有效值',\n" +
"Wave_Num tinyint(1) unsigned DEFAULT null COMMENT '录波数据第几组',\n" +
"PRIMARY KEY (Id)\n"
:
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本表Id',\n" +
@@ -75,6 +76,7 @@ public class TableGenServiceImpl implements TableGenService {
"A_Value_0 json NULL COMMENT 'A相基波有效值',\n" +
"B_Value_0 json NULL COMMENT 'B相基波有效值',\n" +
"C_Value_0 json NULL COMMENT 'B相基波有效值',\n" +
"Wave_Num tinyint(1) unsigned DEFAULT null COMMENT '录波数据第几组',\n" +
"PRIMARY KEY (Id)\n"
:
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本表Id',\n" +