Commit 80aaca4e authored by shiyu's avatar shiyu

新增子类目

parent d1143050
......@@ -94,14 +94,13 @@ public class CategoryServiceImpl implements CategoryService {
public void create(CategoryVo categoryVo) {
Integer pid = categoryVo.getPid();
Category category = categoryVo.toDo();
if (null != pid) {
Category pCat = new Category();
pCat.setId(pid);
pCat.setIsLeaf(false);
categoryManager.updateById(pCat);
} else {
category.setIsLeaf(true);
}
//父类目设置成非叶子结点
Category pCat = new Category();
pCat.setId(pid);
pCat.setIsLeaf(false);
categoryManager.updateById(pCat);
//新建的类目为叶子节点
category.setIsLeaf(true);
categoryManager.add(category);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment