package com.unis.crk.basic.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.unis.crk.basic.entity.UserInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.unis.crk.basic.entity.vo.UserAndRoleInfo;
import com.unis.crk.basic.entity.vo.UserInfoVo;


import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author ghh
 * @since 2021-09-26
 */
public interface IUserInfoService extends IService<UserInfo> {

    List<Map<Object, Object>> queryAuditUser(Map<Object, Object> map);

    boolean validUsername(String userId, String username);

    String queryPhoneByusername(String username);

    String validPhone(String phoneNumber, String userId);

    boolean validPassword(String resPassword, String oldPassword);

    void resetPassword(String userId, String userPwd);

    List<UserInfo> findAllUserByOrgId(String orgId);

    IPage<Map<String, Object>> queryAllByOrgClass(Page<UserInfo> objectPage,QueryWrapper<UserInfo> userInfoQueryWrapper);


    UserInfoVo selectUserInfoVoById(String userId);

    IPage<Map<String,Object>> queryAll(Page<UserAndRoleInfo> p, QueryWrapper<UserAndRoleInfo> userAndRoleInfoQueryWrapper);

    /**
     * 单点登录
     * @param code
     * @return
     */
    JSONObject ssoLogin(String code);

    /**
     *从用户中心下载用户相关信息
     * @param jsonObject
     * @return
     */
    JSONObject downSsoUserInfos(JSONObject jsonObject);

    JSONObject ddmLogin(String code);
}
