Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
5694c5d7
Commit
5694c5d7
authored
Oct 20, 2021
by
mingsoft
Browse files
栏目子节点bug修复
parent
d6354983
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/cms/action/CategoryAction.java
View file @
5694c5d7
...
@@ -288,8 +288,8 @@ public class CategoryAction extends BaseAction {
...
@@ -288,8 +288,8 @@ public class CategoryAction extends BaseAction {
}
}
//判断是否选择子级为所属栏目
//判断是否选择子级为所属栏目
CategoryEntity
_category
=
new
CategoryEntity
();
CategoryEntity
_category
=
new
CategoryEntity
();
_category
.
set
CategoryParent
Id
s
(
category
.
getId
());
_category
.
setId
(
category
.
getId
());
List
<
CategoryEntity
>
categoryList
=
categoryBiz
.
queryChild
s
(
_category
);
List
<
CategoryEntity
>
categoryList
=
categoryBiz
.
queryChild
ren
(
_category
);
if
(
categoryList
.
size
()>
0
)
{
if
(
categoryList
.
size
()>
0
)
{
for
(
CategoryEntity
item:
categoryList
){
for
(
CategoryEntity
item:
categoryList
){
if
(
item
.
getId
().
equals
(
category
.
getCategoryId
())){
if
(
item
.
getId
().
equals
(
category
.
getCategoryId
())){
...
@@ -330,7 +330,7 @@ public class CategoryAction extends BaseAction {
...
@@ -330,7 +330,7 @@ public class CategoryAction extends BaseAction {
}
}
category
=
categoryBiz
.
getById
(
category
.
getId
());
category
=
categoryBiz
.
getById
(
category
.
getId
());
category
.
setCategoryParentIds
(
null
);
category
.
setCategoryParentIds
(
null
);
List
<
CategoryEntity
>
childs
=
categoryBiz
.
queryChild
s
(
category
);
List
<
CategoryEntity
>
childs
=
categoryBiz
.
queryChild
ren
(
category
);
//更新与父节点相同类型的子栏目的模板内容
//更新与父节点相同类型的子栏目的模板内容
for
(
int
i
=
0
;
i
<
childs
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
childs
.
size
();
i
++)
{
if
(
childs
.
get
(
i
).
getCategoryType
().
equals
(
category
.
getCategoryType
()))
{
if
(
childs
.
get
(
i
).
getCategoryType
().
equals
(
category
.
getCategoryType
()))
{
...
...
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
5694c5d7
...
@@ -165,7 +165,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -165,7 +165,7 @@ public class GeneraterAction extends BaseAction {
}
else
{
//选择栏目更新
}
else
{
//选择栏目更新
CategoryEntity
categoryEntity
=
new
CategoryEntity
();
CategoryEntity
categoryEntity
=
new
CategoryEntity
();
categoryEntity
.
setId
(
categoryId
);
categoryEntity
.
setId
(
categoryId
);
columns
=
categoryBiz
.
queryChild
s
(
categoryEntity
);
columns
=
categoryBiz
.
queryChild
ren
(
categoryEntity
);
}
}
//文章列表
//文章列表
...
@@ -241,7 +241,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -241,7 +241,7 @@ public class GeneraterAction extends BaseAction {
}
else
{
//选择栏目更新
}
else
{
//选择栏目更新
CategoryEntity
categoryEntity
=
new
CategoryEntity
();
CategoryEntity
categoryEntity
=
new
CategoryEntity
();
categoryEntity
.
setId
(
columnId
);
categoryEntity
.
setId
(
columnId
);
categoryList
=
categoryBiz
.
queryChild
s
(
categoryEntity
);
categoryList
=
categoryBiz
.
queryChild
ren
(
categoryEntity
);
}
}
for
(
CategoryEntity
category
:
categoryList
)
{
for
(
CategoryEntity
category
:
categoryList
)
{
...
...
src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java
View file @
5694c5d7
...
@@ -36,10 +36,10 @@ public interface ICategoryBiz extends IBaseBiz<CategoryEntity> {
...
@@ -36,10 +36,10 @@ public interface ICategoryBiz extends IBaseBiz<CategoryEntity> {
/**
/**
* 查询当前分类下的所有子分类,包含自身
* 查询当前分类下的所有子分类,包含自身
* @param category
* @param category
通过setId指定栏目id
* @return
* @return
*/
*/
List
<
CategoryEntity
>
queryChild
s
(
CategoryEntity
category
);
List
<
CategoryEntity
>
queryChild
ren
(
CategoryEntity
category
);
void
saveEntity
(
CategoryEntity
entity
);
void
saveEntity
(
CategoryEntity
entity
);
...
...
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
View file @
5694c5d7
...
@@ -67,7 +67,7 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
...
@@ -67,7 +67,7 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
}
}
@Override
@Override
public
List
<
CategoryEntity
>
queryChild
s
(
CategoryEntity
category
)
{
public
List
<
CategoryEntity
>
queryChild
ren
(
CategoryEntity
category
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
return
categoryDao
.
queryChildren
(
category
);
return
categoryDao
.
queryChildren
(
category
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment