Ejemplo n.º 1
0
        public List<V_EMPLOYEEVIEW> GetEmployeeLeaders(string PostID, int LeaderType)
        {
            using (EmployeeBLL bll = new EmployeeBLL())
            {
                return bll.GetEmployeeLeaders(PostID, LeaderType);

                //DepartmentBLL b = new DepartmentBLL();
                //b.GetDepartmentAll("c7d6b7bd-033b-4d80-8c14-95344516665f");
                //List<T_HR_DEPARTMENT> ss=b.GetDepartmentAll("c7d6b7bd-033b-4d80-8c14-95344516665f").ToList();
                //List<string> aa = new List<string>();
                //foreach (var temp in ss)
                //{
                //    aa.Add(temp.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME);
                //}
                //DepartmentBLL b = new DepartmentBLL();
                //b.UpdateCheckState("T_HR_DEPARTMENT", "DEPARTMENTID", "b95b27c4-e518-4943-b401-97fdc92e3691", "2");
                //return null;
                //OverTimeRecordBLL b = new OverTimeRecordBLL();
                //b.UpdateCheckState("T_HR_EMPLOYEEOVERTIMERECORD", "OVERTIMERECORDID", "12c3ddbb-d60d-4431-b5ac-b89275ee9826", "1");
                //return null;
                //DepartmentBLL b1 = new DepartmentBLL();
                //b1.UpdateCheckState("T_HR_DEPARTMENT", "DEPARTMENTID", "272ae780-0447-48b3-b796-a3b36b3c89b4", "1");
                //return null;
                //EmployeePostBLL b1 = new EmployeePostBLL();
                //b1.GetEmployeePostBriefByEmployeeID("f3357185-cb16-4f32-9fa1-e653350a918f");
                //return null;
                //GetEmployeeEntryByID("5b9edea4-aad1-4d66-aeaa-d9ab1ce4357b");
                //return null;
                //EngineService es = new EngineService();
                //string xml = File.ReadAllText("D:\\testfile.txt");
                //es.CallWaitAppService(xml);
                //return null;

                //bll1.ExportExcel("EMPLOYEESALARYRECORDID", "CHECKSTATE==@0", paras, "2011", "7", 0, "cafdca8a-c630-4475-a65d-490d052dca36");
                //return null;
                //EmployeePostBLL bll1 = new EmployeePostBLL();
                //bll1.GetEmployeePostBriefByPostID("d19517f2-efc3-417b-b154-b9b46bcfec75");

                //员工入职测试 weirui 7/18 通过
                //EmployeeEntryBLL bb = new EmployeeEntryBLL();
                //bb.UpdateCheckState("T_HR_EMPLOYEEENTRY", "employeeentryid", "6332ef44-948e-46a6-8edd-fefbad82e432", "2");

                //员工异动测试 weirui 7/18 通过
                //EmployeePostChangeBLL bb = new EmployeePostChangeBLL();
                //bb.UpdateCheckState("T_HR_EMPLOYEEPOSTCHANGE", "POSTCHANGEID", "97df6341-d3cb-4bcb-b4c7-07f9a2cc4f7a", "2");
                //return null;
                //CompanyBLL company = new CompanyBLL();
                //company.UpdateCheckState("T_HR_COMPANY", "COMPANYID", "7f4451a6-24a9-48d8-8f47-b3ec74f690b6", "2");
                //return null;
                //DepartmentBLL dept = new DepartmentBLL();
                //dept.UpdateCheckState("T_HR_DEPARTMENT", "DEPARTMENTID", "4f21b681-c01a-47c4-81b9-2221c67a06de", "3");
                //return null;
                //DepartmentBLL dept = new DepartmentBLL();
                //dept.GetDepartmentByCompanyIDs("cafdca8a-c630-4475-a65d-490d052dca36,1a1f745c-e0df-4d21-b000-8d80d91b1743");
                //return null; 
                //员工离职测试 weirui 7/18 通过
                //LeftOfficeConfirmBLL bb = new LeftOfficeConfirmBLL();
                //bb.UpdateCheckState("T_HR_LEFTOFFICECONFIRM", "CONFIRMID", "e8e5f6b1-8fad-4102-b765-b10bc2001af6", "2");
                //return null;
                //员工转正测试 weirui 7/18 通过
                //EmployeeCheckBLL bb = new EmployeeCheckBLL();
                //bb.UpdateCheckState("T_HR_EMPLOYEECHECK", "BEREGULARID", "a452069f-667f-4e97-b871-507f96597e97", "2");
                //员工工薪档案测试 weirui 7/18 通过
                //SalaryArchiveBLL bb = new SalaryArchiveBLL();
                //bb.UpdateCheckState("T_HR_SALARYARCHIVE", "SALARYARCHIVEID", "e0798203-b846-4dc2-a2e4-3b09314d5641", "2");
                //return null;
                //return null;
                //EmployeeContractBLL bbb = new EmployeeContractBLL();
                //bbb.UpdateCheckState("T_HR_EMPLOYEECONTRACT", "EMPLOYEECONTACTID", "0ce4b304-8f89-48eb-ad33-21334a786cb5", "2");
                //EmployeeEntryBLL bb = new EmployeeEntryBLL();
                //bb.UpdateCheckState("T_HR_EMPLOYEEENTRY", "EMPLOYEEENTRYID", "812cd3f0-5df7-497a-926c-dc0d32c94f4d", "2");
                //return null;
                ////SMT.HRM.Services.InstantMessagingService dd = new InstantMessagingService();
                //InstantMessagingDataBLL bb = new InstantMessagingDataBLL();
                //bb.GetAllEmployee();
                //dd.GetAllOrganization(100,100,100);
                //return null;
                //string checkid = "cb01bc8f-f47b-4732-aa2e-ed042a681b26";
                ////EmployeeContractAlarm(GetEmployeeContractByID(checkid));
                //T_HR_EMPLOYEECONTRACT entry = GetEmployeeContractByID(checkid);
                //if (entry != null)
                //{
                //    string strMsg = "";
                //    T_HR_EMPLOYEECONTRACT employeeContract = new T_HR_EMPLOYEECONTRACT();
                //    employeeContract.EMPLOYEECONTACTID = Guid.NewGuid().ToString();
                //    employeeContract.T_HR_EMPLOYEE = new T_HR_EMPLOYEE();
                //    employeeContract.T_HR_EMPLOYEE.EMPLOYEEID = entry.T_HR_EMPLOYEE.EMPLOYEEID;
                //    employeeContract.FROMDATE = entry.FROMDATE;
                //    employeeContract.TODATE = entry.TODATE;
                //    employeeContract.ENDDATE = entry.ENDDATE;
                //    employeeContract.CONTACTPERIOD = entry.CONTACTPERIOD;
                //    employeeContract.CONTACTCODE = entry.CONTACTCODE;
                //    employeeContract.ATTACHMENT = entry.ATTACHMENT;
                //    employeeContract.ATTACHMENTPATH = entry.ATTACHMENTPATH;
                //    employeeContract.ALARMDAY = entry.ALARMDAY;
                //    employeeContract.CHECKSTATE = "0";
                //    employeeContract.EDITSTATE = "0";
                //    employeeContract.ISSPECIALCONTRACT = entry.ISSPECIALCONTRACT;
                //    employeeContract.REASON = entry.REASON;
                //    employeeContract.REMARK = entry.REMARK;
                //    employeeContract.OWNERID = entry.OWNERID;
                //    employeeContract.OWNERPOSTID = entry.OWNERPOSTID;
                //    employeeContract.OWNERDEPARTMENTID = entry.OWNERDEPARTMENTID;
                //    employeeContract.OWNERCOMPANYID = entry.OWNERCOMPANYID;
                //    employeeContract.CREATECOMPANYID = entry.CREATECOMPANYID;
                //    employeeContract.CREATEDATE = System.DateTime.Now;
                //    employeeContract.CREATEUSERID = entry.CREATEUSERID;
                //    employeeContract.CREATEPOSTID = entry.CREATEPOSTID;
                //    employeeContract.CREATEDEPARTMENTID = entry.CREATEDEPARTMENTID;
                //    employeeContract.CREATECOMPANYID = entry.CREATECOMPANYID;
                //    employeeContract.UPDATEUSERID = entry.UPDATEUSERID;
                //    employeeContract.UPDATEDATE = entry.UPDATEDATE;

                //    EmployeeContractAdd(employeeContract, ref strMsg);
                //    EmployeeContractAlarm(employeeContract);
                //}
                //return null;
                //T_HR_EMPLOYEEENTRY entry = GetEmployeeEntryByEmployeeID(checkid);
                //if (entry != null)
                //{
                //    string strMsg = "";
                //    T_HR_EMPLOYEECHECK employeeCheck = new T_HR_EMPLOYEECHECK();
                //    employeeCheck.BEREGULARID = Guid.NewGuid().ToString();
                //    employeeCheck.T_HR_EMPLOYEE = new T_HR_EMPLOYEE();
                //    employeeCheck.T_HR_EMPLOYEE.EMPLOYEEID = entry.T_HR_EMPLOYEE.EMPLOYEEID;
                //    employeeCheck.EMPLOYEECODE = entry.T_HR_EMPLOYEE.EMPLOYEECODE;
                //    employeeCheck.EMPLOYEENAME = entry.T_HR_EMPLOYEE.EMPLOYEEENAME;
                //    employeeCheck.PROBATIONPERIOD = entry.PROBATIONPERIOD;
                //    employeeCheck.REPORTDATE = entry.ENTRYDATE;
                //    employeeCheck.ONDUTYDATE = entry.ONPOSTDATE;
                //    employeeCheck.OWNERID = entry.OWNERID;
                //    employeeCheck.OWNERCOMPANYID = entry.OWNERCOMPANYID;
                //    employeeCheck.CREATEUSERID = entry.CREATEUSERID;
                //    EmployeeCheckAdd(employeeCheck, ref strMsg);
                //    EmployeeCheckAlarm(employeeCheck);
                //}
                //return null;
                //EngineService aa = new EngineService();

                //string bb = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
                //bb += "<Paras>";
                //bb += "<Para TableName=\"T_HR_LEFTOFFICECONFIRM\" Name=\"OWNERID\" Description=\"strOwnerID\" Value=\"\"></Para>";
                //bb += "<Para TableName=\"T_HR_LEFTOFFICECONFIRM\" Name=\"OWNERDEPARTMENTID\" Description=\"OWNERDEPARTMENTID\" Value=\"c1f72286-eee5-45bd-bded-5993e8a317c9\"></Para>";
                //bb += "<Para TableName=\"T_HR_LEFTOFFICECONFIRM\" Name=\"OWNERPOSTID\" Description=\"strOwnerID\" Value=\"b7c4f515-a0b8-42ff-a103-c178170a51f7\"></Para>";
                //bb += "<Para TableName=\"T_HR_LEFTOFFICECONFIRM\" Name=\"OWNERCOMPANYID\" Description=\"strOwnerID\" Value=\"bac05c76-0f5b-40ae-b73b-8be541ed35ed\"></Para>";
                //bb += "<Para TableName=\"T_HR_LEFTOFFICECONFIRM\"  Name=\"EMPLOYEEID\"  Description=\"员工ID\" Value=\"94085cae-4096-4ccb-bcf8-8ec0c882514b\" ValueName=\"员工ID\" ></Para>";


                //bb += "</Paras>";
                //aa.CallWaitAppService(bb);
                //return null;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 通过状态代码查询下一处理人(对服务操作)
        /// </summary>
        /// <param name="RoleId">状态代码(角色ID(RoleName))</param>
        /// <returns></returns>
        private List<UserInfo> TmGetUserByRoleId(string RoleId, string UserID, string PostID, ref bool isHigher)
        {
            try
            {

                string CurrentRoleId = RoleId == "EndFlow" ? "End" : RoleId; //取得当前状态
                List<UserInfo> listUser = new List<UserInfo>();
                if (CurrentRoleId != "End")
                {
                    string WFCurrentRoleId = "";
                    int isDirect = 0;
                    #region 是否是直接上级,隔级上级,部门负责人
                    foreach (Higher c in Enum.GetValues(typeof(Higher)))
                    {
                        if (CurrentRoleId.ToUpper() == c.ToString().ToUpper())
                        {
                            isDirect = (int)c;//== 1 ? true : false;

                            WFCurrentRoleId = CurrentRoleId;
                            isHigher = true;
                        }
                    }
                    #endregion

                    if (WFCurrentRoleId != "")
                    {
                        //PermissionService
                        #region 如果是直接上级,隔级上级,部门负责人
                        Tracer.Debug("UserID=" + UserID + " 开始调用 直接上级,隔级上级,部门负责人:WcfPersonnel.GetEmployeeLeaders(岗位ID=" + PostID + ", isDirect=" + isDirect + ")");

                        List<SMT.HRM.CustomModel.V_EMPLOYEEVIEW> User = new List<SMT.HRM.CustomModel.V_EMPLOYEEVIEW>();
                        using (EmployeeBLL bll = new EmployeeBLL())
                        {
                            User = bll.GetEmployeeLeaders(PostID, isDirect);
                        }

                        //V_EMPLOYEEVIEW[] User = WcfPersonnel.GetEmployeeLeaders(PostID, isDirect);
                        string strtemp = "UserID=" + UserID + " 结束调用 直接上级,隔级上级,部门负责人:WcfPersonnel.GetEmployeeLeaders(岗位ID=" + PostID + ", isDirect=" + isDirect + ")";
                        if (User != null && User.Count > 0)
                        {
                            for (int i = 0; i < User.Count; i++)
                            {
                                UserInfo tmp = new UserInfo();
                                tmp.UserID = User[i].EMPLOYEEID;
                                tmp.UserName = User[i].EMPLOYEECNAME;
                                tmp.CompanyID = User[i].OWNERCOMPANYID;
                                tmp.DepartmentID = User[i].OWNERDEPARTMENTID;
                                tmp.PostID = User[i].OWNERPOSTID;

                                tmp.CompanyName = User[i].COMPANYNAME;
                                tmp.DepartmentName = User[i].DEPARTMENTNAME;
                                tmp.PostName = User[i].POSTNAME;
                                tmp.Roles = new List<TM_SaaS_OA_EFModel.T_SYS_ROLE>();
                                listUser.Add(tmp);
                                strtemp += "公司ID   = " + User[i].EMPLOYEEID + "\r\n";
                                strtemp += "部门ID   = " + User[i].OWNERDEPARTMENTID + "\r\n";
                                strtemp += "岗位ID   = " + User[i].OWNERPOSTID + "\r\n";
                                strtemp += "员工ID   = " + User[i].EMPLOYEEID + "\r\n";

                                strtemp += "公司名称 = " + User[i].COMPANYNAME + "\r\n";
                                strtemp += "部门名称 = " + User[i].DEPARTMENTNAME + "\r\n";
                                strtemp += "岗位名称 = " + User[i].POSTNAME + "\r\n";
                                strtemp += "员工姓名 = " + User[i].EMPLOYEECNAME + "\r\n";
                            }
                        }
                        #endregion
                        Tracer.Debug(strtemp);
                    }
                    else
                    {
                        #region 根据角色ID查找人
                        Tracer.Debug("UserID=" + UserID + " 开始调用 检索本状态(角色)对应用户:WcfPermissionService.GetFlowUserInfoByRoleID(角色ID=" + WFCurrentRoleId + ")");
                        WFCurrentRoleId = new Guid(CurrentRoleId).ToString("D");

                        try
                        {
                            List<SMT.HRM.CustomModel.Permission.FlowUserInfo> User = new List<HRM.CustomModel.Permission.FlowUserInfo>();//新的接口
                            using (SysUserBLL bll = new SysUserBLL())
                            {
                                User= bll.GetFlowUserInfoByRoleID(WFCurrentRoleId);
                            }

                            string strRole = "UserID=" + UserID + " 结束调用 检索本状态(角色)对应用户:WcfPermissionService.GetFlowUserInfoByRoleID(角色ID=" + WFCurrentRoleId + ")\r\n";

                            if (User != null && User.Count > 0)
                            {
                                for (int i = 0; i < User.Count; i++)
                                {
                                    #region
                                    UserInfo tmp = new UserInfo();
                                    strRole += "公司ID   = " + User[i].CompayID + "\r\n";
                                    strRole += "部门ID   = " + User[i].DepartmentID + "\r\n";
                                    strRole += "岗位ID   = " + User[i].PostID + "\r\n";
                                    strRole += "员工ID   = " + User[i].UserID + "\r\n";

                                    strRole += "公司名称 = " + User[i].CompayName + "\r\n";
                                    strRole += "部门名称 = " + User[i].DepartmentName + "\r\n";
                                    strRole += "岗位名称 = " + User[i].PostName + "\r\n";
                                    strRole += "员工姓名 = " + User[i].EmployeeName + "\r\n";

                                    tmp.UserID = User[i].UserID;
                                    tmp.UserName = User[i].EmployeeName;
                                    tmp.CompanyID = User[i].CompayID;
                                    tmp.DepartmentID = User[i].DepartmentID;
                                    tmp.PostID = User[i].PostID;

                                    tmp.CompanyName = User[i].CompayName;
                                    tmp.DepartmentName = User[i].DepartmentName;
                                    tmp.PostName = User[i].PostName;
                                    tmp.Roles = new List<TM_SaaS_OA_EFModel.T_SYS_ROLE>();
                                    foreach (var role in User[i].Roles)
                                    {
                                        tmp.Roles.Add(role);
                                        strRole += "角色ID   = " + role.ROLEID + "\r\n";
                                        strRole += "角色名称 = " + role.ROLENAME + "\r\n";
                                    }
                                    listUser.Add(tmp);
                                    strRole += "\r\n";
                                    strRole += "==================================================================================\r\n";
                                    #endregion

                                }
                            }
                            Tracer.Debug(strRole);
                        }
                        catch (Exception ex)
                        {
                            Tracer.Debug("权限服务GetSysUserByRole异常信息 角色id:" + WFCurrentRoleId + "" + ex.ToString());
                            throw new Exception("下一审核人为空,请联系公司权限管理员检查角色下的人员,角色id:" + WFCurrentRoleId);
                        }
                        #endregion

                    }

                }
                else
                {
                    //已经到流程结束状态
                    UserInfo tmp = new UserInfo();
                    tmp.UserID = "End";
                    tmp.UserName = "******";

                    listUser.Add(tmp);
                }

                return listUser;
            }
            catch (Exception ex)
            {
                Tracer.Debug("通过状态代码调用权限服务出错查询下一处理人(对服务操作) GetUserByStateCode异常信息 :" + ex.ToString());
                throw new Exception("调用权限服务出错,请联系管理员!");
                // return null ;
            }
            //finally
            //{
            //    WcfPermissionService.Close();
            //    WcfPermissionService = null;
            //    WcfPersonnel.Close();
            //    WcfPersonnel = null;
            //}
        }