package com.vci.web.service;
|
|
import com.vci.corba.common.PLException;
|
import com.vci.dto.SmUserDTO;
|
import com.vci.pagemodel.SmUserVO;
|
import com.vci.starter.web.exception.VciBaseException;
|
import com.vci.starter.web.pagemodel.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import java.io.File;
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* 用户的查询相关的服务,可以兼容老平台和老的pdm
|
* 其中包含登录相关的接口和参照,根据主键查询等接口
|
* 所有的数据全部转换为新平台的对象
|
* @author weidy
|
* @date 2020/3/1
|
*/
|
public interface SmUserQueryServiceI{
|
|
/**
|
* 检查用户是否存在,可以根据用户名,也可以根据用户oid
|
* @param userName 传null,即用oid作为检查条件
|
* @param oid 传null,即用userName作为检查条件
|
* @return true存在,false不存在
|
*/
|
boolean checkUserExist(String userName,String oid) throws PLException;
|
|
/**
|
* 根据用户名获取用户的对象,不区分大小写
|
* @param userId 用户名
|
* @return 用户的显示对象,如果用户不存在则返回null,不会抛出异常
|
* @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常
|
*/
|
SmUserVO getUserByUserId(String userId);
|
|
/**
|
* 批量获取用户的信息(根据用户名)
|
* @param userIdCollections 用户名的集合,可以超过1000个
|
* @return 用户的显示对象,如果用户不存在则返回空的列表,不会抛出异常
|
* @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常
|
*/
|
List<SmUserVO> listUserByUserIds(Collection<String> userIdCollections);
|
|
/**
|
* 根据用户主键获取用户的信息
|
* @param userOid 用户主键
|
* @return 用户的显示对象,如果用户不存在则返回null,不会抛出异常
|
* @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常
|
*/
|
SmUserVO getUserByUserOid(String userOid);
|
|
/**
|
* 批量获取用户的信息 (根据用户主键)
|
* @param userOidCollections 用户主键的集合,可以超过1000个
|
* @return 用户的显示对象,如果用户不存在则返回空的列表,不会抛出异常
|
* @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常
|
*/
|
List<SmUserVO> listUserByUserOids(Collection<String> userOidCollections);
|
|
/**
|
* 用户管理界面分页查询
|
* @param conditionMap 查询条件
|
* @param pageHelper 分页参数
|
* @return
|
*/
|
DataGrid<SmUserVO> getDataGridUsers(Map<String, String> conditionMap, PageHelper pageHelper);
|
|
/**
|
* 根据用户名获取用户的姓名
|
* @param userId 用户名
|
* @return 用户姓名,如果不存在会返回Null
|
*/
|
String getUserNameByUserId(String userId);
|
|
/**
|
* 根据用户主键获取用户的姓名
|
* @param userOid 用户主键
|
* @return 用户姓名,如果不存在会返回null
|
*/
|
String getUserNameByUserOid(String userOid);
|
|
/**
|
* 批量根据部门的主键获取用户
|
* @param deptOidCollection 部门的主键集合
|
* @return 部门主键和对应的用户显示对象列表的映射,key部门的主键,value是这个部门下的用户
|
* @throws VciBaseException 参数为空或者查询出错的时候会抛出异常
|
*/
|
Map<String,List<SmUserVO>> batchListUserByDeptOids(Collection<String> deptOidCollection);
|
|
/**
|
* 统计部门下的用户:包含子部门下的用户
|
* @param deptOid
|
* @param queryMap
|
* @return
|
* @throws VciBaseException
|
*/
|
List<SmUserVO> countSmUserByDeptOid(String deptOid, Map<String, String> queryMap);
|
|
/**
|
* 查询某个部门下的用户对象
|
* @param deptOid 部门的主键
|
* @param queryMap 查询条件,如果是部门的某个属性作为查询条件,则可以使用pkDepartment.xxx这样的方式
|
* @return 用户的显示对象列表
|
* @throws VciBaseException 参数为空或者查询出错的时候会抛出异常
|
*/
|
List<SmUserVO> listUserByDeptOid(String deptOid, Map<String, String> queryMap);
|
|
/**
|
* 查询不在某个部门下的用户对象列表
|
* @param deptOid 部门的主键
|
* @param queryMap 查询条件,如果是部门的某个属性作为查询条件,则可以使用pkDepartment.xxx这样的方式
|
* @return 用户的显示对象列表,默认使用用户名升序排列
|
* @throws VciBaseException 参数为空或者查询出错的时候会抛出异常
|
*/
|
List<SmUserVO> listUserUnInDeptOid(String deptOid, Map<String, String> queryMap);
|
|
/**
|
* 查询某个角色下的用户对象列表
|
* @param roleOid 角色的主键
|
* @param queryMap 查询条件,如果是角色的某个属性作为查询条件,则可以使用pkRole.xxx这样的方式
|
* @return 用户的显示对象列表
|
* @throws VciBaseException 参数为空或者查询出错的时候会抛出异常
|
*/
|
List<SmUserVO> listUserByRoleOid(String roleOid, Map<String, String> queryMap);
|
|
/**
|
* 查询不在某个角色下的用户对象列表
|
* @param roleOid 角色的主键
|
* @param queryMap 查询条件,如果是角色的某个属性作为查询条件,则可以使用pkRole.xxx这样的方式
|
* @return 用户的显示对象列表,默认使用用户名升序排列
|
* @throws VciBaseException 参数为空或者查询出错的时候会抛出异常
|
*/
|
List<SmUserVO> listUserUnInRoleOid(String roleOid, Map<String, String> queryMap);
|
|
/**
|
* 批量根据角色的主键获取用户
|
* @param roleOidCollection 角色的主键集合
|
* @return 角色主键和对应的用户显示对象列表的映射,key角色的主键,value是这个角色下的用户
|
* @throws VciBaseException 参数为空或者查询出错的时候会抛出异常
|
*/
|
Map<String,List<SmUserVO>> batchListUserByRoleOids(Collection<String> roleOidCollection);
|
|
/**
|
* 参照生效的用户
|
* @param queryMap 查询条件
|
* @param pageHelper 分页对象
|
* @return 用户的显示对象,默认使用用户名升序排列
|
* @throws VciBaseException 查询出错的时候会抛出异常
|
*/
|
DataGrid<SmUserVO> refGridUsers(Map<String, String> queryMap, PageHelper pageHelper);
|
|
/**
|
* 参照用户的树形显示
|
* @param treeQueryObject 树型接口查询对象
|
* @return 用户的树形信息,里面会包含用户对象里的所有属性
|
* @throws VciBaseException 查询出错的时候会抛出异常
|
*/
|
List<Tree> refTreeUsers(TreeQueryObject treeQueryObject);
|
|
/**
|
* 人员权限选择树
|
* @param treeQueryObject
|
* @return
|
* @throws VciBaseException
|
*/
|
List<Tree> refPersonOrgTree(TreeQueryObject treeQueryObject);
|
|
/**
|
* 校验密码是否相同,在新平台中存储的密码是两次md5
|
* @param userOid 用户主键
|
* @param md5Password 已经md5加密一次的密码
|
* @return true 表示相等,false表示不相等
|
*/
|
boolean checkPasswordEqual(String md5Password, String userOid);
|
|
/**
|
* 校验用户是否锁定
|
* @param smUserVO 用户对象
|
* @param wrongCount 密码错误次数,如果wrongCount为空时,会校验用户本身是否已经锁定了
|
* @return true表示已经锁定
|
*/
|
boolean checkUserLock(SmUserVO smUserVO, Integer wrongCount);
|
|
/**
|
* 设置某个用户是锁定状态
|
* @param userId 用户名
|
*/
|
void lockUser(String userId);
|
|
/**
|
* 设置某个用户不是锁定状态
|
* @param userId 用户名
|
*/
|
void unLockUser(String userId);
|
|
/**
|
* 修改密码
|
* @param userName 用户主键
|
* @param oldPassword 旧的密码
|
* @param password 新的密码
|
* @param confirmPassword 确认密码
|
*/
|
boolean changePassword(String userName,String oldPassword, String password, String confirmPassword) throws Exception;
|
|
/**
|
* 更新用户的密码错误次数
|
* @param userOid 用户的主键
|
* @param wrongCount 密码的错误次数
|
* @throws VciBaseException 参数为空或者存储到数据库中出错的时候会抛出异常
|
*/
|
void updateUserPwdWrongCount(String userOid, int wrongCount);
|
|
/**
|
* 更新用户的最后登录时间
|
* @param userOid 用户的主键
|
* @throws VciBaseException 参数为空的时候会抛出异常
|
*/
|
void updateUserLoginTime(String userOid);
|
|
/**
|
* 添加用户
|
* @param smUserDTO
|
* @return
|
*/
|
boolean addUser(SmUserDTO smUserDTO) throws PLException;
|
|
/**
|
* 修改用户
|
* @param smUserDTO
|
* @return
|
*/
|
boolean updateUser(SmUserDTO smUserDTO) throws PLException;
|
|
/**
|
* 删除用户
|
* @param ids
|
* @return
|
*/
|
boolean deleteUser(String[] ids) throws PLException;
|
|
/**
|
* 用户停用/启用
|
* @param ids
|
* @param flag
|
* @return
|
*/
|
boolean stopUsers(String[] ids,boolean flag) throws PLException;
|
|
/**
|
* 下载导入人员的excel模板。
|
* @param downloadFileName
|
* @return
|
*/
|
String downloadImportTemplate(String downloadFileName);
|
|
/**
|
* 导入成员
|
* @param file
|
* @return
|
* @throws VciBaseException
|
*/
|
BaseResult importUser(File file) throws Exception;
|
|
/**
|
* 根据角色类型查询用户名
|
* @param roleType
|
* @return
|
*/
|
List<String> queryUserNameByRoleType(String roleType);
|
|
/**
|
* 使用当前用户的类型查询用户
|
* @return
|
* @throws VciBaseException
|
*/
|
List<SmUserVO> listUserByUserType(Integer type) throws PLException;
|
|
/**
|
* 导出用户列表三员账号除外
|
* @return
|
*/
|
String expUser() throws PLException;
|
/**
|
* 修改用户头像
|
* @param file 文件
|
* @return
|
*/
|
boolean updateUserPhoto(MultipartFile file) throws PLException;
|
|
String getUserPhoto() throws PLException;
|
}
|