【fix sonar】SysCategoryServiceImpl文件

This commit is contained in:
梁琦涛
2023-03-10 15:25:00 +08:00
parent c7158efa5f
commit 971bbb94c6
@@ -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);