优化部分代码

This commit is contained in:
2025-06-06 11:34:02 +08:00
parent 525de0c24c
commit 9820d0a915
2 changed files with 12 additions and 1179 deletions

View File

@@ -1363,8 +1363,8 @@ public class ResultServiceImpl implements IResultService {
} }
} }
} }
errorScopeMag = dealErrorScope(errorScopeMag).concat(unitMag); errorScopeMag = dealErrorScope(errorScopeMag).concat(StrUtil.isBlank(unitMag) ? "" : unitMag);
errorScopeDur = dealErrorScope(errorScopeDur).concat(unitDur); errorScopeDur = dealErrorScope(errorScopeDur).concat(StrUtil.isBlank(unitDur) ? "" : unitDur);
errorScope = "特征幅值:".concat(errorScopeMag).concat(StrPool.COMMA).concat("持续时间:").concat(errorScopeDur); errorScope = "特征幅值:".concat(errorScopeMag).concat(StrPool.COMMA).concat("持续时间:").concat(errorScopeDur);
keyFillMap.put(ItemReportKeyEnum.ERROR_SCOPE.getKey(), errorScope); keyFillMap.put(ItemReportKeyEnum.ERROR_SCOPE.getKey(), errorScope);
@@ -1398,6 +1398,9 @@ public class ResultServiceImpl implements IResultService {
* @param errorScope 误差范围 * @param errorScope 误差范围
*/ */
private String dealErrorScope(String errorScope) { private String dealErrorScope(String errorScope) {
if (StrUtil.isBlank(errorScope)) {
return "/";
}
if (errorScope.contains("~")) { if (errorScope.contains("~")) {
String[] split = errorScope.split("~"); String[] split = errorScope.split("~");
String begin = split[0]; String begin = split[0];