Exemplo n.º 1
0
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                LogHelper.WriteLog("PRO_MON_COMPLETE_OVERTIME_CNT_JOB");
                var db = gzswDB.GetInstance();

                model.SVR_TIM_EVENT e = db.SingleOrDefault <model.SVR_TIM_EVENT>("select * from SVR_TIM_EVENT where PROGRAM_METHOD='PRO_MON_COMPLETE_OVERTIME_CNT'");
                if (null != e)
                {
                    SVR_TIM_EVENT_LOG log = new SVR_TIM_EVENT_LOG();
                    log.EVENT_GUID = e.EVENT_GUID;
                    log.RUN_TIME   = DateTime.Now;
                    log.RUN_STATE  = 1;
                    log.PAR_INFO   = "";
                    log.ERROR_INFO = "";
                    ExecuteProd(log);
                    db.Insert("SVR_TIM_EVENT_LOG", "SEQ", log);//写日志
                }
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("PRO_MON_COMPLETE_OVERTIME_CNT_JOB.Execute", ex);
            }
        }
Exemplo n.º 2
0
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                LogHelper.WriteLog("PRO_STAT_STAFF_QUALITY_STAT_D_JOB");
                var db = gzswDB.GetInstance();

                model.SVR_TIM_EVENT e = db.SingleOrDefault <model.SVR_TIM_EVENT>("select * from SVR_TIM_EVENT where PROGRAM_METHOD='PRO_STAT_STAFF_QUALITY_STAT_D'");
                if (null != e)
                {
                    SVR_TIM_EVENT_LOG log = new SVR_TIM_EVENT_LOG();
                    log.EVENT_GUID = e.EVENT_GUID;
                    log.RUN_TIME   = DateTime.Now;
                    log.RUN_STATE  = 1;
                    log.PAR_INFO   = "";
                    log.ERROR_INFO = "";
                    while (true)
                    {
                        bool continu = ExecuteProd(log);
                        db.Insert("SVR_TIM_EVENT_LOG", "SEQ", log);//写日志
                        if (!continu)
                        {
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("PRO_STAT_STAFF_QUALITY_STAT_D_JOB.Execute", ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 返回值bool:是否继续执行该job
        /// </summary>
        /// <param name="log"></param>
        /// <returns></returns>
        private bool ExecuteProd(SVR_TIM_EVENT_LOG log)
        {
            try
            {
                var db      = new Database();
                var parlist = db.Fetch <SVR_TIM_EVENT_PAR>("select * from SVR_TIM_EVENT_PAR where EVENT_GUID=@0 order by PAR_ORD asc", log.EVENT_GUID);

                log.PAR_INFO = string.Join(",", parlist.Select(obj => obj.PAR_VALUE));
                log.RUN_TIME = DateTime.Now;
                db.Execute("exec PRO_REPORT_STAT_D @0, @1", parlist.Select(obj => obj.PAR_VALUE).ToArray());
                var par1 = parlist.FirstOrDefault(obj => obj.PAR_ORD == 1);
                if (null != par1)
                {
                    var nextpar = DateTime.Parse(par1.PAR_VALUE).AddDays(1);
                    par1.PAR_VALUE = nextpar.ToString("yyyy-MM-dd");
                    db.Save(par1);//更新参数

                    if (nextpar <= DateTime.Today)
                    {
                        return(true);//继续执行
                    }
                    return(false);
                }
            }
            catch (Exception ex)
            {
                log.ERROR_INFO = ex.Message;
                log.RUN_STATE  = 2;
            }
            return(false);
        }
Exemplo n.º 4
0
        public void Execute(IJobExecutionContext context)
        {
            try
            {
                LogHelper.WriteLog("PRO_WARN_MON_JOB");
                var db = gzswDB.GetInstance();

                model.SVR_TIM_EVENT e = db.SingleOrDefault <model.SVR_TIM_EVENT>("From SVR_TIM_EVENT where PROGRAM_METHOD='PRO_WARN_MON'");
                if (null != e)
                {
                    SVR_TIM_EVENT_LOG log = new SVR_TIM_EVENT_LOG();
                    log.EVENT_GUID = e.EVENT_GUID;
                    log.RUN_TIME   = DateTime.Now;
                    log.RUN_STATE  = 2;
                    log.PAR_INFO   = "";
                    log.ERROR_INFO = "";

                    try
                    {
                        db.Execute("exec PRO_WARN_MON");
                        log.RUN_STATE = 1;
                    }
                    catch (Exception ex)
                    {
                        log.ERROR_INFO = ex.Message;
                        log.RUN_STATE  = 2;
                    }
                    db.Insert("SVR_TIM_EVENT_LOG", "SEQ", log);//写日志
                }
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("PRO_WARN_MON_JOB.Execute", ex);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// 返回值bool:是否继续执行该job
 /// </summary>
 /// <param name="log"></param>
 /// <returns></returns>
 private void ExecuteProd(SVR_TIM_EVENT_LOG log)
 {
     try
     {
         var db = gzswDB.GetInstance();
         db.Execute("exec PRO_INIT_QUEUEDEAL_D");
     }
     catch (Exception ex)
     {
         log.ERROR_INFO = ex.Message;
         log.RUN_STATE  = 2;
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 返回值bool:是否继续执行该job
        /// </summary>
        /// <param name="log"></param>
        /// <returns></returns>
        private bool ExecuteProd(SVR_TIM_EVENT_LOG log)
        {
            try
            {
                var db      = gzswDB.GetInstance();
                var parlist = db.Fetch <SVR_TIM_EVENT_PAR>("select * from SVR_TIM_EVENT_PAR where EVENT_GUID=@0 order by PAR_ORD asc", log.EVENT_GUID);
                var par1    = parlist.FirstOrDefault(obj => obj.PAR_ORD == 1);

                log.PAR_INFO = string.Join(",", parlist.Select(obj => obj.PAR_VALUE));
                log.RUN_TIME = DateTime.Now;

                if (!CHkParam(par1))
                {
                    log.ERROR_INFO = "参数检查不通过!";
                    log.RUN_STATE  = 2;
                    return(false);
                }

                try
                {
                    db.Execute("exec PRO_CHK_STAFFCHK_EVENT_D @0, @1", parlist.Select(obj => obj.PAR_VALUE).ToArray());

                    if (null != par1)
                    {
                        var nextpar = DateTime.Parse(par1.PAR_VALUE).AddDays(1);
                        par1.PAR_VALUE = nextpar.ToString("yyyy-MM-dd");
                        db.Save(par1);//更新参数

                        if (nextpar < DateTime.Today)
                        {
                            return(true);//继续执行
                        }
                        return(false);
                    }
                }
                catch (Exception ex)
                {
                    log.ERROR_INFO = ex.Message;
                    log.RUN_STATE  = 2;
                    LogHelper.ErrorLog("", ex);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                log.ERROR_INFO = ex.Message;
                log.RUN_STATE  = 2;
            }
            return(false);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 返回值bool:是否继续执行该job
        /// </summary>
        /// <param name="log"></param>
        /// <returns></returns>
        private void ExecuteProd(SVR_TIM_EVENT_LOG log)
        {
            try
            {
                var db = gzswDB.GetInstance();
                log.PAR_INFO = "";
                log.RUN_TIME = DateTime.Now;

                db.Execute("exec PRO_MON_ABAN_RT");
            }
            catch (Exception ex)
            {
                log.ERROR_INFO = ex.Message;
                log.RUN_STATE  = 2;
            }
        }