禅道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,12 +1743,17 @@ public class WebCadOrderImportAsyncFactory {
private String getPartsSpec(String value) {
value = StringUtils.defaultString(value);
int idx = value.indexOf('|');
// 特殊规格:规格|材质|颜色
if (StringUtils.countMatches(value, "|") >= 2) {
int idx = value.indexOf('|');
return StringUtils.defaultIfEmpty(
value.substring(0, idx),
EMPTY_STRING
);
}
return StringUtils.defaultIfEmpty(
idx >= 0 ? value.substring(0, idx) : value,
EMPTY_STRING
);
// 普通规格直接返回
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
}
/**
@@ -1930,12 +1930,17 @@ public class WebCadOrderImportFactory {
private String getPartsSpec(String value) {
value = StringUtils.defaultString(value);
int idx = value.indexOf('|');
// 特殊规格:规格|材质|颜色
if (StringUtils.countMatches(value, "|") >= 2) {
int idx = value.indexOf('|');
return StringUtils.defaultIfEmpty(
value.substring(0, idx),
EMPTY_STRING
);
}
return StringUtils.defaultIfEmpty(
idx >= 0 ? value.substring(0, idx) : value,
EMPTY_STRING
);
// 普通规格直接返回
return StringUtils.defaultIfEmpty(value, EMPTY_STRING);
}
/**