|
@@ -2,6 +2,7 @@ package com.usky.system.service.impl;
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.datascope.annotation.DataScope;
|
|
|
+import com.ruoyi.common.datascope.context.DataScopeContextHolder;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.common.core.exception.BusinessException;
|
|
@@ -11,10 +12,13 @@ import com.usky.system.domain.SysDept;
|
|
|
import com.usky.system.domain.SysRole;
|
|
|
import com.usky.system.domain.SysUser;
|
|
|
import com.usky.system.domain.constants.UserConstants;
|
|
|
+import com.usky.system.factory.RemoteLogFallbackFactory;
|
|
|
import com.usky.system.mapper.SysDeptMapper;
|
|
|
import com.usky.system.mapper.SysRoleMapper;
|
|
|
import com.usky.system.service.ISysDeptService;
|
|
|
import com.usky.system.service.vo.TreeSelect;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -33,6 +37,8 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class SysDeptServiceImpl extends AbstractCrudService<SysDeptMapper, SysDept> implements ISysDeptService
|
|
|
{
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(SysDeptServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private SysDeptMapper deptMapper;
|
|
|
|
|
@@ -50,9 +56,18 @@ public class SysDeptServiceImpl extends AbstractCrudService<SysDeptMapper, SysDe
|
|
|
public List<SysDept> selectDeptList(SysDept dept)
|
|
|
{
|
|
|
dept.setTenantId(SecurityUtils.getTenantId());
|
|
|
+ log.debug(DataScopeContextHolder.getDataScopeSql());
|
|
|
return deptMapper.selectDeptList(dept);
|
|
|
}
|
|
|
|
|
|
+ @DataScope(deptAlias = "d")
|
|
|
+ public List<SysDept> selectDeptListByLamda(SysDept dept)
|
|
|
+ {
|
|
|
+// dept.setTenantId(SecurityUtils.getTenantId());
|
|
|
+// log.debug(DataScopeContextHolder.getDataScopeSql());
|
|
|
+// return deptMapper.selectDeptList(dept);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 构建前端所需要树结构
|
|
|
*
|