恢复栏目的斜杠

This commit is contained in:
sgjj 2020-11-11 16:36:00 +08:00
parent 92d07bc2c7
commit 8a2fc3b746
1 changed files with 0 additions and 12 deletions

View File

@ -108,7 +108,6 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
//保存链接地址 //保存链接地址
String path=ObjectUtil.isNotNull(parentCategory)?parentCategory.getCategoryPath():""; String path=ObjectUtil.isNotNull(parentCategory)?parentCategory.getCategoryPath():"";
categoryEntity.setCategoryPath( path+"/" + categoryEntity.getCategoryPinyin()); categoryEntity.setCategoryPath( path+"/" + categoryEntity.getCategoryPinyin());
removeVirgule(categoryEntity);
setTopId(categoryEntity); setTopId(categoryEntity);
super.updateById(categoryEntity); super.updateById(categoryEntity);
} }
@ -146,7 +145,6 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
//判断是否有parentIds //判断是否有parentIds
x.setCategoryPath(path+"/"+x.getCategoryPinyin()); x.setCategoryPath(path+"/"+x.getCategoryPinyin());
//去除多余的/符号 //去除多余的/符号
removeVirgule(x);
super.updateEntity(x); super.updateEntity(x);
setChildParentId(x); setChildParentId(x);
}); });
@ -167,20 +165,10 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
} }
setParentLeaf(entity); setParentLeaf(entity);
setTopId(entity); setTopId(entity);
removeVirgule(entity);
super.updateById(entity); super.updateById(entity);
setChildParentId(entity); setChildParentId(entity);
} }
/**去除多余的/符号
* @param entity
*/
private void removeVirgule(CategoryEntity entity) {
if (entity.getCategoryPath().startsWith("/")) {
entity.setCategoryPath(entity.getCategoryPath().substring(1));
}
}
@Override @Override
public void update(CategoryEntity entity) { public void update(CategoryEntity entity) {