mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-20 15:56:02 +08:00
修复新增树节点无法添加父节点path的问题导致不能级联删除
This commit is contained in:
@@ -64,7 +64,7 @@ public abstract class AbstractTreeSortService<E extends TreeSortSupportEntity<PK
|
||||
}
|
||||
|
||||
protected void applyPath(E entity) {
|
||||
if (!StringUtils.isEmpty(entity.getParentId())) {
|
||||
if (StringUtils.isEmpty(entity.getParentId())) {
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.isEmpty(entity.getPath())) {
|
||||
@@ -125,11 +125,11 @@ public abstract class AbstractTreeSortService<E extends TreeSortSupportEntity<PK
|
||||
public PK saveOrUpdateForSingle(E entity) {
|
||||
assertNotNull(entity);
|
||||
PK id = entity.getId();
|
||||
applyPath(entity);
|
||||
if (null == id || this.selectByPk(id) == null) {
|
||||
if (null == id) {
|
||||
entity.setId(getIDGenerator().generate());
|
||||
}
|
||||
applyPath(entity);
|
||||
return super.insert(entity);
|
||||
}
|
||||
super.updateByPk(entity);
|
||||
|
||||
Reference in New Issue
Block a user