StringUtils增加splitComma、joinComma

This commit is contained in:
thinkgem
2023-06-09 20:47:15 +08:00
parent 7fe1faf915
commit 8e4be5f03c
17 changed files with 89 additions and 86 deletions

View File

@@ -102,7 +102,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
return list;
}
Article where = new Article();
where.setId_in(StringUtils.split(ids, ","));
where.setId_in(StringUtils.splitComma(ids));
dao.findList(where).forEach((e) -> {
list.add(new Object[] { e.getCategory().getId(), e.getId(), StringUtils.abbr(e.getTitle(), 50) });
});

View File

@@ -147,7 +147,7 @@ public class CmsUtils {
// 增加获取层次级别条件
List<Integer> sortGradeList = ListUtils.newArrayList();
for (String s : StringUtils.split(sortGrades, ",")) {
for (String s : StringUtils.splitComma(sortGrades)) {
sortGradeList.add(ObjectUtils.toInteger(s));
}
category.setSortGradeList(sortGradeList);
@@ -370,7 +370,7 @@ public class CmsUtils {
String outlineViewOfSiteCodes = Global.getConfig("cms.article.outlineViewOfSiteCodes");
if (StringUtils.isNotBlank(outlineViewOfSiteCodes) && !"0".equals(outlineViewOfSiteCodes)) {
if (category.getSite() != null && StringUtils.isNotBlank(category.getSite().getSiteCode())) {
if (StringUtils.inString(category.getSite().getSiteCode(), StringUtils.split(outlineViewOfSiteCodes, ","))) {
if (StringUtils.inString(category.getSite().getSiteCode(), StringUtils.splitComma(outlineViewOfSiteCodes))) {
if (!StringUtils.contains(str.toString(), "&outlineView=")) {
str.append("&outlineView=true");
}