比对完善

This commit is contained in:
caozehui
2025-09-01 13:39:52 +08:00
parent 0977a77eed
commit 8963b20dd3
17 changed files with 551 additions and 115 deletions

View File

@@ -64,6 +64,12 @@ public class SourceIssue {
@JSONField(name = "type", ordinal = 2)
private String type;
/**
* 是否是功率
*/
@JSONField(serialize = false)
private Boolean isP;
/**
* 多量响量
*/

View File

@@ -16,6 +16,7 @@ import com.njcn.gather.device.pojo.po.PqDev;
import com.njcn.gather.device.service.IPqDevService;
import com.njcn.gather.plan.mapper.AdPlanMapper;
import com.njcn.gather.plan.pojo.po.AdPlan;
import com.njcn.gather.result.pojo.enums.ResultUnitEnum;
import com.njcn.gather.script.mapper.PqScriptCheckDataMapper;
import com.njcn.gather.script.mapper.PqScriptDtlsMapper;
import com.njcn.gather.script.mapper.PqScriptMapper;
@@ -246,6 +247,11 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
issueAdd(curList, dtlsIList, HARM_I, INHARM_I, freqDtls.getValue(), "I", channelListDTOS, checkDataParam, devFly, isValueType);
issue.setChannelList(channelListDTOS);
if (ResultUnitEnum.P.getCode().equals(issue.getType())) {
issue.setIsP(true);
} else {
issue.setIsP(false);
}
sourceIssues.add(issue);
}
});
@@ -413,6 +419,8 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
@Override
public List<PqScriptDtlsParam.CheckData> scriptDtlsCheckDataList(PqScriptDtlsParam sourceIssue) {
Boolean valueType = pqScriptMapper.selectScriptIsValueType(sourceIssue.getScriptId());
List<PqScriptDtlsParam.CheckData> info = new ArrayList<>();
//获取所有下拉值情况
List<PqScriptDtlsParam.CheckData> checkDataList = sourceIssue.getCheckDataList();
@@ -526,7 +534,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() / 100 * Math.cos(harmModel.getFPhase() - i.getFPhase()));
checkData.setValue(i.getFAmp() * harmModel.getFAmp() / 100 * Math.cos((harmModel.getFPhase() - i.getFPhase()) * Math.PI / 180));
}
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
}
@@ -605,13 +613,13 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
break;
case I1:
break;
case P_FUND:
case W:
channelU = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
if (CollUtil.isNotEmpty(channelU)) {
for (PqScriptDtlsParam.ChannelListDTO listDTO : channelU) {
//获取电流通道
channelI = channelList.stream()
.filter(PqScriptDtlsParam.ChannelListDTO::getHarmFlag)
// .filter(PqScriptDtlsParam.ChannelListDTO::getHarmFlag)
.filter(x -> x.getChannelType().contains("I" + listDTO.getChannelType().substring(1, 2)))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(channelI)) {
@@ -619,7 +627,56 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
checkData.setErrorFlag(channelListDTO.getErrorFlag());
checkData.setEnable(channelListDTO.getEnable());
//电压*电流*cos电压角度-电流角度)
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() * Math.cos(listDTO.getFPhase() - channelI.get(0).getFPhase()));
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000 * Math.cos((listDTO.getFPhase() - channelI.get(0).getFPhase()) * Math.PI / 180));
if (valueType) {
checkData.setValue(checkData.getValue() * 57.74 * 5);
}
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
}
}
}
break;
case VARW:
channelU = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
if (CollUtil.isNotEmpty(channelU)) {
for (PqScriptDtlsParam.ChannelListDTO listDTO : channelU) {
//获取电流通道
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)) {
checkData = new PqScriptDtlsParam.CheckData();
checkData.setErrorFlag(channelListDTO.getErrorFlag());
checkData.setEnable(channelListDTO.getEnable());
//电压*电流*cos电压角度-电流角度)
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000 * Math.sin((listDTO.getFPhase() - channelI.get(0).getFPhase()) * Math.PI / 180));
if (valueType) {
checkData.setValue(checkData.getValue() * 57.74 * 5);
}
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
}
}
}
break;
case VAW:
channelU = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
if (CollUtil.isNotEmpty(channelU)) {
for (PqScriptDtlsParam.ChannelListDTO listDTO : channelU) {
//获取电流通道
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)) {
checkData = new PqScriptDtlsParam.CheckData();
checkData.setErrorFlag(channelListDTO.getErrorFlag());
checkData.setEnable(channelListDTO.getEnable());
//电压*电流*cos电压角度-电流角度)
checkData.setValue(channelI.get(0).getFAmp() * listDTO.getFAmp() / 10000);
if (valueType) {
checkData.setValue(checkData.getValue() * 57.74 * 5);
}
setCheck(info, checkData, channelListDTO, checkArchive, listDTO);
}
}
@@ -1032,7 +1089,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
dipDataDTO.setFTransValue(dip.getTransValue());
if (devFly) {
// if (isValueType) {
dipDataDTO.setFTransValue(dip.getTransValue());
dipDataDTO.setFTransValue(dip.getTransValue());
// }
// else {
// dipDataDTO.setFTransValue(NumberUtil.round(dip.getTransValue() / dtls.getValue(), 4).doubleValue());