|
@@ -2,12 +2,13 @@ package org.eco.system.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.secure.BCrypt;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import org.eco.system.domain.SysUser;
|
|
|
-import org.eco.system.domain.SysUserPost;
|
|
|
-import org.eco.system.domain.bo.SysUserBo;
|
|
|
-import org.eco.system.service.ISysConfigService;
|
|
|
-import org.eco.system.service.ISysUserPostService;
|
|
|
-import org.eco.system.service.ISysUserService;
|
|
|
+import com.mybatisflex.core.paginate.Page;
|
|
|
+import com.mybatisflex.core.query.QueryMethods;
|
|
|
+import com.mybatisflex.core.query.QueryWrapper;
|
|
|
+import com.mybatisflex.core.update.UpdateChain;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.validation.Validator;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.eco.common.core.constant.CacheNames;
|
|
|
import org.eco.common.core.constant.UserConstants;
|
|
|
import org.eco.common.core.core.page.PageResult;
|
|
@@ -21,21 +22,20 @@ import org.eco.common.orm.core.page.PageQuery;
|
|
|
import org.eco.common.orm.core.service.impl.BaseServiceImpl;
|
|
|
import org.eco.common.security.utils.LoginHelper;
|
|
|
import org.eco.common.tenant.helper.TenantHelper;
|
|
|
+import org.eco.system.domain.SysUser;
|
|
|
+import org.eco.system.domain.SysUserPost;
|
|
|
+import org.eco.system.domain.bo.SysUserBo;
|
|
|
import org.eco.system.domain.vo.SysPostVo;
|
|
|
import org.eco.system.domain.vo.SysRoleVo;
|
|
|
import org.eco.system.domain.vo.SysUserVo;
|
|
|
import org.eco.system.mapper.SysUserMapper;
|
|
|
+import org.eco.system.service.ISysConfigService;
|
|
|
import org.eco.system.service.ISysDataScopeService;
|
|
|
import org.eco.system.service.ISysPostService;
|
|
|
import org.eco.system.service.ISysRoleService;
|
|
|
+import org.eco.system.service.ISysUserPostService;
|
|
|
import org.eco.system.service.ISysUserRoleService;
|
|
|
-import com.mybatisflex.core.paginate.Page;
|
|
|
-import com.mybatisflex.core.query.QueryMethods;
|
|
|
-import com.mybatisflex.core.query.QueryWrapper;
|
|
|
-import com.mybatisflex.core.update.UpdateChain;
|
|
|
-import jakarta.annotation.Resource;
|
|
|
-import jakarta.validation.Validator;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.eco.system.service.ISysUserService;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -47,12 +47,13 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.mybatisflex.core.query.QueryMethods.findInSet;
|
|
|
+import static com.mybatisflex.core.query.QueryMethods.number;
|
|
|
+import static com.mybatisflex.core.query.QueryMethods.select;
|
|
|
import static org.eco.system.domain.table.SysDeptTableDef.SYS_DEPT;
|
|
|
import static org.eco.system.domain.table.SysRoleTableDef.SYS_ROLE;
|
|
|
import static org.eco.system.domain.table.SysUserRoleTableDef.SYS_USER_ROLE;
|
|
|
import static org.eco.system.domain.table.SysUserTableDef.SYS_USER;
|
|
|
-import static com.mybatisflex.core.query.QueryMethods.findInSet;
|
|
|
-import static com.mybatisflex.core.query.QueryMethods.number;
|
|
|
|
|
|
/**
|
|
|
* 用户 业务层处理
|
|
@@ -119,21 +120,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser>
|
|
|
}
|
|
|
|
|
|
private QueryWrapper buildOneQueryWrapper() {
|
|
|
- /* select u.user_id, u.tenant_id,u.dept_id, u.user_name, u.nick_name, u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.gender, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
|
|
- d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
|
|
- r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
|
|
- from sys_user u
|
|
|
- left join sys_dept d on u.dept_id = d.dept_id
|
|
|
- left join sys_user_role ur on u.user_id = ur.user_id
|
|
|
- left join sys_role r on r.role_id = ur.role_id */
|
|
|
- /*return QueryWrapper.create()
|
|
|
- .select(QueryMethods.distinct(SYS_USER.USER_ID,SYS_USER.TENANT_ID,SYS_USER.DEPT_ID,SYS_USER.NICK_NAME,SYS_USER.USER_NAME,SYS_USER.USER_TYPE,SYS_USER.EMAIL,SYS_USER.AVATAR,SYS_USER.PHONENUMBER,SYS_USER.PASSWORD,SYS_USER.GENDER,SYS_USER.STATUS,SYS_USER.DEL_FLAG,SYS_USER.LOGIN_IP,SYS_USER.LOGIN_DATE,SYS_USER.CREATE_BY,SYS_USER.CREATE_TIME,SYS_USER.REMARK,
|
|
|
- SYS_DEPT.DEPT_ID,SYS_DEPT.PARENT_ID,SYS_DEPT.ANCESTORS,SYS_DEPT.DEPT_NAME,SYS_DEPT.ORDER_NUM,SYS_DEPT.LEADER,SYS_DEPT.STATUS.as("dept_status"),
|
|
|
- SYS_ROLE.ROLE_ID,SYS_ROLE.ROLE_NAME,SYS_ROLE.ROLE_KEY,SYS_ROLE.ROLE_SORT,SYS_ROLE.DATA_SCOPE,SYS_ROLE.STATUS.as("role_status")))
|
|
|
- .from(SYS_USER.as("u"))
|
|
|
- .leftJoin(SYS_DEPT).as("d").on(SYS_DEPT.DEPT_ID.eq(SYS_USER.DEPT_ID))
|
|
|
- .leftJoin(SYS_USER_ROLE).as("ur").on(SYS_USER_ROLE.USER_ID.eq(SYS_USER.USER_ID))
|
|
|
- .leftJoin(SYS_ROLE).as("r").on(SYS_ROLE.ROLE_ID.eq(SYS_USER_ROLE.ROLE_ID));*/
|
|
|
return QueryWrapper.create()
|
|
|
.select(QueryMethods.distinct(SYS_USER.USER_ID, SYS_USER.TENANT_ID, SYS_USER.DEPT_ID, SYS_USER.NICK_NAME, SYS_USER.USER_NAME, SYS_USER.USER_TYPE, SYS_USER.EMAIL, SYS_USER.AVATAR, SYS_USER.PHONENUMBER, SYS_USER.PASSWORD, SYS_USER.GENDER, SYS_USER.STATUS, SYS_USER.VERSION, SYS_USER.DEL_FLAG, SYS_USER.LOGIN_IP, SYS_USER.LOGIN_DATE, SYS_USER.CREATE_BY, SYS_USER.CREATE_TIME, SYS_USER.REMARK,
|
|
|
SYS_DEPT.DEPT_ID, SYS_DEPT.PARENT_ID, SYS_DEPT.ANCESTORS, SYS_DEPT.DEPT_NAME, SYS_DEPT.ORDER_NUM, SYS_DEPT.LEADER, SYS_DEPT.STATUS.as("dept_status")
|
|
@@ -141,8 +127,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, SysUser>
|
|
|
.from(SYS_USER.as("u"))
|
|
|
.leftJoin(SYS_DEPT).as("d").on(SYS_DEPT.DEPT_ID.eq(SYS_USER.DEPT_ID))
|
|
|
.where(SYS_USER.DEL_FLAG.eq(0));
|
|
|
- //.leftJoin(SYS_USER_ROLE).as("ur").on(SYS_USER_ROLE.USER_ID.eq(SYS_USER.USER_ID))
|
|
|
- //.leftJoin(SYS_ROLE).as("r").on(SYS_ROLE.ROLE_ID.eq(SYS_USER_ROLE.ROLE_ID));
|
|
|
}
|
|
|
|
|
|
|