1.微调
This commit is contained in:
@@ -199,7 +199,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
}
|
||||
} else {
|
||||
dipScriptTypeName(subValue, scriptSubList, finalResultMap, isValueType, "电压暂降测量准确度测试", 20, 85);
|
||||
dipScriptTypeName(subValue, scriptSubList, finalResultMap, isValueType, "电压暂升测量准确度测试", 110, 180);
|
||||
dipScriptTypeName(subValue, scriptSubList, finalResultMap, isValueType, "电压暂升测量准确度测试", 110, 200);
|
||||
dipScriptTypeName(subValue, scriptSubList, finalResultMap, isValueType, "电压中断测量准确度测试", 0, 10);
|
||||
}
|
||||
|
||||
@@ -272,6 +272,7 @@ public class ResultServiceImpl implements IResultService {
|
||||
.collect(Collectors.toList());
|
||||
TreeDataVO vo = new TreeDataVO();
|
||||
vo.setScriptTypeName(name);
|
||||
vo.setScriptTypeCode("Base_"+start+"_"+end);
|
||||
TreeDataVO dlt;
|
||||
for (PqScriptDtls dtls : dip) {
|
||||
dlt = new TreeDataVO();
|
||||
|
||||
@@ -450,6 +450,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
list = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : list) {
|
||||
if (listDTO.getChannelFlag()) {
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
@@ -461,6 +462,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case V2_50:
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
@@ -478,8 +480,10 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelU = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(channelU)) {
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : channelU) {
|
||||
if (listDTO.getHarmFlag()) {
|
||||
//获取电流通道
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelI = channelList.stream()
|
||||
.filter(PqScriptDtlsParam.ChannelListDTO::getHarmFlag)
|
||||
.filter(x -> x.getChannelType().contains("I" + listDTO.getChannelType().substring(1, 2)))
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(channelI)) {
|
||||
@@ -496,7 +500,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
if (harmIMap.containsKey(harmModel.getHarm())) {
|
||||
PqScriptDtlsParam.ChannelListDTO.HarmModel i = harmIMap.get(harmModel.getHarm());
|
||||
//电压*电流*cos(电压角度-电流角度)
|
||||
checkData.setValue(i.getFAmp() * harmModel.getFAmp() * Math.cos(harmModel.getFPhase() - i.getFPhase()));
|
||||
checkData.setValue(i.getFAmp() * harmModel.getFAmp()/100 * Math.cos(harmModel.getFPhase() - i.getFPhase()));
|
||||
}
|
||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||
}
|
||||
@@ -504,6 +508,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SV_1_49:
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
@@ -520,22 +525,26 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
case MAG:
|
||||
list = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : list) {
|
||||
if (listDTO.getDipFlag()) {
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setValue(listDTO.getDipData().getFTransValue());
|
||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DUR:
|
||||
list = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : list) {
|
||||
if (listDTO.getDipFlag()) {
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setValue(listDTO.getDipData().getRetainTime());
|
||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IRMS:
|
||||
case IA:
|
||||
@@ -546,16 +555,17 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
break;
|
||||
case V_UNBAN:
|
||||
list = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
unbanCheck(info, channelListDTO, channelList, list, checkArchive);
|
||||
unbanCheck(info, channelListDTO, list, checkArchive);
|
||||
break;
|
||||
case I_UNBAN:
|
||||
list = channelList.stream().filter(x -> x.getChannelType().contains("I")).collect(Collectors.toList());
|
||||
unbanCheck(info, channelListDTO, channelList, list, checkArchive);
|
||||
unbanCheck(info, channelListDTO, list, checkArchive);
|
||||
break;
|
||||
case PST:
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
list = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : list) {
|
||||
if (listDTO.getFlickerFlag()) {
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
@@ -564,7 +574,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case I1:
|
||||
@@ -631,19 +641,23 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
|
||||
private void unbanCheck(List<PqScriptDtlsParam.CheckData> info,
|
||||
PqScriptDtlsParam.CheckData channelListDTO,
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelList,
|
||||
List<PqScriptDtlsParam.ChannelListDTO> list,
|
||||
List<PqScriptCheckData> checkArchive
|
||||
) {
|
||||
PqScriptDtlsParam.CheckData checkData;
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
PqScriptDtlsParam.ChannelListDTO a = channelList.stream().filter(x -> x.getChannelType().contains("a")).findFirst().get();
|
||||
PqScriptDtlsParam.ChannelListDTO b = channelList.stream().filter(x -> x.getChannelType().contains("b")).findFirst().get();
|
||||
PqScriptDtlsParam.ChannelListDTO c = channelList.stream().filter(x -> x.getChannelType().contains("c")).findFirst().get();
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelA = list.stream().filter(x -> x.getChannelType().contains("a")).collect(Collectors.toList());
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelB = list.stream().filter(x -> x.getChannelType().contains("b")).collect(Collectors.toList());
|
||||
List<PqScriptDtlsParam.ChannelListDTO> channelC = list.stream().filter(x -> x.getChannelType().contains("c")).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(channelA) && CollUtil.isNotEmpty(channelB) && CollUtil.isNotEmpty(channelC)) {
|
||||
PqScriptDtlsParam.ChannelListDTO a = channelA.get(0);
|
||||
PqScriptDtlsParam.ChannelListDTO b = channelB.get(0);
|
||||
PqScriptDtlsParam.ChannelListDTO c = channelC.get(0);
|
||||
checkData.setValue(ThreePhaseUnbalance.calculateUnbalance(a.getFAmp(), a.getFPhase(), b.getFAmp(), b.getFPhase(), c.getFAmp(), c.getFPhase()));
|
||||
}
|
||||
if (CollUtil.isNotEmpty(checkArchive)) {
|
||||
checkData.setValue(checkArchive.get(0).getValue());
|
||||
}
|
||||
@@ -663,6 +677,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
) {
|
||||
PqScriptDtlsParam.CheckData checkData;
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : list) {
|
||||
if (listDTO.getChannelFlag()) {
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
@@ -682,6 +697,8 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
info.add(checkData);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void inHarmCheck(List<PqScriptDtlsParam.CheckData> info,
|
||||
@@ -691,6 +708,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
) {
|
||||
PqScriptDtlsParam.CheckData checkData;
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : uList) {
|
||||
if (listDTO.getInHarmFlag()) {
|
||||
List<PqScriptDtlsParam.ChannelListDTO.InharmModel> inharmList = listDTO.getInharmList();
|
||||
if (CollUtil.isNotEmpty(inharmList)) {
|
||||
for (PqScriptDtlsParam.ChannelListDTO.InharmModel inharmModel : inharmList) {
|
||||
@@ -708,6 +726,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setCheckValue(List<PqScriptCheckData> checkArchive, PqScriptDtlsParam.CheckData checkData, PqScriptDtlsParam.ChannelListDTO listDTO) {
|
||||
List<PqScriptCheckData> collect = checkArchive.stream().filter(x -> x.getPhase().equals(listDTO.getChannelType().substring(1, 2).toUpperCase())).collect(Collectors.toList());
|
||||
@@ -724,6 +743,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
) {
|
||||
PqScriptDtlsParam.CheckData checkData;
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : uList) {
|
||||
if (listDTO.getHarmFlag()) {
|
||||
List<PqScriptDtlsParam.ChannelListDTO.HarmModel> harmList = listDTO.getHarmList();
|
||||
if (CollUtil.isNotEmpty(harmList)) {
|
||||
for (PqScriptDtlsParam.ChannelListDTO.HarmModel harmModel : harmList) {
|
||||
@@ -742,6 +762,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private PqScriptDtls setScriptDtls(PqScriptDtlsParam sourceIssue, Integer i) {
|
||||
@@ -757,15 +778,27 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
public List<PqScriptDtls> pqScriptDtls(PqScriptIssueParam param, Double volt, Double curr) {
|
||||
List<PqScriptDtls> pqScriptDtls;
|
||||
MPJLambdaWrapper<PqScriptDtls> queryWrapper = new MPJLambdaWrapper<>();
|
||||
List<Integer> index = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(param.getScriptSubType())) {
|
||||
String[] split = param.getScriptSubType().split("_");
|
||||
if (split.length > 1) {
|
||||
param.setScriptSubType(split[0]);
|
||||
List<PqScriptDtls> pqScriptDtls1 = this.getBaseMapper().selectList(new LambdaQueryWrapper<PqScriptDtls>()
|
||||
.select(PqScriptDtls::getScriptIndex)
|
||||
.eq(StrUtil.isNotBlank(param.getScriptType()), PqScriptDtls::getScriptType, param.getScriptType())
|
||||
.eq(StrUtil.isNotBlank(param.getScriptSubType()), PqScriptDtls::getScriptSubType, param.getScriptSubType())
|
||||
.eq(PqScriptDtls::getScriptId, param.getScriptId())
|
||||
.ge(PqScriptDtls::getTransValue, split[1])
|
||||
.le(PqScriptDtls::getTransValue, split[2]));
|
||||
index = pqScriptDtls1.stream().map(PqScriptDtls::getScriptIndex).distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
queryWrapper.selectAll(PqScriptDtls.class)
|
||||
.selectAs(DictTree::getCode, PqScriptDtls::getScriptCode)
|
||||
.leftJoin(DictTree.class, DictTree::getId, PqScriptDtls::getScriptType)
|
||||
.eq(StrUtil.isNotBlank(param.getScriptType()), PqScriptDtls::getScriptType, param.getScriptType())
|
||||
.eq(StrUtil.isNotBlank(param.getScriptSubType()), PqScriptDtls::getScriptSubType, param.getScriptSubType())
|
||||
// .eq(PqScriptDtls::getIndex, 1)
|
||||
// .le(PqScriptDtls::getIndex, 30)
|
||||
// .in(PqScriptDtls::getIndex, Arrays.asList(1,7))
|
||||
|
||||
.in(CollUtil.isNotEmpty(index), PqScriptDtls::getScriptIndex, index)
|
||||
.eq(CollUtil.isNotEmpty(param.getDevIds()), PqScriptCheckData::getEnable, DataStateEnum.ENABLE.getCode())
|
||||
.orderByAsc(PqScriptCheckData::getScriptIndex)
|
||||
;
|
||||
|
||||
@@ -159,7 +159,6 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
for (Double i : harmNum) {
|
||||
dataVO = new RawResultDataVO();
|
||||
dataVO.setHarmNum(i);
|
||||
dataVO.setIsData(harmonicResult.getResultFlag());
|
||||
dataVO.setUnit(unit);
|
||||
try {
|
||||
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
||||
@@ -179,6 +178,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
if (ObjectUtil.isNotNull(a)) {
|
||||
dataVO.setRadius(a.getRadius());
|
||||
}
|
||||
dataVO.setIsData(setResultFlag(Arrays.asList(a,b,c)));
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
@@ -234,7 +234,23 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private Integer setResultFlag(List<RawResultDataVO.DetectionData> numbers) {
|
||||
List<Integer> isData = numbers.stream().filter(x -> ObjectUtil.isNotNull(x.getData())).filter(x -> 4 != x.getIsData()).map(RawResultDataVO.DetectionData::getIsData).distinct().collect(Collectors.toList());
|
||||
return getInteger(isData);
|
||||
}
|
||||
|
||||
private static Integer getInteger(List<Integer> isData) {
|
||||
if (CollUtil.isNotEmpty(isData)) {
|
||||
if (isData.size() > 1) {
|
||||
if (isData.contains(2)) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return isData.get(0);
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
public Double isHarmOrInHarm(Double value) {
|
||||
if (value == value.longValue()) {
|
||||
|
||||
Reference in New Issue
Block a user