...
|
...
|
@@ -53,19 +53,27 @@ public class SuggestConversionFromBrandIndexBuilder extends IIndexBuilder { |
|
|
// 根据品牌风格和品牌关键词构建dest
|
|
|
StringBuffer dest = new StringBuffer();
|
|
|
if (StringUtils.isNotEmpty(brand.getBrandStyle())) {
|
|
|
dest.append(brand.getBrandStyle());
|
|
|
dest.append(connectByComma(brand.getBrandStyle()));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(brand.getBrandKeyword())) {
|
|
|
if (dest.length() == 0) {
|
|
|
dest.append(brand.getBrandKeyword());
|
|
|
dest.append(connectByComma(brand.getBrandKeyword()));
|
|
|
} else {
|
|
|
dest.append(",").append(brand.getBrandKeyword());
|
|
|
dest.append(",").append(connectByComma(brand.getBrandKeyword()));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return new ConversionBO(brand.getBrandName(), dest.toString(), DateUtil.getCurrentTimeSecond(), VALID_STATUS);
|
|
|
}
|
|
|
|
|
|
private String connectByComma(String str) {
|
|
|
if (str.contains(",")) {
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
return str.replaceAll("\\s+", ",").replaceAll(",", ",");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getId(Object object) {
|
|
|
return MD5Util.string2MD5(((ConversionBO) object).getSource().trim().toLowerCase());
|
...
|
...
|
|