Ejemplo n.º 1
0
        protected override void OnStop()
        {
            //服务停止
            this.timerImportRd.Enabled = false;
            string msg = "定时打卡服务已停止,请确认是否异常停止。";

            Tracer.Debug(msg);
            TestMode      = "False";
            TestCompanyIp = string.Empty;
            SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
            Exception ex      = new Exception(msg);
            ErrorLog  msgsend = new ErrorLog(ex);

            log.SendMail(msgsend);
            Tracer.Debug("定时打卡服务已停止,已发送邮件。");
            Thread.Sleep(5000);//windows服务完全停止后,会将发送邮件的进程也停掉
            Tracer.Debug("定时打卡服务已完全停止。");
        }
Ejemplo n.º 2
0
        protected override void OnStart(string[] args)
        {
            //服务启动
            this.timerImportRd.Enabled = true;
            Tracer.Debug("启动服务成功");

            string msg = "定时打卡服务启动服务成功。";

            Tracer.Debug(msg);
            TestMode      = "False";
            TestCompanyIp = string.Empty;
            SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
            Exception ex      = new Exception(msg);
            ErrorLog  msgsend = new ErrorLog(ex);

            log.SendMail(msgsend);


            strElapsedHour = ConfigurationManager.AppSettings["ElapsedHour"].ToString();

            TestMode      = "False";
            TestCompanyIp = string.Empty;
            TestMode      = ConfigurationManager.AppSettings["TestMode"].ToString();
            strNewDevices = ConfigurationManager.AppSettings["newDevice"].ToString();
            iPort         = int.Parse(ConfigurationManager.AppSettings["clockPort"].ToString());
            strIPs        = ConfigurationManager.AppSettings["clockIp"].ToString();
            strCompanyIDs = ConfigurationManager.AppSettings["companyID"].ToString();

            StrCustomerName = ConfigurationManager.AppSettings["CustomerName"].ToString();

            if (TestMode == "true")
            {
                string Interval = ConfigurationManager.AppSettings["TestInterval"].ToString();
                timerImportRd.Interval = int.Parse(Interval);
                TestCompanyIp          = ConfigurationManager.AppSettings["TestCompanyIp"].ToString();
                TestElapsedHour        = ConfigurationManager.AppSettings["TestElapsedHour"].ToString();

                Tracer.Debug("测试模式已开启"
                             + ",Interval=" + timerImportRd.Interval
                             + ",TestCompanyIp="
                             + TestCompanyIp
                             + ",TestElapsedHour=" + TestElapsedHour);
            }
        }
Ejemplo n.º 3
0
        protected override void OnStart(string[] args)
        {
            //服务启动
            this.timerImportRd.Enabled = true;   
            Tracer.Debug("启动服务成功");

            string msg = "定时打卡服务启动服务成功。";
            Tracer.Debug(msg);
            TestMode = "False";
            TestCompanyIp = string.Empty;
            SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
            Exception ex = new Exception(msg);
            ErrorLog msgsend = new ErrorLog(ex);
            log.SendMail(msgsend);


            strElapsedHour = ConfigurationManager.AppSettings["ElapsedHour"].ToString();

            TestMode = "False";
            TestCompanyIp = string.Empty;
            TestMode = ConfigurationManager.AppSettings["TestMode"].ToString();
            strNewDevices = ConfigurationManager.AppSettings["newDevice"].ToString();
            iPort = int.Parse(ConfigurationManager.AppSettings["clockPort"].ToString());
            strIPs = ConfigurationManager.AppSettings["clockIp"].ToString();
            strCompanyIDs = ConfigurationManager.AppSettings["companyID"].ToString();

            StrCustomerName = ConfigurationManager.AppSettings["CustomerName"].ToString();

            if (TestMode == "true")
            {
                string Interval = ConfigurationManager.AppSettings["TestInterval"].ToString();
                timerImportRd.Interval = int.Parse(Interval);
                TestCompanyIp = ConfigurationManager.AppSettings["TestCompanyIp"].ToString();
                TestElapsedHour = ConfigurationManager.AppSettings["TestElapsedHour"].ToString();

                Tracer.Debug("测试模式已开启"
                    + ",Interval=" + timerImportRd.Interval
                    + ",TestCompanyIp="
                    + TestCompanyIp
                    + ",TestElapsedHour=" + TestElapsedHour);
            }
             
        }
