1.解决mysql index关键字
2.增加通讯脚本相关接口
This commit is contained in:
@@ -126,8 +126,8 @@ public class ResultServiceImpl implements IResultService {
|
||||
.selectAll(PqScriptDtls.class)
|
||||
.eq(StrUtil.isNotBlank(param.getScriptId()), PqScriptDtls::getScriptId, param.getScriptId())
|
||||
.eq(StrUtil.isNotBlank(param.getScriptType()), PqScriptDtls::getScriptType, param.getScriptType())
|
||||
.ne(PqScriptDtls::getIndex, -1)
|
||||
.eq(PqScriptDtls::getEnable, DataStateEnum.ENABLE.getCode())
|
||||
.ne(PqScriptDtls::getScriptIndex, -1)
|
||||
.eq(StrUtil.isNotBlank(param.getDevId()),PqScriptDtls::getEnable, DataStateEnum.ENABLE.getCode())
|
||||
);
|
||||
Map<Integer, Set<Integer>> resultMap = new HashMap<>(5);
|
||||
if(StrUtil.isNotBlank(param.getDevId())){
|
||||
@@ -144,7 +144,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
}
|
||||
|
||||
Map<String, List<PqScriptDtls>> dtlsSortMap = dtlsList.stream()
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getScriptType, LinkedHashMap::new, Collectors.toList()));
|
||||
List<DictTree> dictTreeById = dictTreeService.getDictTreeById(new ArrayList<>(dtlsSortMap.keySet()));
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
infoVO.setScriptTypeCode(dictTree.getId());
|
||||
//额定条件下频率准确度测试
|
||||
LinkedHashMap<String, List<PqScriptDtls>> subTypeMap = value.stream()
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.filter(x -> "Base".equals(x.getScriptSubType()))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getScriptSubType, LinkedHashMap::new, Collectors.toList()));
|
||||
subTypeMap.forEach((subKey, subValue) -> {
|
||||
@@ -179,8 +179,8 @@ public class ResultServiceImpl implements IResultService {
|
||||
subType.setScriptTypeName(subName.get(subKey).replace("XX", dictTree.getName()));
|
||||
subType.setScriptTypeCode(subKey);
|
||||
LinkedHashMap<Integer, List<PqScriptDtls>> indexMap = subValue.stream()
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getScriptIndex, LinkedHashMap::new, Collectors.toList()));
|
||||
List<TreeDataVO> subTypeList = new ArrayList<>();
|
||||
indexMap.forEach((index, scriptDtlIndexList) -> {
|
||||
TreeDataVO dtlType = new TreeDataVO();
|
||||
@@ -208,7 +208,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
|
||||
//单影响量下频率准确度测试
|
||||
LinkedHashMap<String, List<PqScriptDtls>> subSingleTypeMap = value.stream()
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.filter(x -> !"Base".equals(x.getScriptSubType()))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getScriptSubType, LinkedHashMap::new, Collectors.toList()));
|
||||
if (CollUtil.isNotEmpty(subSingleTypeMap)) {
|
||||
@@ -224,8 +224,8 @@ public class ResultServiceImpl implements IResultService {
|
||||
List<TreeDataVO> subTypeList = new ArrayList<>();
|
||||
|
||||
LinkedHashMap<Integer, List<PqScriptDtls>> indexMap = subValue.stream()
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getIndex, LinkedHashMap::new, Collectors.toList()));
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.collect(Collectors.groupingBy(PqScriptDtls::getScriptIndex, LinkedHashMap::new, Collectors.toList()));
|
||||
indexMap.forEach((index, scriptDtlIndexList) -> {
|
||||
TreeDataVO dtlType = new TreeDataVO();
|
||||
dtlType.setIndex(index);
|
||||
@@ -268,21 +268,21 @@ public class ResultServiceImpl implements IResultService {
|
||||
List<PqScriptDtls> dip = subValue.stream()
|
||||
.filter(x -> "Dip".equals(x.getValueType()) && "A".equals(x.getPhase()))
|
||||
.filter(x -> x.getTransValue() >= start && x.getTransValue() <= end)
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getIndex))
|
||||
.sorted(Comparator.comparing(PqScriptDtls::getScriptIndex))
|
||||
.collect(Collectors.toList());
|
||||
TreeDataVO vo = new TreeDataVO();
|
||||
vo.setScriptTypeName(name);
|
||||
TreeDataVO dlt;
|
||||
for (PqScriptDtls dtls : dip) {
|
||||
dlt = new TreeDataVO();
|
||||
List<PqScriptDtls> scriptDtlIndexList = subValue.stream().filter(x -> dtls.getIndex().equals(x.getIndex())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> scriptDtlIndexList = subValue.stream().filter(x -> dtls.getScriptIndex().equals(x.getScriptIndex())).collect(Collectors.toList());
|
||||
//特征幅值=20%Un,持续时间=1周波
|
||||
dlt.setScriptTypeName("特征幅值=" + dtls.getTransValue() + "%Un,持续时间=" + dtls.getRetainTime().intValue() + "周波");
|
||||
dlt.setIndex(dtls.getIndex());
|
||||
dlt.setIndex(dtls.getScriptIndex());
|
||||
dlt.setScriptType(scriptDtlIndexList.get(0).getScriptType());
|
||||
dlt.setSourceDesc(ScriptDtlsDesc.getStringBuffer(scriptDtlIndexList, isValueType).toString());
|
||||
if (finalResultMap.containsKey(dtls.getIndex())) {
|
||||
dlt.setFly(conform(finalResultMap.get(dtls.getIndex())));
|
||||
if (finalResultMap.containsKey(dtls.getScriptIndex())) {
|
||||
dlt.setFly(conform(finalResultMap.get(dtls.getScriptIndex())));
|
||||
}
|
||||
info.add(dlt);
|
||||
|
||||
@@ -398,7 +398,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
case IMBV:
|
||||
List<PqScriptCheckData> list = pqScriptCheckDataService.list(new MPJLambdaWrapper<PqScriptCheckData>()
|
||||
.eq(PqScriptCheckData::getScriptId, scriptDtlIndexList.get(0).getScriptId())
|
||||
.eq(PqScriptCheckData::getIndex, scriptDtlIndexList.get(0).getIndex())
|
||||
.eq(PqScriptCheckData::getScriptIndex, scriptDtlIndexList.get(0).getScriptIndex())
|
||||
);
|
||||
//三相负序电压不平衡度=0%
|
||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + list.get(0).getValue() + ResultUnitEnum.IMBV.getUnit());
|
||||
@@ -409,7 +409,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
case IMBA:
|
||||
List<PqScriptCheckData> imba = pqScriptCheckDataService.list(new MPJLambdaWrapper<PqScriptCheckData>()
|
||||
.eq(PqScriptCheckData::getScriptId, scriptDtlIndexList.get(0).getScriptId())
|
||||
.eq(PqScriptCheckData::getIndex, scriptDtlIndexList.get(0).getIndex())
|
||||
.eq(PqScriptCheckData::getScriptIndex, scriptDtlIndexList.get(0).getScriptIndex())
|
||||
);
|
||||
//三相负序电流不平衡度=0%
|
||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + imba.get(0).getValue() + ResultUnitEnum.IMBV.getUnit());
|
||||
@@ -767,7 +767,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
.select(PqScriptCheckData::getHarmNum)
|
||||
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
|
||||
.isNotNull(PqScriptCheckData::getHarmNum)
|
||||
.eq(PqScriptCheckData::getIndex, param.getIndex())
|
||||
.eq(PqScriptCheckData::getScriptIndex, param.getIndex())
|
||||
);
|
||||
harmNum = list.stream().sorted(Comparator.comparing(PqScriptCheckData::getHarmNum))
|
||||
.map(PqScriptCheckData::getHarmNum).distinct().collect(Collectors.toList());
|
||||
@@ -800,7 +800,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
.select(PqScriptCheckData::getHarmNum)
|
||||
.eq(PqScriptCheckData::getScriptId, param.getScriptId())
|
||||
.isNotNull(PqScriptCheckData::getHarmNum)
|
||||
.eq(PqScriptCheckData::getIndex, param.getIndex())
|
||||
.eq(PqScriptCheckData::getScriptIndex, param.getIndex())
|
||||
);
|
||||
harmNum = list.stream().sorted(Comparator.comparing(PqScriptCheckData::getHarmNum))
|
||||
.map(PqScriptCheckData::getHarmNum).distinct().collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user