补充三相功率因数
This commit is contained in:
@@ -958,16 +958,15 @@ public class SocketDevResponseService {
|
||||
|
||||
//告诉前端当前项开始了
|
||||
WebSocketVO<Object> webSocketVO = new WebSocketVO<>();
|
||||
String type = sourceIssues.get(0).getType();
|
||||
if (ResultUnitEnum.P.getCode().equals(type)) {
|
||||
if (StrUtil.isNotBlank(sourceIssues.get(0).getOtherType())) {
|
||||
sourceIssues.get(0).setType(ResultUnitEnum.V_ABSOLUTELY.getCode());
|
||||
webSocketVO.setRequestId(ResultUnitEnum.P.getCode() + CnSocketUtil.START_TAG);
|
||||
webSocketVO.setRequestId(sourceIssues.get(0).getOtherType() + CnSocketUtil.START_TAG);
|
||||
} else {
|
||||
webSocketVO.setRequestId(sourceIssues.get(0).getType() + CnSocketUtil.START_TAG);
|
||||
}
|
||||
FormalTestManager.currentIssue = sourceIssues.get(0);
|
||||
socketMsg.setData(JSON.toJSONString(sourceIssues.get(0)));
|
||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + CnSocketUtil.STEP_TAG + type);
|
||||
socketMsg.setRequestId(SourceOperateCodeEnum.FORMAL_REAL.getValue() + CnSocketUtil.STEP_TAG + sourceIssues.get(0).getOtherType());
|
||||
socketMsg.setOperateCode(SourceOperateCodeEnum.OPER_GATHER.getValue());
|
||||
SocketManager.sendMsg(param.getUserPageId() + CnSocketUtil.SOURCE_TAG, JSON.toJSONString(socketMsg));
|
||||
|
||||
@@ -1316,9 +1315,9 @@ public class SocketDevResponseService {
|
||||
|
||||
//小项检测完后小项数减一,并更新map
|
||||
long residueCount = 0;
|
||||
if (sourceIssue.getIsP()) {
|
||||
residueCount = SocketManager.getSourceTarget(ResultUnitEnum.P.getCode()) - 1;
|
||||
SocketManager.addTargetMap(ResultUnitEnum.P.getCode(), residueCount);
|
||||
if (StrUtil.isNotBlank(sourceIssue.getOtherType())) {
|
||||
residueCount = SocketManager.getSourceTarget(sourceIssue.getOtherType()) - 1;
|
||||
SocketManager.addTargetMap(sourceIssue.getOtherType(), residueCount);
|
||||
} else {
|
||||
residueCount = SocketManager.getSourceTarget(sourceIssue.getType()) - 1;
|
||||
SocketManager.addTargetMap(sourceIssue.getType(), residueCount);
|
||||
@@ -1367,9 +1366,9 @@ public class SocketDevResponseService {
|
||||
WebServiceManager.sendDetectionMessage(param.getUserPageId(), sourceIssues.getType() + CnSocketUtil.START_TAG, null, new ArrayList<>(), null);
|
||||
}
|
||||
String type = sourceIssues.getType();
|
||||
if (sourceIssues.getIsP()) {
|
||||
if (StrUtil.isNotBlank(sourceIssues.getOtherType())) {
|
||||
sourceIssues.setType(ResultUnitEnum.V_ABSOLUTELY.getCode());
|
||||
type = ResultUnitEnum.P.getCode();
|
||||
type = sourceIssues.getOtherType();
|
||||
}
|
||||
|
||||
//控源下发下一个小项脚本
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||
@@ -163,9 +164,10 @@ public class DetectionServiceImpl {
|
||||
SysTestConfig oneConfig = sysTestConfigService.getOneConfig();
|
||||
List<ErrDtlsCheckDataVO> errDtlsCheckData = pqErrSysDtlsService.listByPqErrSysIdAndTypes(param);
|
||||
ResultUnitEnum resultUnitEnumByCode = ResultUnitEnum.getResultUnitEnumByCode(sourceIssue.getType());
|
||||
if (sourceIssue.getIsP()) {
|
||||
resultUnitEnumByCode = ResultUnitEnum.P;
|
||||
if (StrUtil.isNotBlank(sourceIssue.getOtherType())) {
|
||||
resultUnitEnumByCode = ResultUnitEnum.getResultUnitEnumByCode(sourceIssue.getOtherType());
|
||||
}
|
||||
|
||||
switch (resultUnitEnumByCode) {
|
||||
/**
|
||||
* 频率
|
||||
@@ -174,6 +176,8 @@ public class DetectionServiceImpl {
|
||||
return isQualified(dev, devIdMapComm, errDtlsCheckData, F, sourceIssue, dataRule, code, oneConfig.getScale());
|
||||
case P:
|
||||
return isQualified(dev, devIdMapComm, errDtlsCheckData, P, sourceIssue, dataRule, code, oneConfig.getScale());
|
||||
case ANGLE:
|
||||
return isQualified(dev, devIdMapComm, errDtlsCheckData, resultUnitEnumByCode.getCode(), sourceIssue, dataRule, code, oneConfig.getScale());
|
||||
/**
|
||||
* 电压
|
||||
*/
|
||||
@@ -443,6 +447,9 @@ public class DetectionServiceImpl {
|
||||
dtlsCheckData.stream().forEach(x -> x.setValue(x.getValue() * finalFData));
|
||||
}
|
||||
}
|
||||
// if (ResultUnitEnum.ANGLE.getCode().equals(type)) {
|
||||
// fData = null;
|
||||
// }
|
||||
SimAndDigNonHarmonicResult result = new SimAndDigNonHarmonicResult();
|
||||
String[] split = dev.get(0).getId().split("_");
|
||||
String devID = devIdMapComm.get(split[0]);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.gather.detection.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -310,9 +311,9 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
||||
|
||||
SourceIssue sourceIssue = sourceIssues.get(0);
|
||||
String type = sourceIssue.getType();
|
||||
if (sourceIssue.getIsP()) {
|
||||
if (StrUtil.isNotBlank(sourceIssue.getOtherType())) {
|
||||
sourceIssue.setType(ResultUnitEnum.V_ABSOLUTELY.getCode());
|
||||
type = ResultUnitEnum.P.getCode();
|
||||
type = sourceIssue.getOtherType();
|
||||
}
|
||||
|
||||
List<String> comm = sourceIssue.getDevValueTypeList();
|
||||
|
||||
@@ -26,6 +26,7 @@ public enum ResultUnitEnum {
|
||||
IMBA("%", "电流不平衡度","IMBA"),
|
||||
F("","闪变","F"),
|
||||
P("W", "功率","P"),
|
||||
ANGLE("°", "相角","Angle"),
|
||||
|
||||
UNKNOWN("","未知","UNKNOWN"),
|
||||
;
|
||||
|
||||
@@ -539,6 +539,15 @@ public class ResultServiceImpl implements IResultService {
|
||||
|
||||
private void ratedScriptTypeName(List<PqScriptDtls> scriptDtlIndexList, Boolean isValueType, TreeDataVO dtlType, DictTree dictTree) {
|
||||
ResultUnitEnum resultUnitEnumByCode = ResultUnitEnum.getResultUnitEnumByCode(dictTree.getCode());
|
||||
String unitV;
|
||||
String unitI;
|
||||
if (isValueType) {
|
||||
unitV = ResultUnitEnum.V_RELATIVE.getUnit();
|
||||
unitI = ResultUnitEnum.I_RELATIVE.getUnit();
|
||||
} else {
|
||||
unitV = ResultUnitEnum.V_ABSOLUTELY.getUnit();
|
||||
unitI = ResultUnitEnum.I_ABSOLUTELY.getUnit();
|
||||
}
|
||||
switch (resultUnitEnumByCode) {
|
||||
/**
|
||||
* 频率
|
||||
@@ -548,15 +557,6 @@ public class ResultServiceImpl implements IResultService {
|
||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + f.get(0).getValue() + ResultUnitEnum.FREQ.getUnit());
|
||||
break;
|
||||
case P: {
|
||||
String unitV;
|
||||
String unitI;
|
||||
if (isValueType) {
|
||||
unitV = ResultUnitEnum.V_RELATIVE.getUnit();
|
||||
unitI = ResultUnitEnum.I_RELATIVE.getUnit();
|
||||
} else {
|
||||
unitV = ResultUnitEnum.V_ABSOLUTELY.getUnit();
|
||||
unitI = ResultUnitEnum.I_ABSOLUTELY.getUnit();
|
||||
}
|
||||
List<PqScriptDtls> v = scriptDtlIndexList.stream().filter(x -> "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> i = scriptDtlIndexList.stream().filter(x -> "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> aDtl1 = scriptDtlIndexList.stream().filter(x -> "A".equals(x.getPhase()) && "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||
@@ -575,26 +575,14 @@ public class ResultServiceImpl implements IResultService {
|
||||
*/
|
||||
case V_RELATIVE:
|
||||
case V_ABSOLUTELY:
|
||||
String unit;
|
||||
if (isValueType) {
|
||||
unit = ResultUnitEnum.V_RELATIVE.getUnit();
|
||||
} else {
|
||||
unit = ResultUnitEnum.V_ABSOLUTELY.getUnit();
|
||||
}
|
||||
List<PqScriptDtls> v = scriptDtlIndexList.stream().filter(x -> "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + v.get(0).getValue() + unit);
|
||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + v.get(0).getValue() + unitV);
|
||||
break;
|
||||
/**
|
||||
* 电流
|
||||
*/
|
||||
case I_RELATIVE:
|
||||
case I_ABSOLUTELY:
|
||||
String unitI;
|
||||
if (isValueType) {
|
||||
unitI = ResultUnitEnum.I_RELATIVE.getUnit();
|
||||
} else {
|
||||
unitI = ResultUnitEnum.I_ABSOLUTELY.getUnit();
|
||||
}
|
||||
List<PqScriptDtls> I = scriptDtlIndexList.stream().filter(x -> "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
||||
dtlType.setScriptTypeName(dictTree.getName() + "=" + I.get(0).getValue() + unitI);
|
||||
break;
|
||||
@@ -748,7 +736,36 @@ public class ResultServiceImpl implements IResultService {
|
||||
*/
|
||||
case VOLTAGE_MAG:
|
||||
case VOLTAGE_DUR:
|
||||
break;
|
||||
case ANGLE: {
|
||||
List<PqScriptDtls> aDtlV = scriptDtlIndexList.stream().filter(x -> "A".equals(x.getPhase()) && "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> aDtlI = scriptDtlIndexList.stream().filter(x -> "A".equals(x.getPhase()) && "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> bDtlV = scriptDtlIndexList.stream().filter(x -> "B".equals(x.getPhase()) && "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> bDtlI = scriptDtlIndexList.stream().filter(x -> "B".equals(x.getPhase()) && "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> cDtlV = scriptDtlIndexList.stream().filter(x -> "C".equals(x.getPhase()) && "VOL".equals(x.getValueType())).collect(Collectors.toList());
|
||||
List<PqScriptDtls> cDtlI = scriptDtlIndexList.stream().filter(x -> "C".equals(x.getPhase()) && "CUR".equals(x.getValueType())).collect(Collectors.toList());
|
||||
|
||||
StringBuilder scriptTypeName = new StringBuilder();
|
||||
if (CollUtil.isNotEmpty(aDtlV)) {
|
||||
scriptTypeName.append("A相:电压相角=" + aDtlV.get(0).getAngle() + ResultUnitEnum.ANGLE.getUnit());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(aDtlI)) {
|
||||
scriptTypeName.append(",电流相角=" + aDtlI.get(0).getAngle() + ResultUnitEnum.ANGLE.getUnit());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(bDtlV)) {
|
||||
scriptTypeName.append(";B相:电压相角=" + bDtlV.get(0).getAngle() + ResultUnitEnum.ANGLE.getUnit());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(bDtlI)) {
|
||||
scriptTypeName.append(",电流相角=" + bDtlI.get(0).getAngle() + ResultUnitEnum.ANGLE.getUnit());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(cDtlV)) {
|
||||
scriptTypeName.append(";C相:电压相角=" + cDtlV.get(0).getAngle() + ResultUnitEnum.ANGLE.getUnit());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(cDtlI)) {
|
||||
scriptTypeName.append(",电流相角=" + cDtlI.get(0).getAngle() + ResultUnitEnum.ANGLE.getUnit());
|
||||
}
|
||||
dtlType.setScriptTypeName(scriptTypeName.toString());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ public class SourceIssue {
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否是功率
|
||||
* 是否按电压执行
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private Boolean isP;
|
||||
private String otherType;
|
||||
|
||||
/**
|
||||
* 多量响量
|
||||
|
||||
@@ -247,10 +247,10 @@ 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);
|
||||
if (ResultUnitEnum.P.getCode().equals(issue.getType()) || ResultUnitEnum.ANGLE.getCode().equals(issue.getType())) {
|
||||
issue.setOtherType(issue.getType());
|
||||
} else {
|
||||
issue.setIsP(false);
|
||||
issue.setOtherType(null);
|
||||
}
|
||||
sourceIssues.add(issue);
|
||||
}
|
||||
@@ -486,6 +486,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
rmsCheck(info, channelListDTO, channelU, checkArchive, true);
|
||||
}
|
||||
break;
|
||||
case U1A:
|
||||
case VA:
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
channelU = channelList.stream().filter(x -> x.getChannelType().contains("U")).collect(Collectors.toList());
|
||||
@@ -587,6 +588,23 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
break;
|
||||
case IRMS:
|
||||
case I1A:
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
channelI = channelList.stream().filter(x -> x.getChannelType().contains("I")).collect(Collectors.toList());
|
||||
for (PqScriptDtlsParam.ChannelListDTO listDTO : channelI) {
|
||||
if (listDTO.getChannelFlag()) {
|
||||
checkData = new PqScriptDtlsParam.CheckData();
|
||||
checkData.setErrorFlag(channelListDTO.getErrorFlag());
|
||||
checkData.setEnable(channelListDTO.getEnable());
|
||||
checkData.setValue(listDTO.getFPhase());
|
||||
checkData.setValueType(channelListDTO.getValueType());
|
||||
checkData.setPid(channelListDTO.getPid());
|
||||
setCheckValue(checkArchive, checkData, listDTO);
|
||||
info.add(checkData);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IA:
|
||||
if (CollUtil.isNotEmpty(channelList)) {
|
||||
channelI = channelList.stream().filter(x -> x.getChannelType().contains("I")).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user