package com.hfkj.service;

import com.github.pagehelper.PageInfo;
import com.hfkj.entity.BsOrganization;
import com.hfkj.entity.SecUser;
import com.hfkj.model.SecUserModel;
import com.hfkj.model.UserTreeModel;
import com.hfkj.sysenum.SecUserTypeEnum;

import java.util.List;

/**
 *@ClassName SecUserService
 *@Description 单位、机构人员管理
 *@Author 杜江
 *@Date 2020/7/23 10:31
 *@Version 1.0
 */
public interface SecUserService {

    /**
     *
     * @Title: addUser
     * @Description: 添加员工
     * @author: 杜江
     * @Date: 2020/7/23 10:32
     * @param: [secUser]
     * @return: void
     * @throws
     */
    void addUser(SecUser secUser);

    /**
     *
     * @Title: updateUser
     * @Description: 修改员工
     * @author: 杜江
     * @Date: 2020/7/23 10:33
     * @param: [secUser]
     * @return: void
     * @throws
     */
    void updateUser(SecUser secUser);

    /**
     *
     * @Title: findById
     * @Description: 根据id查询员工
     * @author: 杜江
     * @Date: 2020/7/23 10:36
     * @param: [userId]
     * @return: com.shinwoten.train.entity.SecUser
     * @throws
     */
    SecUser findById(Long userId);

    /**
     *
     * @Title: userLogin
     * @Description: 用户登录
     * @author: 杜江
     * @Date: 2020/7/23 10:40
     * @param: [loginName, password]
     * @return: com.shinwoten.train.entity.SecUser
     * @throws
     */
    SecUser userLogin(String loginName, String password);

    /**
     *
     * @Title: findByPhone
     * @Description: 根据电话查询用户
     * @author: 杜江
     * @Date: 2020/7/23 15:45
     * @param: [phone]
     * @return: com.shinwoten.train.entity.SecUser
     * @throws
     */
    SecUser findByPhone(String phone);

    /**
     *
     * @Title: findByLoginName
     * @Description: 通过登录名查询用户
     * @author: 杜江
     * @Date: 2020/7/24 11:33
     * @param: [loginName]
     * @return: com.shinwoten.train.entity.SecUser
     * @throws
     */
    SecUser findByLoginName(String loginName);

    /**
     * openId存储在ext1中
     * @param openId
     * @return
     */
    SecUser findByOpenId(String openId);

    /**
     *
     * @Title: selectAdminUser
     * @Description: 查询公司主角色
     * @author: 杜江
     * @Date: 2020/7/8 11:30
     * @param: [companyId]
     * @return: com.shinwoten.plat.entity.SecUser
     * @throws
     */
    SecUser selectAdminUser(Long companyId);

    /**
     *
     * @Title: findPage
     * @Description: 分页查询用户
     * @author: 杜江
     * @Date: 2020/7/7 11:11
     * @param: [companyId, organizationId, userName, phone, pageNum, pageSize]
     * @return: com.github.pagehelper.PageInfo<com.shinwoten.plat.model.SecUserModel>
     * @throws
     */
    PageInfo<SecUserModel> findPage(Long companyId, Long organizationId, String userName, String phone, Integer pageNum, Integer pageSize);

    /**
     *
     * @Title: modifyUser
     * @Description: 修改用户
     * @author: 杜江
     * @Date: 2020/7/7 11:30
     * @param: [user]
     * @return: void
     * @throws
     */
    void modifyUser(SecUser user);

    /**
     * @Author 胡锐
     * @Description 查询主账号
     * @Date 2021/3/12 21:05
     **/
    SecUser getMainAccount(Integer objectType,Long objectId);

    /**
     *
     * @Title: findUserList
     * @Description: TODO(用户列表)
     * @author: 杜江
     * @param: [companyId, phone]
     * @return: java.util.List<com.shinwoten.haj.entity.SecUser>
     * @throws
     */
    List<SecUser> findUserList(Long organizationId, String phone);

    /**
     *
     * @Title: findAttendUserTree
     * @Description: TODO(查询人员树)
     * @author: 杜江
     * @param: [companyId, organization]
     * @return: com.shinwoten.haj.model.UserTreeModel
     * @throws
     */
    UserTreeModel findAttendUserTree(Long companyId, BsOrganization organization);

    /**
     * @Author 胡锐
     * @Description 查询门店所有账号
     * @Date 2021/3/10 22:35
     **/
    List<SecUser> getMerchantStoreUser(Long merchantStoreId);
}
