package cn.estsh.i3plus.core.api.iservice.busi;

import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.model.platform.UserDetailModel;
import cn.estsh.i3plus.pojo.platform.bean.*;
import io.swagger.annotations.ApiOperation;

import java.util.List;

/**
 * @Description :人员业务服务接口
 * @Reference :
 * @Author : Adair Peng
 * @CreateDate : 2018-12-22 16:15
 * @Modify:
 **/
public interface IPersonnelService {

    @ApiOperation(value = "保存账号")
    SysUser saveSysUser(SysUser user);

    @ApiOperation(value = "保存用户")
    SysUserInfo saveSysUserInfo(SysUserInfo info);

    @ApiOperation(value = "更新用户状态")
    void updateSysUserInfoStatus(Long userInfoId,Integer status);

    @ApiOperation(value = "删除账号信息")
    void deleteSysUser(Long[] userIdList,String userName);

    @ApiOperation(value = "删除用户信息")
    void deleteSysUserInfo(Long[] infoIdList,String userName);

    @ApiOperation(value = "获取账号信息")
    SysUser getSysUserById(Long id);

    @ApiOperation(value = "查询账号信息")
    List<SysUser> findSysUserByIds(Long[] ids);

    @ApiOperation(value = "查询账号信息")
    List<SysUser> querySysUserByUserDetailModelOrIds(UserDetailModel model, List<Long> ids);

    @ApiOperation(value = "查询账号信息")
    ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List<Long> ids);

    @ApiOperation(value = "获取用户信息")
    SysUserInfo getSysUserInfoById(Long id);

    @ApiOperation(value = "获取部门")
    SysDepartment getSysDepartmentById(Long id);

    @ApiOperation(value = "获取岗位")
    SysPosition getSysPositionById(Long id);

    @ApiOperation(value = "获取组织")
    SysOrganize getSysOrganizeById(Long id);

    @ApiOperation(value = "用户登录")
    SessionUser queryUserLogin(String userName, String password, String languageCode);

    @ApiOperation(value = "查询用户信息")
    ListPager<SysUserInfo> querySysUserInfo(UserDetailModel model, Pager pager);

    @ApiOperation(value = "查询用户信息")
    List<SysUserInfo> findSysUserInfoByIds(Long[] ids);

    @ApiOperation(value = "查询账号角色关系")
    List<SysRefUserRole> findSysRefUserRoleById(Long userId);

    @ApiOperation(value = "查询账号部门关系")
    List<SysRefUserDepartment> findSysRefUserDepartmentById(Long userId);

    @ApiOperation(value = "查询账号部门关系")
    List<SysRefUserDepartment> querySysRefUserDepartmentByUserDetailModel(UserDetailModel model);

    @ApiOperation(value = "查询用户部门关系")
    List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentById(Long infoId);

    @ApiOperation(value = "查询用户部门关系")
    List<SysDepartment> findSysUserInfoDepartmentByInfoId(Long infoId);

    @ApiOperation(value = "查询账号部门关系")
    List<SysDepartment> findSysUserDepartmentByInfoId(Long infoId);

    @ApiOperation(value = "查询用户部门关系")
    List<SysOrganize> findSysUserInfoOrganize(Long infoId);

    @ApiOperation(value = "查询账户组织关系")
    List<SysOrganize> findSysUserOrganize(Long infoId);

    @ApiOperation(value = "查询用户岗位关系")
    List<SysRefUserPosition> findSysRefUserPositionById(Long infoId);

    @ApiOperation(value = "封装用户信息",notes = "封装登录完成后的用户信息(角色、权限、部门、操作部门、组织、岗位)")
    SessionUser packSessionUser(SessionUser sessionUser, SysUser user, Integer userType, String languageCode);

    @ApiOperation(value = "账号唯一检查")
    void checkSysUserOnly(SysUser user);

    @ApiOperation(value = "重置密码检查")
    Integer checkSysUserResetPassword(SysUser user);

    @ApiOperation(value = "岗位关系检查")
    void checkSysPositionRef(Long positionId);

    @ApiOperation(value = "部门关系检查")
    void checkSysDepartmentRef(Long departmentId);

    @ApiOperation(value = "组织关系检查")
    void checkSysOrganizeRef(Long organizeId);

    @ApiOperation(value = "密码规则校验")
    void checkSysUserPassword(String password);

    @ApiOperation(value = "菜单关系检查")
    void refreshMenuRdd(Long menuId);

    @ApiOperation(value = "岗位关系检查")
    void refreshUpdateMenuRdd(Long menuId);

    @ApiOperation(value = "刷新组织冗余")
    void refreshOrganizeRdd(Long organizeId);

    @ApiOperation(value = "刷新组织冗余")
    void refreshUpdateOrganizeRdd(Long organizeId);

    @ApiOperation(value = "刷新账号部门")
    void refreshRefSysUserDepartment(Long userId, Long[] departmentIds);

    @ApiOperation(value = "刷新账号角色")
    void refreshRefSysUserRole(Long userId, Long[] roleIds);

    @ApiOperation(value = "刷新角色冗余")
    void refreshUpdateSysRoleRdd(Long roleId);

    @ApiOperation(value = "刷新组织冗余")
    void refreshDepartmentRdd(Long departmentId);

    @ApiOperation(value = "刷新账号部门")
    void refreshUpdateRefSysUserDepartmentRdd(Long departmentId);

    @ApiOperation(value = "刷新用户部门")
    void refreshUpdateRefSysUserInfoDepartment(Long userInfoId, Long[] departmentIds);

    @ApiOperation(value = "刷新用户部门")
    void refreshUpdateRefSysUserInfoDepartmentRdd(Long departmentId);

    @ApiOperation(value = "刷新岗位冗余")
    void refreshPositionRdd(Long positionId);

    @ApiOperation(value = "刷新用户岗位")
    void refreshRefSysUserInfoPosition(Long userInfoId, Long[] positionIds);

    @ApiOperation(value = "刷新用户岗位")
    void refreshUpdateRefSysUserInfoPositionRdd(Long positionId);

}
