package com.vci.frameworkcore.compatibility; import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; import com.vci.frameworkcore.pagemodel.SmUserVO; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.PageHelper; import com.vci.starter.web.pagemodel.Tree; import com.vci.starter.web.pagemodel.TreeQueryObject; import java.util.Collection; import java.util.List; import java.util.Map; /** * 用户的查询相关的服务,可以兼容老平台和老的pdm * 其中包含登录相关的接口和参照,根据主键查询等接口 * 所有的数据全部转换为新平台的对象 * @author weidy * @date 2020/3/1 */ public interface SmUserQueryServiceI{ /** * 根据用户名获取用户的对象,不区分大小写 * @param userId 用户名 * @return 用户的显示对象,如果用户不存在则返回null,不会抛出异常 * @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常 */ SmUserVO getUserByUserId(String userId) throws VciBaseException; /** * 批量获取用户的信息(根据用户名) * @param userIdCollections 用户名的集合,可以超过1000个 * @return 用户的显示对象,如果用户不存在则返回空的列表,不会抛出异常 * @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常 */ List listUserByUserIds(Collection userIdCollections) throws VciBaseException; /** * 根据用户主键获取用户的信息 * @param userOid 用户主键 * @return 用户的显示对象,如果用户不存在则返回null,不会抛出异常 * @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常 */ SmUserVO getUserByUserOid(String userOid) throws VciBaseException; /** * 批量获取用户的信息 (根据用户主键) * @param userOidCollections 用户主键的集合,可以超过1000个 * @return 用户的显示对象,如果用户不存在则返回空的列表,不会抛出异常 * @throws VciBaseException 参数为空或者数据库存在问题的时候会抛出异常 */ List listUserByUserOids(Collection userOidCollections) throws VciBaseException; /** * 获取用户的列表,默认会以用户名升序排列,用户的编辑页面列表不要使用这个接口 * @param queryMap 查询条件 * @param pageHelper 分页和排序的信息,在兼容老平台的时候会自动兼容,如果属性不存在会自动忽略 * @return 用户的显示对象列表 * @throws VciBaseException 参数为空的时候会抛出异常 */ DataGrid gridUsers(Map queryMap, PageHelper pageHelper) throws VciBaseException; /** * 根据用户名获取用户的姓名 * @param userId 用户名 * @return 用户姓名,如果不存在会返回Null */ String getUserNameByUserId(String userId); /** * 根据用户主键获取用户的姓名 * @param userOid 用户主键 * @return 用户姓名,如果不存在会返回null */ String getUserNameByUserOid(String userOid); /** * 查询某个部门下的用户对象 * @param deptOid 部门的主键 * @param queryMap 查询条件,如果是部门的某个属性作为查询条件,则可以使用pkDepartment.xxx这样的方式 * @return 用户的显示对象列表 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ List listUserByDeptOid(String deptOid, Map queryMap) throws VciBaseException; /** * 查询某个部门下的用户对象列表 * @param deptOid 部门的主键 * @param queryMap 查询条件,如果是部门的某个属性作为查询条件,则可以使用pkDepartment.xxx这样的方式 * @param pageHelper 分页和排序信息,默认使用用户名升序排列 * @return 用户的显示对象列表,默认使用用户名升序排列 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ DataGrid gridUserByDeptOid(String deptOid, Map queryMap, PageHelper pageHelper) throws VciBaseException; /** * 批量根据部门的主键获取用户 * @param deptOidCollection 部门的主键集合 * @return 部门主键和对应的用户显示对象列表的映射,key部门的主键,value是这个部门下的用户 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ Map> batchListUserByDeptOids(Collection deptOidCollection) throws VciBaseException; /** * 查询不在某个部门下的用户对象列表 * @param deptOid 部门的主键 * @param queryMap 查询条件,如果是部门的某个属性作为查询条件,则可以使用pkDepartment.xxx这样的方式 * @return 用户的显示对象列表,默认使用用户名升序排列 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ List listUserUnInDeptOid(String deptOid, Map queryMap) throws VciBaseException; /** * 查询不在某个部门下的用户对象列表 * @param deptOid 部门的主键 * @param queryMap 查询条件,如果是部门的某个属性作为查询条件,则可以使用pkDepartment.xxx这样的方式 * @param pageHelper 分页和排序信息,默认使用用户名升序排列 * @return 用户的显示对象列表,默认使用用户名升序排列 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ DataGrid gridUserUnInDeptOid(String deptOid, Map queryMap, PageHelper pageHelper) throws VciBaseException; /** * 查询某个角色下的用户对象 * @param roleOid 角色的主键 * @param queryMap 查询条件,如果是角色的某个属性作为查询条件,则可以使用pkRole.xxx这样的方式 * @return 用户的显示对象列表 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ List listUserByRoleOid(String roleOid, Map queryMap) throws VciBaseException; /** * 查询某个角色下的用户对象列表 * @param roleOid 角色的主键 * @param queryMap 查询条件,如果是角色的某个属性作为查询条件,则可以使用pkRole.xxx这样的方式 * @param pageHelper 分页和排序信息,默认使用用户名升序排列 * @return 用户的显示对象列表,默认使用用户名升序排列 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ DataGrid gridUserByRoleOid(String roleOid, Map queryMap, PageHelper pageHelper) throws VciBaseException; /** * 查询不在某个角色下的用户对象列表 * @param roleOid 角色的主键 * @param queryMap 查询条件,如果是角色的某个属性作为查询条件,则可以使用pkRole.xxx这样的方式 * @return 用户的显示对象列表,默认使用用户名升序排列 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ List listUserUnInRoleOid(String roleOid, Map queryMap) throws VciBaseException; /** * 查询不在某个角色下的用户对象列表 * @param roleOid 角色的主键 * @param queryMap 查询条件,如果是角色的某个属性作为查询条件,则可以使用pkRole.xxx这样的方式 * @param pageHelper 分页和排序信息,默认使用用户名升序排列 * @return 用户的显示对象列表,默认使用用户名升序排列 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ DataGrid gridUserUnInRoleOid(String roleOid, Map queryMap, PageHelper pageHelper) throws VciBaseException; /** * 批量根据角色的主键获取用户 * @param roleOidCollection 角色的主键集合 * @return 角色主键和对应的用户显示对象列表的映射,key角色的主键,value是这个角色下的用户 * @throws VciBaseException 参数为空或者查询出错的时候会抛出异常 */ Map> batchListUserByRoleOids(Collection roleOidCollection) throws VciBaseException; /** * 参照生效的用户 * @param queryMap 查询条件 * @param pageHelper 分页对象 * @return 用户的显示对象,默认使用用户名升序排列 * @throws VciBaseException 查询出错的时候会抛出异常 */ DataGrid refGridUsers(Map queryMap, PageHelper pageHelper) throws VciBaseException; /** * 参照用户的树形显示 * @param treeQueryObject 树型接口查询对象 * @return 用户的树形信息,里面会包含用户对象里的所有属性 * @throws VciBaseException 查询出错的时候会抛出异常 */ List refTreeUsers(TreeQueryObject treeQueryObject) throws VciBaseException; /** * 校验密码是否相同,在新平台中存储的密码是两次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 userOid 用户的主键 * @return 密码安全策略的显示对象,如果不存在则会返回Null * @throws VciBaseException 参数为空或者数据库查询出错的时候会抛出异常 */ SmPasswordStrategyVO getPasswordStrategyVOByUserOid(String userOid) throws VciBaseException; /** * 设置某个用户是锁定状态 * @param userId 用户名 */ void lockUser(String userId); /** * 设置某个用户不是锁定状态 * @param userId 用户名 */ void unLockUser(String userId); /** * 修改密码 * @param userOid 用户主键 * @param password 新的密码 * @param confirmPassword 确认密码 */ void changePassword(String userOid, String password, String confirmPassword) throws VciBaseException; /** * 更新用户的密码错误次数 * @param userOid 用户的主键 * @param wrongCount 密码的错误次数 * @throws VciBaseException 参数为空或者存储到数据库中出错的时候会抛出异常 */ void updateUserPwdWrongCount(String userOid, int wrongCount) throws VciBaseException; /** * 更新用户的最后登录时间 * @param userOid 用户的主键 * @throws VciBaseException 参数为空的时候会抛出异常 */ void updateUserLoginTime(String userOid) throws VciBaseException; }