package com.njcn.service.user;

import com.njcn.pojo.commons.AreaInfo;
import com.njcn.pojo.commons.area.Area;
import com.njcn.pojo.user.AppUser;
import com.njcn.pojo.user.Role;
import com.njcn.pojo.user.RoleGroup;
import com.njcn.sso.pojo.user.User;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import java.util.List;

public interface UserService {
    //删除
    String deleteUserByIndex(String index);

    //删除App用户
    String deleteAppUserByIndex(String index);

    int updateExaminer(String userIndex);

    //添加
    String saveAppUser(String name, String loginName, String deptsIndex, String password, String phone,
                       String email, String ip, String ipEnd, String time, Integer mark2, String usertype, String isnotice,
                       String referralCode, String semName, String semPhone) throws Exception;

    //添加
    String saveUser(String name, String loginName, String deptsIndex, String password, String phone,
                    String email, String ip, String ipEnd, String time, Integer mark2, String usertype, String isnotice) throws Exception;


    //新增管理员
    String saveManager(String name, String loginName, String rolegpIndex, String password, String phone, String email, String ip, String ipEnd, String time, Integer mark);

    //根据id查询所有
    User selectId(String userIndex, int flag);

    //修改
    List<User> selectName(String name, String userIndex);


    //根据guid查询更新人
    String selectIdName(String userIndex);

    /**
     * 获取所有的用户信息
     */
    List<User> selectAllUser(String userState, String careUser, int resultNum);

    List<List> selectAllUsers();

    void updateUserLocked(String username);

    void updateUserPasswordError(String username);

    List<Role> selectAll();

    /**
     * 更新用户
     */
    void updateAppUser(String userIndex, String name, String loginName, String deptsIndex, String phone, String email, String ipGo,
                       String ipE, String time, Integer mark, String usertype, String isnotice, String semName, String semPhone);

    void updateUser(String userIndex, String name, String loginName, String deptsIndex, String phone, String email, String ipGo,
                    String ipE, String time, Integer mark, String usertype, String isnotice);

    //根据天溯接口获取的数据，新增用户信息
    void saveUser(JSONArray userList);

    //处理天溯增量变化信息
    void doChangeData(JSONObject changData);

    //用户修改密码
    void modifyPassword(String username, String password);

    //app用户修改密码
    //用户修改密码
    void modifyAppPassword(String username, String password);

    //将用户从休眠状态激活
    void dealUserActive(String userIndex);

    //判断用户名密码是否匹配
    void judgeUsernameAndPwd(String username, String password);

    //将用户从锁定激活
    void dealUserUnlock(String userIndex);

    //根据用户获取区域信息
    List<AreaInfo> getAreasByUser();

    List<User> getAllManagers(String userState);

    AppUser selectAppId(String userIndex);

}
