禅道bug#1721修复

This commit is contained in:
gaoqr
2026-06-24 16:06:06 +08:00
parent 69adb2e7da
commit b623567217
2 changed files with 20 additions and 10 deletions
@@ -1743,14 +1743,19 @@ public class WebCadOrderImportAsyncFactory {
private String getPartsSpec(String value) { private String getPartsSpec(String value) {
value = StringUtils.defaultString(value); value = StringUtils.defaultString(value);
// 特殊规格:规格|材质|颜色
if (StringUtils.countMatches(value, "|") >= 2) {
int idx = value.indexOf('|'); int idx = value.indexOf('|');
return StringUtils.defaultIfEmpty( return StringUtils.defaultIfEmpty(
idx >= 0 ? value.substring(0, idx) : value, value.substring(0, idx),
EMPTY_STRING EMPTY_STRING
); );
} }
// 普通规格直接返回
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
}
/** /**
* 保留三位小数展示 * 保留三位小数展示
* *
@@ -1930,14 +1930,19 @@ public class WebCadOrderImportFactory {
private String getPartsSpec(String value) { private String getPartsSpec(String value) {
value = StringUtils.defaultString(value); value = StringUtils.defaultString(value);
// 特殊规格:规格|材质|颜色
if (StringUtils.countMatches(value, "|") >= 2) {
int idx = value.indexOf('|'); int idx = value.indexOf('|');
return StringUtils.defaultIfEmpty( return StringUtils.defaultIfEmpty(
idx >= 0 ? value.substring(0, idx) : value, value.substring(0, idx),
EMPTY_STRING EMPTY_STRING
); );
} }
// 普通规格直接返回
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
}
/** /**
* 保留三位小数展示 * 保留三位小数展示
* *