判空bug

This commit is contained in:
CD
2022-11-04 19:07:59 +08:00
parent 3bb6e45f23
commit 02a3b6cc55
@@ -15,6 +15,7 @@ import com.adc.da.slrs.sarRole.service.ITsRoleService;
import com.adc.da.sys.entity.UserEO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@@ -104,7 +105,7 @@ public class TsRoleController extends BaseController<TsRole> {
// tsRole.setParent(parent.getName());
// }
TsRole tsRole=tsRoleDao.getAllDatas(roleId);
if(tsRole.getParentId()!=null){
if(ObjectUtils.isNotEmpty(tsRole.getParentId())){
TsRole parent=tsRoleDao.getAllDatas(tsRole.getParentId());
tsRole.setParent(parent.getName());
}