调整检测详情展示单位

This commit is contained in:
wr
2025-03-10 10:51:55 +08:00
parent 337797b0ed
commit 67b6f822c3
4 changed files with 11 additions and 8 deletions

View File

@@ -193,7 +193,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
checkDataParam.setIndex(freqDtls.getScriptIndex());
checkDataParam.setIsValueTypeName(true);
issue.setDevValueTypeList(pqScriptCheckDataService.getValueType(checkDataParam));
issue.setDesc(ScriptDtlsDesc.getStringBuffer(value, isValueType).toString());
issue.setDesc(ScriptDtlsDesc.getStringBuffer(value,true, isValueType).toString());
issue.setScriptId(freqDtls.getScriptId());
issue.setFUn(volt);
issue.setFIn(curr);

View File

@@ -16,15 +16,18 @@ import java.util.stream.Collectors;
* @date 2025/1/13 22:05
*/
public class ScriptDtlsDesc {
public static StringBuffer getStringBuffer(List<PqScriptDtls> scriptDtlIndex, Boolean isValueType) {
public static StringBuffer getStringBuffer(List<PqScriptDtls> scriptDtlIndex,Boolean isScript, Boolean isValueType) {
if (ObjectUtil.isNull(isValueType)) {
isValueType = true;
}
if (isScript) {
isValueType = false;
}
StringBuffer buffer = new StringBuffer();
buffer.append("输入:");
appendValue(scriptDtlIndex, buffer, "Freq", "频率", ResultUnitEnum.FREQ_UNIT.getUnit(), null);
appendValue(scriptDtlIndex, buffer, "VOL", "U", !isValueType ? ResultUnitEnum.V_RELATIVE_UNIT.getUnit() : ResultUnitEnum.V_ABSOLUTELY_UNIT.getUnit(), "相角=");
appendValue(scriptDtlIndex, buffer, "CUR", "I", !isValueType ? ResultUnitEnum.I_RELATIVE_UNIT.getUnit() : ResultUnitEnum.I_ABSOLUTELY_UNIT.getUnit(), "相角=");
appendValue(scriptDtlIndex, buffer, "VOL", "U", isValueType ? ResultUnitEnum.V_RELATIVE_UNIT.getUnit() : ResultUnitEnum.V_ABSOLUTELY_UNIT.getUnit(), "相角=");
appendValue(scriptDtlIndex, buffer, "CUR", "I", isValueType ? ResultUnitEnum.I_RELATIVE_UNIT.getUnit() : ResultUnitEnum.I_ABSOLUTELY_UNIT.getUnit(), "相角=");
dtlsSetBuffer(scriptDtlIndex, buffer, "Harm_V", "h", ResultUnitEnum.HV_UNIT.getUnit(), true);
dtlsSetBuffer(scriptDtlIndex, buffer, "Harm_I", "h", ResultUnitEnum.HI_UNIT.getUnit(), true);
dtlsSetBuffer(scriptDtlIndex, buffer, "InHarm_V", "i", ResultUnitEnum.HSV_UNIT.getUnit(), false);