【fix sonar】SysCategoryServiceImpl文件
This commit is contained in:
-2
@@ -35,14 +35,12 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
public void addSysCategory(SysCategory sysCategory) {
|
||||
String categoryCode = "";
|
||||
String categoryPid = ISysCategoryService.ROOT_PID_VALUE;
|
||||
// String parentCode = null;
|
||||
if (oConvertUtils.isNotEmpty(sysCategory.getPid())) {
|
||||
categoryPid = sysCategory.getPid();
|
||||
|
||||
//PID 不是根节点 说明需要设置父节点 hasChild 为1
|
||||
if (!ISysCategoryService.ROOT_PID_VALUE.equals(categoryPid)) {
|
||||
SysCategory parent = baseMapper.selectById(categoryPid);
|
||||
// parentCode = parent.getCode();
|
||||
if (parent != null && !"1".equals(parent.getHasChild())) {
|
||||
parent.setHasChild("1");
|
||||
baseMapper.updateById(parent);
|
||||
|
||||
Reference in New Issue
Block a user