/*
 * Author: wangjian
 * 生成Service
 */
package com.tofly.base.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tofly.base.dto.ResetUserDTO;
import com.tofly.base.entity.Menu;
import com.tofly.base.entity.User;
import com.tofly.base.entity.System;
import com.tofly.base.entity.UserRoles;
import com.tofly.base.strategy.ExcelStrategy;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.entity.pojo.UserInfo;
import com.tofly.pojo.Userdept;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 用户表
 *
 * @author admin
 * @date Thu Oct 10 00:00:00 CST 2019
 */
public interface UserService extends IService<User> ,ExcelStrategy {

    public UserInfo getUserInfo(User sysUser);

    public User getUserById(Long id);

    public List<User> getExistUserListByRole(Long roleId);

    public List<User> getNoExistUserListByRole(Long roleId);

    public List<System> getSystemListByUser(String platform);

    public List<Menu> getMenuListByUser(String platform);

    public List<Map> getSourceByUser();

    public List<Map> getSources(Long departmentId);

    public boolean deleteUserByIds(String ids);

    public Page<Map> getUserPage(Page page, User user);

    String uploadBatchUser(MultipartFile file);

    public List<Map> getUserByMenu(String menuName);

    Page<Map> getListHistory(Page page, @Param("map") Map map);

    Object insertUser(User user);

    String templateToUpload(MultipartFile file) throws IOException;

    ResultRespone<Object> resetPassword(ResetUserDTO users);

    Map planTemplate();

    ResultRespone accountApplication(MultipartFile file, User user,MultipartFile electronicFile);

    ResultRespone updateByIdNew(MultipartFile file, User user, String roles);

    ResultRespone updatePassword(User user2);

    ResultRespone saveNew(MultipartFile file, UserRoles user, MultipartFile electronicFile);

    boolean updateByIdNew(MultipartFile file, User user,MultipartFile electronicFile, String roles, List<Userdept> userdeptList);

    boolean updateByIdList(String ids);

    boolean updateByIdListToUnlock(String ids);

    boolean updateByIdStatusFlag(String ids);

    boolean updateUnStatusFlag(String ids);

    List<User> getDepartmentUsers();

    ResultRespone getUserInformatiomByLikeName(String name);

    List<User> getDepartmentUsersByIds(Long departmentId);

    ResultRespone getUserAndDepatmentByPerssion(String ids) throws Exception;

    List<Map<String,String>> sysUserReport();

    void serialNumberUpDown(Long userId, String type);

    void serialNumberJump(Long adjustUserId, Long replaceUserId, String type);
}