Ejemplo n.º 4
0
        private void GetGeneralLogDataAndUpload(bool bIsConnected, string strCurIP)
        {
            try
            {
                if (bIsConnected == false)
                {
                    Tracer.Debug("连接打卡机失败,打卡机IP为:" + strCurIP);
                    return;
                }

                DateTime dtFrom = new DateTime();
                DateTime dtTo = new DateTime();

                DateTime.TryParse(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"), out dtFrom);
                dtTo = dtFrom.AddDays(1).AddSeconds(-1);
                if (TestMode == "true")
                {
                    Tracer.Debug("测试模式下开始下载打卡记录:下载时间段:" + dtFrom.ToString("yyyy-MM-dd HH:mm:ss") + " 截止日期:"
                        + dtTo.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                //DateTime.TryParse(DateTime.Now.AddSeconds(-1).ToString(), out dtTo);
                
                int idwTMachineNumber = 0;
                int idwEnrollNumber = 0;
                int idwEMachineNumber = 0;
                int idwVerifyMode = 0;
                int idwInOutMode = 0;
                int idwYear = 0;
                int idwMonth = 0;
                int idwDay = 0;
                int idwHour = 0;
                int idwMinute = 0;


                List<T_HR_EMPLOYEECLOCKINRECORD> entTempList = new List<T_HR_EMPLOYEECLOCKINRECORD>();

                entTempList.Clear();

                axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device
                if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory
                {
                    if (bIsNewDevice)
                    {
                        string sdwEnrollNumber = string.Empty;
                        int idwSecond = 0;
                        int idwWorkcode = 0;

                        while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out sdwEnrollNumber, out idwVerifyMode,
                               out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkcode))//get records from the memory
                        {
                            DateTime dtCurrent = new DateTime();
                            DateTime.TryParse(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString(), out dtCurrent);
                            if (dtCurrent < dtFrom)
                            {
                                continue;
                            }

                            if (dtCurrent >= dtTo)
                            {
                                continue;
                            }

                            T_HR_EMPLOYEECLOCKINRECORD entTemp = new T_HR_EMPLOYEECLOCKINRECORD();
                            entTemp.CLOCKINRECORDID = System.Guid.NewGuid().ToString().ToUpper();
                            entTemp.FINGERPRINTID = sdwEnrollNumber;
                            entTemp.CLOCKID = idwWorkcode.ToString();
                            entTemp.PUNCHDATE = DateTime.Parse(dtCurrent.ToString("yyyy-MM-dd") + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString());
                            entTemp.PUNCHTIME = idwHour.ToString() + ":" + idwMinute.ToString();
                            entTempList.Add(entTemp);
                        }
                    }
                    else
                    {
                        while (axCZKEM1.GetGeneralLogData(iMachineNumber, ref idwTMachineNumber, ref idwEnrollNumber,
                                ref idwEMachineNumber, ref idwVerifyMode, ref idwInOutMode, ref idwYear, ref idwMonth, ref idwDay, ref idwHour, ref idwMinute))//get records from the memory
                        {
                            DateTime dtCurrent = new DateTime();
                            DateTime.TryParse(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString(), out dtCurrent);
                            if (dtCurrent < dtFrom)
                            {
                                continue;
                            }

                            if (dtCurrent >= dtTo)
                            {
                                continue;
                            }


                            T_HR_EMPLOYEECLOCKINRECORD entTemp = new T_HR_EMPLOYEECLOCKINRECORD();
                            entTemp.CLOCKINRECORDID = System.Guid.NewGuid().ToString().ToUpper();
                            entTemp.FINGERPRINTID = idwEnrollNumber.ToString();
                            entTemp.CLOCKID = idwTMachineNumber.ToString();
                            entTemp.PUNCHDATE = DateTime.Parse(dtCurrent.ToString("yyyy-MM-dd") + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":00");
                            entTemp.PUNCHTIME = idwHour.ToString() + ":" + idwMinute.ToString();
                            entTempList.Add(entTemp);
                        }
                    }
                }
                axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
                axCZKEM1.Disconnect();
                int count = entTempList.Count();
                if (count == 0)
                {
                    string msg = DateTime.Now.ToString() + ",连接打卡机下载的记录数为0,请联系管理员检查打卡机是否正常,打卡机IP为:" + strCurIP;
                    Tracer.Debug(msg);
                    SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
                    Exception ex = new Exception(msg);
                    ErrorLog msgsend = new ErrorLog(ex);
                    log.SendMail(msgsend);
                }
                Tracer.Debug("下载打卡记录成功,打卡机IP为:" + strCurIP + "。已断开打卡机连接。下载记录数:"+entTempList.Count());
                string strMsg = string.Empty;
                List<string> companyIds = new List<string>();

                companyIds = GetCompanyID(strCurIP);
                foreach (var strCompanyId in companyIds)
                {
                    if (TestMode == "true")
                    {
                        foreach (var ent in entTempList)
                        {
                            Tracer.Debug("员工指纹编码:"+ent.FINGERPRINTID + " 打卡时间:"+ ent.PUNCHDATE +":"+ ent.PUNCHTIME);
                        }
                    }
                    else
                    {
                        clientAtt.ImportClockInRdListByWSRealTime(strCompanyId, entTempList.ToArray(), dtFrom, dtTo, strCurIP, ref strMsg);
                    }
                    Tracer.Debug("导入打卡记录成功,打卡机IP为:" + strCurIP + "。导入的公司ID为:" + strCompanyId);
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("导入打卡记录失败,打卡机IP为:" + strCurIP + "。失败原因为:" + ex.ToString());
            }
        }
Ejemplo n.º 5
0
        private void ImportRd()
        {
            if (clientAtt==null) clientAtt = new AttendanceServiceClient();

            DateTime dtCur = DateTime.Now;          

            if (string.IsNullOrWhiteSpace(strElapsedHour))
            {
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录定时配置项(Key = ElapsedHour)未读取到");
                return;
            }

            string[] ips = strIPs.Split(',');
            string[] companyIDs = strCompanyIDs.Split(',');

            listImportCompanys.Clear();
            foreach (string companyID in companyIDs)
            {
                listImportCompanys.Add(companyID);
            }

            if (TestMode == "true")
            {
                if (dtCur.Hour.ToString() != TestElapsedHour)
                {
                    Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录未在指定时间内");
                    return;
                }
                listImportIPs.Clear();
                listImportIPs.Add(TestCompanyIp);
                Tracer.Debug("测试模式下,导入的公司ip为:" + listImportIPs[0].ToString() + ",导入开始");
            }
            else
            {
            
            }


            if (dtCur.Hour != Convert.ToInt32(ConfigurationManager.AppSettings["ElapsedHour"]))
            {
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录未在指定时间内");
                return;
            }
            Tracer.Debug(DateTime.Now.ToString() + ",开始导入打卡记录,设置的导入时间点为每天:" + strElapsedHour + " 点,导入的端口为:"
                + iPort);
            foreach (string str in ips)
            {
                listImportIPs.Add(str);
                Tracer.Debug(DateTime.Now.ToString() + ",导入的打卡机ip包括:" + str);
            }

            foreach (string companyID in companyIDs)
            {
                //strImportCompanys.Add(companyID);
                Tracer.Debug(DateTime.Now.ToString() + ",导入的公司ip包括:" + companyID);
            }


            try
            {
                foreach (string strCurIP in listImportIPs)
                {
                    bool bIsConnected = false;
                    
                    bIsNewDevice = false;
                    Tracer.Debug("开始连接打卡机,打卡机IP为:" + strCurIP + " 端口号:" + iPort);
                    bIsConnected = axCZKEM1.Connect_Net(strCurIP, iPort);
                    if (bIsConnected == true)
                    {
                        Tracer.Debug("连接打卡机成功,打卡机IP为:" + strCurIP);
                        axCZKEM1.RegEvent(iMachineNumber, 65535);

                        if (!string.IsNullOrWhiteSpace(strNewDevices))
                        {
                            if (strNewDevices.Contains(strCurIP))
                            {
                                bIsNewDevice = true;
                            }
                        }
                        Tracer.Debug("开始下载打卡记录,打卡机IP为:" + strCurIP);
                        GetGeneralLogDataAndUpload(bIsConnected, strCurIP);
                    }
                    else
                    {
                        string msg=DateTime.Now.ToString() + ",连接打卡机失败,请联系网管检查打卡机是否正常接入网络,打卡机IP为:" + strCurIP;
                        Tracer.Debug(msg);
                        SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
                        Exception ex = new Exception(msg);
                        ErrorLog msgsend = new ErrorLog(ex);
                        log.SendMail(msgsend);
                    }
                }
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录全部完成");
            }
            catch (Exception ex)
            {
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录发生异常,异常原因:" + ex.ToString());
            }
        }
Ejemplo n.º 6
0
 protected override void OnStop()
 {
     //服务停止
     this.timerImportRd.Enabled = false;
     string msg = "定时打卡服务已停止,请确认是否异常停止。";
     Tracer.Debug(msg);
     TestMode = "False";
     TestCompanyIp = string.Empty;
     SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
     Exception ex = new Exception(msg);
     ErrorLog msgsend = new ErrorLog(ex);
     log.SendMail(msgsend);
     Tracer.Debug( "定时打卡服务已停止,已发送邮件。");
     Thread.Sleep(5000);//windows服务完全停止后,会将发送邮件的进程也停掉
     Tracer.Debug("定时打卡服务已完全停止。");
 }
Ejemplo n.º 7
0
        private void GetGeneralLogDataAndUpload(bool bIsConnected, string strCurIP)
        {
            try
            {
                if (bIsConnected == false)
                {
                    Tracer.Debug("连接打卡机失败,打卡机IP为:" + strCurIP);
                    return;
                }

                DateTime dtFrom = new DateTime();
                DateTime dtTo   = new DateTime();

                DateTime.TryParse(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"), out dtFrom);
                dtTo = dtFrom.AddDays(1).AddSeconds(-1);
                if (TestMode == "true")
                {
                    Tracer.Debug("测试模式下开始下载打卡记录:下载时间段:" + dtFrom.ToString("yyyy-MM-dd HH:mm:ss") + " 截止日期:"
                                 + dtTo.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                //DateTime.TryParse(DateTime.Now.AddSeconds(-1).ToString(), out dtTo);

                int idwTMachineNumber = 0;
                int idwEnrollNumber   = 0;
                int idwEMachineNumber = 0;
                int idwVerifyMode     = 0;
                int idwInOutMode      = 0;
                int idwYear           = 0;
                int idwMonth          = 0;
                int idwDay            = 0;
                int idwHour           = 0;
                int idwMinute         = 0;


                List <T_HR_EMPLOYEECLOCKINRECORD> entTempList = new List <T_HR_EMPLOYEECLOCKINRECORD>();

                entTempList.Clear();

                axCZKEM1.EnableDevice(iMachineNumber, false);    //disable the device
                if (axCZKEM1.ReadGeneralLogData(iMachineNumber)) //read all the attendance records to the memory
                {
                    if (bIsNewDevice)
                    {
                        string sdwEnrollNumber = string.Empty;
                        int    idwSecond       = 0;
                        int    idwWorkcode     = 0;

                        while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out sdwEnrollNumber, out idwVerifyMode,
                                                              out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkcode))//get records from the memory
                        {
                            DateTime dtCurrent = new DateTime();
                            DateTime.TryParse(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString(), out dtCurrent);
                            if (dtCurrent < dtFrom)
                            {
                                continue;
                            }

                            if (dtCurrent >= dtTo)
                            {
                                continue;
                            }

                            T_HR_EMPLOYEECLOCKINRECORD entTemp = new T_HR_EMPLOYEECLOCKINRECORD();
                            entTemp.CLOCKINRECORDID = System.Guid.NewGuid().ToString().ToUpper();
                            entTemp.FINGERPRINTID   = sdwEnrollNumber;
                            entTemp.CLOCKID         = idwWorkcode.ToString();
                            entTemp.PUNCHDATE       = DateTime.Parse(dtCurrent.ToString("yyyy-MM-dd") + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString());
                            entTemp.PUNCHTIME       = idwHour.ToString() + ":" + idwMinute.ToString();
                            entTempList.Add(entTemp);
                        }
                    }
                    else
                    {
                        while (axCZKEM1.GetGeneralLogData(iMachineNumber, ref idwTMachineNumber, ref idwEnrollNumber,
                                                          ref idwEMachineNumber, ref idwVerifyMode, ref idwInOutMode, ref idwYear, ref idwMonth, ref idwDay, ref idwHour, ref idwMinute))//get records from the memory
                        {
                            DateTime dtCurrent = new DateTime();
                            DateTime.TryParse(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString(), out dtCurrent);
                            if (dtCurrent < dtFrom)
                            {
                                continue;
                            }

                            if (dtCurrent >= dtTo)
                            {
                                continue;
                            }


                            T_HR_EMPLOYEECLOCKINRECORD entTemp = new T_HR_EMPLOYEECLOCKINRECORD();
                            entTemp.CLOCKINRECORDID = System.Guid.NewGuid().ToString().ToUpper();
                            entTemp.FINGERPRINTID   = idwEnrollNumber.ToString();
                            entTemp.CLOCKID         = idwTMachineNumber.ToString();
                            entTemp.PUNCHDATE       = DateTime.Parse(dtCurrent.ToString("yyyy-MM-dd") + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":00");
                            entTemp.PUNCHTIME       = idwHour.ToString() + ":" + idwMinute.ToString();
                            entTempList.Add(entTemp);
                        }
                    }
                }
                axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
                axCZKEM1.Disconnect();
                int count = entTempList.Count();
                if (count == 0)
                {
                    string msg = DateTime.Now.ToString() + ",连接打卡机下载的记录数为0,请联系管理员检查打卡机是否正常,打卡机IP为:" + strCurIP;
                    Tracer.Debug(msg);
                    SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
                    Exception ex      = new Exception(msg);
                    ErrorLog  msgsend = new ErrorLog(ex);
                    log.SendMail(msgsend);
                }
                Tracer.Debug("下载打卡记录成功,打卡机IP为:" + strCurIP + "。已断开打卡机连接。下载记录数:" + entTempList.Count());
                string        strMsg     = string.Empty;
                List <string> companyIds = new List <string>();

                companyIds = GetCompanyID(strCurIP);
                foreach (var strCompanyId in companyIds)
                {
                    if (TestMode == "true")
                    {
                        foreach (var ent in entTempList)
                        {
                            Tracer.Debug("员工指纹编码:" + ent.FINGERPRINTID + " 打卡时间:" + ent.PUNCHDATE + ":" + ent.PUNCHTIME);
                        }
                    }
                    else
                    {
                        clientAtt.ImportClockInRdListByWSRealTime(strCompanyId, entTempList.ToArray(), dtFrom, dtTo, strCurIP, ref strMsg);
                    }
                    Tracer.Debug("导入打卡记录成功,打卡机IP为:" + strCurIP + "。导入的公司ID为:" + strCompanyId);
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("导入打卡记录失败,打卡机IP为:" + strCurIP + "。失败原因为:" + ex.ToString());
            }
        }
Ejemplo n.º 8
0
        private void ImportRd()
        {
            if (clientAtt == null)
            {
                clientAtt = new AttendanceServiceClient();
            }

            DateTime dtCur = DateTime.Now;

            if (string.IsNullOrWhiteSpace(strElapsedHour))
            {
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录定时配置项(Key = ElapsedHour)未读取到");
                return;
            }

            string[] ips        = strIPs.Split(',');
            string[] companyIDs = strCompanyIDs.Split(',');

            listImportCompanys.Clear();
            foreach (string companyID in companyIDs)
            {
                listImportCompanys.Add(companyID);
            }

            if (TestMode == "true")
            {
                if (dtCur.Hour.ToString() != TestElapsedHour)
                {
                    Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录未在指定时间内");
                    return;
                }
                listImportIPs.Clear();
                listImportIPs.Add(TestCompanyIp);
                Tracer.Debug("测试模式下,导入的公司ip为:" + listImportIPs[0].ToString() + ",导入开始");
            }
            else
            {
            }


            if (dtCur.Hour != Convert.ToInt32(ConfigurationManager.AppSettings["ElapsedHour"]))
            {
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录未在指定时间内");
                return;
            }
            Tracer.Debug(DateTime.Now.ToString() + ",开始导入打卡记录,设置的导入时间点为每天:" + strElapsedHour + " 点,导入的端口为:"
                         + iPort);
            foreach (string str in ips)
            {
                listImportIPs.Add(str);
                Tracer.Debug(DateTime.Now.ToString() + ",导入的打卡机ip包括:" + str);
            }

            foreach (string companyID in companyIDs)
            {
                //strImportCompanys.Add(companyID);
                Tracer.Debug(DateTime.Now.ToString() + ",导入的公司ip包括:" + companyID);
            }


            try
            {
                foreach (string strCurIP in listImportIPs)
                {
                    bool bIsConnected = false;

                    bIsNewDevice = false;
                    Tracer.Debug("开始连接打卡机,打卡机IP为:" + strCurIP + " 端口号:" + iPort);
                    bIsConnected = axCZKEM1.Connect_Net(strCurIP, iPort);
                    if (bIsConnected == true)
                    {
                        Tracer.Debug("连接打卡机成功,打卡机IP为:" + strCurIP);
                        axCZKEM1.RegEvent(iMachineNumber, 65535);

                        if (!string.IsNullOrWhiteSpace(strNewDevices))
                        {
                            if (strNewDevices.Contains(strCurIP))
                            {
                                bIsNewDevice = true;
                            }
                        }
                        Tracer.Debug("开始下载打卡记录,打卡机IP为:" + strCurIP);
                        GetGeneralLogDataAndUpload(bIsConnected, strCurIP);
                    }
                    else
                    {
                        string msg = DateTime.Now.ToString() + ",连接打卡机失败,请联系网管检查打卡机是否正常接入网络,打卡机IP为:" + strCurIP;
                        Tracer.Debug(msg);
                        SMT.Foundation.Log.LogManager log = new SMT.Foundation.Log.LogManager();
                        Exception ex      = new Exception(msg);
                        ErrorLog  msgsend = new ErrorLog(ex);
                        log.SendMail(msgsend);
                    }
                }
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录全部完成");
            }
            catch (Exception ex)
            {
                Tracer.Debug(DateTime.Now.ToString() + ",导入打卡记录发生异常,异常原因:" + ex.ToString());
            }
        }