using APT.Infrastructure.Core;
using APT.BaseData.Domain.ApiModel;
using APT.BaseData.Domain.Entities.FM;
using System;
using System.Collections.Generic;
using APT.Infrastructure.Api;
namespace APT.BaseData.Domain.IServices.FM
{
    /// <summary>
    /// 
    /// </summary>
    public partial interface IFMUserService : ICommonService
    {


        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns>用户对象</returns>
        List<T_FM_USER> Login(string userName, string pwd);



        /// <summary>
        /// 通过角色获取人员列表
        /// </summary>
        /// <param name="roleIds"></param>
        /// <param name="orgId"></param>
        /// <returns></returns>
        List<T_FM_USER> GetUsersByRoles(IEnumerable<string> roleIds, Guid? orgId);

        /// <summary>
        /// 获取用户角色
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        UserRoleModel GetRolesByUser(Guid userId, KeywordFilter filter);
        /// <summary>
        /// 获取用户角色
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        UserRoleModel NewGetRolesByUser(Guid userId, KeywordFilter filter);
        UserRoleModel AppGetRolesByUser(Guid userId, KeywordFilter filter);

        /// <summary>
        /// 获取用户角色
        /// </summary>
        /// <param name="userIds"></param>
        /// <returns></returns>
        List<UserRoleModel> GetRolesByUser(IEnumerable<Guid> userIds, KeywordFilter filter);



        /// <summary>
        /// 获取部门节点下所有人员信息
        /// </summary>
        /// <param name="BaseDepartMentID"></param>
        /// <returns></returns>
        List<T_FM_USER> GetDownUser(Guid BaseDepartMentID, string[] UserParts = null);


        /// <summary>
        /// 获取组织成员和下属有审批角色的人（负责人、安全员）
        /// </summary>
        /// <param name="DepartMentID"></param>
        /// <returns></returns>
        List<T_FM_USER> GetUserContentNextHead(Guid DepartMentID);


        /// <summary>
        /// 获取登陆者的生产单元
        /// </summary>
        /// <returns></returns>
        List<int> GetMineType(string minType = null);
        /// <summary>
        /// 获取特定岗位的人
        /// </summary>
        /// <param name="Msg"></param>
        /// <param name="postName"></param>
        /// <returns></returns>
        T_FM_USER GetPostUser(ref string Msg, string postName = "人事专员");


        /// <summary>
        /// 获取某个（部门）审批角色对应人
        /// </summary>
        /// <param name="Msg"></param>
        /// <param name="RoleName"></param>
        /// <param name="DEPARTMENT_ID"></param>
        /// <param name="DEPARTMENT_TYPE">FMDepartmentType 部门=0,  车间=1,   班组=2,  公司=3</param>
        /// <returns></returns>
        T_FM_USER GetRoleUser(ref string Msg, string RoleName, Guid? DEPARTMENT_ID, int? DEPARTMENT_TYPE);

        /// <summary>
        /// 获取部门岗位人员
        /// </summary>
        /// <param name="Msg"></param>
        /// <param name="DEPARTMENT_ID"></param>
        /// <param name="POST_ID"></param>
        /// <param name="IsOnly">只返回一个人</param>
        /// <returns></returns>
        List<T_FM_USER> GetDepPostUser(ref string Msg, Guid DEPARTMENT_ID, Guid POST_ID, bool IsOnly);
    }
}
