예제 #1
0
        private void VerifyUrl()
        {
            string operateIP = Rc.Cloud.Web.Common.pfunction.GetRealIP();
            string strFileSyncExecRecord_id = Guid.NewGuid().ToString();

            #region 记录同步开始信息
            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "自动提交学生答案";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = operateIP + "正在检测...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            bll_FileSyncExecRecord.Add(model_FileSyncExecRecord);
            #endregion
            try
            {
                string basicUrl = "/AuthApi/Auto_SubmitStuAnswers.aspx?strFileSyncExecRecord_id=" + strFileSyncExecRecord_id;
                #region 检测 习题集服务器
                string strTestWebSiteUrl = Rc.Common.ConfigHelper.GetConfigString("TestWebSiteUrl");
                string getResult         = Rc.Common.RemotWeb.PostDataToServer(strTestWebSiteUrl + basicUrl, "", System.Text.Encoding.UTF8, "GET");
                #endregion

                #region 检测 学校服务器
                List <Model_ConfigSchool> list = new List <Model_ConfigSchool>();
                list = new BLL_ConfigSchool().GetModelList("");
                foreach (var item in list)
                {
                    if (!string.IsNullOrEmpty(item.D_PublicValue))
                    {
                        getResult = Rc.Common.RemotWeb.PostDataToServer(item.D_PublicValue + basicUrl + "&SchoolId=" + item.School_ID, "", System.Text.Encoding.UTF8, "GET");
                    }
                }
                #endregion

                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = operateIP + "检测成功完成";
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";

                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = operateIP + "检测失败:" + ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
            }
        }
예제 #2
0
        /// <summary>
        /// 同步教案
        /// </summary>
        public void ResSynchroTeachingPlan()
        {
            //生产环境web站点存放文件的主目录
            string strProductPublicUrl      = ConfigurationManager.AppSettings["ProductPublicUrl"].ToString();
            string strFileSyncExecRecord_id = Guid.NewGuid().ToString();
            bool   isCover      = false;
            string strCondition = string.Empty;

            strCondition = string.Format("日期【{0}】;书本【{1}】【{2}】;是覆盖:【{3}】", txtSDate.Value, txtBOOK.Value, hidtxtBOOK.Value, chbCover.Checked);
            #region 记录同步开始信息
            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "同步教案";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "正在同步...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            model_FileSyncExecRecord.createUser = SysUser_ID;
            model_FileSyncExecRecord.FileSyncExecRecord_Condition = strCondition;

            #endregion
            isCover = chbCover.Checked;
            try
            {
                bll_FileSyncExecRecord.Add(model_FileSyncExecRecord);
                //教案文件,htm文件相关数据
                DataTable dtFilePlan = GetDtFilePlan();
                #region  载文件
                //教案SW+thm
                DataRow[] drSWdsc = dtFilePlan.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.ScienceWord类型文件));
                DownLoadFile(drSWdsc, "swDocument", "dsc", strProductPublicUrl, strFileSyncExecRecord_id, "教案SWdsc", isCover);
                DownLoadFile(drSWdsc, "swDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "教案SWdsc", isCover);
                //教案class+thm
                DataRow[] drClass = dtFilePlan.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型文件));
                DownLoadFile(drClass, "classDocument", "class", strProductPublicUrl, strFileSyncExecRecord_id, "教案class", isCover);
                DownLoadFile(drClass, "classDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "教案class", isCover);
                //微课class+thm
                DataRow[] drMicroClass = dtFilePlan.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型微课件));
                DownLoadFile(drMicroClass, "microClassDocument", "class", strProductPublicUrl, strFileSyncExecRecord_id, "微课class", isCover);
                DownLoadFile(drMicroClass, "microClassDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "微课class", isCover);

                //教案预览图片文件相关数据
                DataTable dtFilePlanView = GetDtFilePlanView();
                //教案SW+预览图片
                DataRow[] drSWdscView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.ScienceWord类型文件));
                DownLoadFile(drSWdscView, "swView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "教案SW预览图片", isCover);
                //教案Class+预览图片
                DataRow[] drClassView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型文件));
                DownLoadFile(drClassView, "classView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "教案Class预览图片", isCover);
                //微课Class+预览图片
                DataRow[] drMicroClassView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型微课件));
                DownLoadFile(drMicroClassView, "microClassView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "微课Class预览图片", isCover);
                #endregion

                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步成功完成";
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";

                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步失败:" + ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
            }
        }
예제 #3
0
        private void SynchronousDataReExec()
        {
            //生产环境web站点存放文件的主目录
            string strProductPublicUrl      = ConfigurationManager.AppSettings["ProductPublicUrl"].ToString();
            string strFileSyncExecRecord_id = hidId.Value;

            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord = bll_FileSyncExecRecord.GetModel(strFileSyncExecRecord_id);
            bool   isCover      = false;
            string strCondition = model_FileSyncExecRecord.FileSyncExecRecord_Condition;

            txtSDate.Value   = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);
            strCondition     = strCondition.Substring(strCondition.IndexOf("】") + 1);
            txtBOOK.Value    = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);
            strCondition     = strCondition.Substring(strCondition.IndexOf("】") + 1);
            hidtxtBOOK.Value = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);
            strCondition     = strCondition.Substring(strCondition.IndexOf("】") + 1);
            string strCover = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);

            bool.TryParse(strCover, out isCover);
            chbCover.Checked = isCover;

            strCondition = string.Format("日期【{0}】;书本【{1}】【{2}】;是覆盖:【{3}】", txtSDate.Value, txtBOOK.Value, hidtxtBOOK.Value, chbCover.Checked);
            #region 记录同步开始信息
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "同步教案";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "正在同步...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd   = null;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            model_FileSyncExecRecord.createUser = SysUser_ID;
            model_FileSyncExecRecord.FileSyncExecRecord_Condition = strCondition;

            #endregion
            try
            {
                Rc.Common.DBUtility.DbHelperSQL.ExecuteSql("delete from FileSyncExecRecordDetail where FileSyncExecRecord_id='" + hidId.Value + "' ");
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);

                //教案文件,htm文件相关数据
                DataTable dtFilePlan = GetDtFilePlan();
                #region  载文件
                //教案SW+thm
                DataRow[] drSWdsc = dtFilePlan.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.ScienceWord类型文件));
                DownLoadFile(drSWdsc, "swDocument", "dsc", strProductPublicUrl, strFileSyncExecRecord_id, "教案SWdsc", isCover);
                DownLoadFile(drSWdsc, "swDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "教案SWdsc", isCover);
                //教案class+thm
                DataRow[] drClass = dtFilePlan.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型文件));
                DownLoadFile(drClass, "classDocument", "class", strProductPublicUrl, strFileSyncExecRecord_id, "教案class", isCover);
                DownLoadFile(drClass, "classDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "教案class", isCover);
                //微课class+thm
                DataRow[] drMicroClass = dtFilePlan.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型微课件));
                DownLoadFile(drMicroClass, "microClassDocument", "class", strProductPublicUrl, strFileSyncExecRecord_id, "微课class", isCover);
                DownLoadFile(drMicroClass, "microClassDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "微课class", isCover);

                //教案预览图片文件相关数据
                DataTable dtFilePlanView = GetDtFilePlanView();
                //教案SW+预览图片
                DataRow[] drSWdscView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.ScienceWord类型文件));
                DownLoadFile(drSWdscView, "swView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "教案SW预览图片", isCover);
                //教案Class+预览图片
                DataRow[] drClassView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型文件));
                DownLoadFile(drClassView, "classView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "教案Class预览图片", isCover);
                //微课Class+预览图片
                DataRow[] drMicroClassView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}'", Resource_TypeConst.class类型微课件));
                DownLoadFile(drMicroClassView, "microClassView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "微课Class预览图片", isCover);
                #endregion

                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步已完成";
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";

                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步失败:" + ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
            }
        }
예제 #4
0
        /// <summary>
        /// 同步习题集
        /// </summary>
        public void ResSynchroTeachingPlan()
        {
            //生产环境web站点存放文件的主目录
            string strProductPublicUrl = ConfigurationManager.AppSettings["ProductPublicUrl"].ToString();
            string strCondition        = string.Empty;

            strCondition = string.Format("日期【{0}】;书本【{1}】【{2}】;是覆盖:【{3}】", txtSDate.Value, txtBOOK.Value, hidtxtBOOK.Value, chbCover.Checked);
            string strFileSyncExecRecord_id = Guid.NewGuid().ToString();
            bool   isCover = false;

            isCover = chbCover.Checked;
            #region 记录同步开始信息

            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "同步试卷";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "同步进行中...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            model_FileSyncExecRecord.FileSyncExecRecord_Condition = strCondition;
            model_FileSyncExecRecord.createUser = SysUser_ID;

            #endregion
            try
            {
                bll_FileSyncExecRecord.Add(model_FileSyncExecRecord);
                //试卷文件相关数据
                DataTable dtFileTestPaper = GetDtFileTestPaperTestQuestion();
                DataRow[] dvFileTestPaper = dtFileTestPaper.Select();

                #region  载文件
                //题干	BASE64内容,存储目录:testQuestionBody/属性层次目录/试题标识.txt
                DownLoadFile(dvFileTestPaper, "testQuestionBody", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "题干txt", isCover);
                //题干 	HTML内容,存储目录:testQuestionBody/属性层次目录/试题标识.htm
                DownLoadFile(dvFileTestPaper, "testQuestionBody", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "题干htm", isCover);

                DataTable dtFileTestPaperScore = GetDtFileTestPaperTestQuestions_Score();
                DataRow[] dvFileTestPaperScore = dtFileTestPaperScore.Select();
                //	选择题的选项(数组对象)存储目录:testQuestionOption/属性层次目录/试题标识.txt(存储JSION结构到文本文件,一个题只有一个文件)
                DownLoadFile(dvFileTestPaperScore, "testQuestionOption", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "选择题选项txt", isCover);
                //	c)	标准答案(数组)存储目录:testQuestionCurrent/属性层次目录/试题标识.txt(存储JSION结构到文本文件,一个题只有一个文件)
                DownLoadFile(dvFileTestPaperScore, "testQuestionCurrent", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "标准答案txt", isCover);
                //	解析 	BASE64内容AnalyzeData/属性层次目录/试题标识.txt
                DownLoadFile(dvFileTestPaperScore, "AnalyzeData", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "解析txt", isCover);
                //	解析 	HTML内容AnalyzeHtml/属性层次目录/试题标识.htm
                DownLoadFile(dvFileTestPaperScore, "AnalyzeHtml", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "解析htm", isCover);
                //	e)	强化训练 		BASE64内容TrainData/属性层次目录/试题标识.txt
                DownLoadFile(dvFileTestPaperScore, "TrainData", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "强化训练txt", isCover);
                //	e)	强化训练 		HTML内容TrainHtml/属性层次目录/试题标识.htm
                DownLoadFile(dvFileTestPaperScore, "TrainHtml", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "强化训练htm", isCover);
                #endregion

                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步已完成";
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步失败:" + ex.Message.ToString();
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                throw;
            }
        }
예제 #5
0
        public void SynchronousDataReExec()
        {
            //生产环境web站点存放文件的主目录
            string strProductPublicUrl      = ConfigurationManager.AppSettings["ProductPublicUrl"].ToString();
            string strFileSyncExecRecord_id = hidId.Value;

            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord = bll_FileSyncExecRecord.GetModel(strFileSyncExecRecord_id);
            bool   isCover      = false;
            string strCondition = model_FileSyncExecRecord.FileSyncExecRecord_Condition;

            txtSDate.Value   = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);
            strCondition     = strCondition.Substring(strCondition.IndexOf("】") + 1);
            txtBOOK.Value    = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);
            strCondition     = strCondition.Substring(strCondition.IndexOf("】") + 1);
            hidtxtBOOK.Value = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);
            strCondition     = strCondition.Substring(strCondition.IndexOf("】") + 1);
            string strCover = strCondition.Substring(strCondition.IndexOf("【") + 1, strCondition.IndexOf("】") - strCondition.IndexOf("【") - 1);

            bool.TryParse(strCover, out isCover);
            chbCover.Checked = isCover;

            strCondition = string.Format("日期【{0}】;书本【{1}】【{2}】;是覆盖:【{3}】", txtSDate.Value, txtBOOK.Value, hidtxtBOOK.Value, chbCover.Checked);
            #region 记录同步开始信息

            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "同步试卷";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "同步进行中...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd   = null;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            model_FileSyncExecRecord.FileSyncExecRecord_Condition = strCondition;
            model_FileSyncExecRecord.createUser = SysUser_ID;

            #endregion
            try
            {
                Rc.Common.DBUtility.DbHelperSQL.ExecuteSql("delete from FileSyncExecRecordDetail where FileSyncExecRecord_id='" + hidId.Value + "' ");
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                //试卷文件相关数据
                DataTable dtFileTestPaper = GetDtFileTestPaperTestQuestion();
                DataRow[] dvFileTestPaper = dtFileTestPaper.Select();

                #region  载文件
                //题干	BASE64内容,存储目录:testQuestionBody/属性层次目录/试题标识.txt
                DownLoadFile(dvFileTestPaper, "testQuestionBody", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "题干txt", isCover);
                //题干 	HTML内容,存储目录:testQuestionBody/属性层次目录/试题标识.htm
                DownLoadFile(dvFileTestPaper, "testQuestionBody", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "题干htm", isCover);

                DataTable dtFileTestPaperScore = GetDtFileTestPaperTestQuestions_Score();
                DataRow[] dvFileTestPaperScore = dtFileTestPaperScore.Select();
                //	选择题的选项(数组对象)存储目录:testQuestionOption/属性层次目录/试题标识.txt(存储JSION结构到文本文件,一个题只有一个文件)
                DownLoadFile(dvFileTestPaperScore, "testQuestionOption", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "选择题选项txt", isCover);
                //	c)	标准答案(数组)存储目录:testQuestionCurrent/属性层次目录/试题标识.txt(存储JSION结构到文本文件,一个题只有一个文件)
                DownLoadFile(dvFileTestPaperScore, "testQuestionCurrent", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "标准答案txt", isCover);
                //	解析 	BASE64内容AnalyzeData/属性层次目录/试题标识.txt
                DownLoadFile(dvFileTestPaperScore, "AnalyzeData", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "解析txt", isCover);
                //	解析 	HTML内容AnalyzeHtml/属性层次目录/试题标识.htm
                DownLoadFile(dvFileTestPaperScore, "AnalyzeHtml", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "解析htm", isCover);
                //	e)	强化训练 		BASE64内容TrainData/属性层次目录/试题标识.txt
                DownLoadFile(dvFileTestPaperScore, "TrainData", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "强化训练txt", isCover);
                //	e)	强化训练 		HTML内容TrainHtml/属性层次目录/试题标识.htm
                DownLoadFile(dvFileTestPaperScore, "TrainHtml", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "强化训练htm", isCover);
                #endregion

                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步已完成";
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步失败:" + ex.Message.ToString();
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
            }
        }
        private void VerifyUrl()
        {
            string strFileSyncExecRecord_id = Guid.NewGuid().ToString();

            #region 记录检测开始信息
            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "自动检测学校公网";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "正在检测...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            bll_FileSyncExecRecord.Add(model_FileSyncExecRecord);
            #endregion
            try
            {
                Model_SendMessageTemplate model = new BLL_SendMessageTemplate().GetModelBySType(Rc.Model.Resources.SMSPAYTemplateEnum.SMS.ToString());

                #region 检测 主web服务器,教案服务器,习题集服务器
                string strName = string.Empty;
                string strStudentAnswerWebSiteUrl = Rc.Common.ConfigHelper.GetConfigString("StudentAnswerWebSiteUrl");
                string strTeachingPlanWebSiteUrl  = Rc.Common.ConfigHelper.GetConfigString("TeachingPlanWebSiteUrl");
                string strTestWebSiteUrl          = Rc.Common.ConfigHelper.GetConfigString("TestWebSiteUrl");

                if (hostPath != strStudentAnswerWebSiteUrl)
                {
                    #region 检测 主web服务器
                    strName = "主web服务器";
                    string getResult = Rc.Common.RemotWeb.PostDataToServer(strStudentAnswerWebSiteUrl + "AuthApi/?key=onlinecheck", "", System.Text.Encoding.UTF8, "GET");
                    string schoolUrl = strStudentAnswerWebSiteUrl.Replace("http://", "").TrimEnd('/');
                    string strWhere  = string.Empty;
                    #region 给运营平台发送短信
                    if (string.IsNullOrEmpty(getResult)) // 无法访问
                    {
                        strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' and datediff(MI,ctime,getdate())<180 order by CTime desc "
                                                 , model.Mobile, strName);
                        DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                        if (dt.Rows.Count == 0 || (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() != "false"))
                        {
                            // 180分钟内未发送短信 或 最新短信不是无法访问
                            Dictionary <string, string> Para = new Dictionary <string, string>();
                            Para.Add("template_id", "10580");
                            Para.Add("template_para_schoolname", strName);
                            Para.Add("template_para_schoolurl", schoolUrl);
                            string msg = (strName + schoolUrl + "无法访问");
                            Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "false", "");
                        }
                    }
                    else
                    {
                        strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' order by CTime desc "
                                                 , model.Mobile, strName);
                        DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                        if (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() == "false")
                        {
                            Dictionary <string, string> Para = new Dictionary <string, string>();
                            Para.Add("template_id", "10581");
                            Para.Add("template_para_schoolname", strName);
                            Para.Add("template_para_schoolurl", schoolUrl);
                            string msg = (strName + schoolUrl + "已恢复正常");
                            Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "true", "");
                        }
                    }
                    #endregion
                    #endregion
                }

                if (strTeachingPlanWebSiteUrl != strStudentAnswerWebSiteUrl && strTeachingPlanWebSiteUrl != hostPath)
                {
                    #region 检测 教案服务器
                    strName = "教案服务器";
                    string getResult = Rc.Common.RemotWeb.PostDataToServer(strTeachingPlanWebSiteUrl + "AuthApi/?key=onlinecheck", "", System.Text.Encoding.UTF8, "GET");
                    string schoolUrl = strTeachingPlanWebSiteUrl.Replace("http://", "").TrimEnd('/');
                    string strWhere  = string.Empty;
                    #region 给运营平台发送短信
                    if (string.IsNullOrEmpty(getResult)) // 无法访问
                    {
                        strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' and datediff(MI,ctime,getdate())<180 order by CTime desc "
                                                 , model.Mobile, strName);
                        DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                        if (dt.Rows.Count == 0 || (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() != "false"))
                        {
                            // 180分钟内未发送短信 或 最新短信不是无法访问
                            Dictionary <string, string> Para = new Dictionary <string, string>();
                            Para.Add("template_id", "10580");
                            Para.Add("template_para_schoolname", strName);
                            Para.Add("template_para_schoolurl", schoolUrl);
                            string msg = (strName + schoolUrl + "无法访问");
                            Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "false", "");
                        }
                    }
                    else
                    {
                        strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' order by CTime desc "
                                                 , model.Mobile, strName);
                        DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                        if (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() == "false")
                        {
                            Dictionary <string, string> Para = new Dictionary <string, string>();
                            Para.Add("template_id", "10581");
                            Para.Add("template_para_schoolname", strName);
                            Para.Add("template_para_schoolurl", schoolUrl);
                            string msg = (strName + schoolUrl + "已恢复正常");
                            Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "true", "");
                        }
                    }
                    #endregion
                    #endregion
                }
                if (strTestWebSiteUrl != strStudentAnswerWebSiteUrl && strTestWebSiteUrl != strTeachingPlanWebSiteUrl && strTestWebSiteUrl != hostPath)
                {
                    #region 检测 习题集服务器
                    strName = "习题集服务器";
                    string getResult = Rc.Common.RemotWeb.PostDataToServer(strTeachingPlanWebSiteUrl + "AuthApi/?key=onlinecheck", "", System.Text.Encoding.UTF8, "GET");
                    string schoolUrl = strTeachingPlanWebSiteUrl.Replace("http://", "").TrimEnd('/');
                    string strWhere  = string.Empty;
                    #region 给运营平台发送短信
                    if (string.IsNullOrEmpty(getResult)) // 无法访问
                    {
                        strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' and datediff(MI,ctime,getdate())<180 order by CTime desc "
                                                 , model.Mobile, strName);
                        DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                        if (dt.Rows.Count == 0 || (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() != "false"))
                        {
                            // 180分钟内未发送短信 或 最新短信不是无法访问
                            Dictionary <string, string> Para = new Dictionary <string, string>();
                            Para.Add("template_id", "10580");
                            Para.Add("template_para_schoolname", strName);
                            Para.Add("template_para_schoolurl", schoolUrl);
                            string msg = (strName + schoolUrl + "无法访问");
                            Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "false", "");
                        }
                    }
                    else
                    {
                        strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' order by CTime desc "
                                                 , model.Mobile, strName);
                        DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                        if (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() == "false")
                        {
                            Dictionary <string, string> Para = new Dictionary <string, string>();
                            Para.Add("template_id", "10581");
                            Para.Add("template_para_schoolname", strName);
                            Para.Add("template_para_schoolurl", schoolUrl);
                            string msg = (strName + schoolUrl + "已恢复正常");
                            Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "true", "");
                        }
                    }
                    #endregion
                    #endregion
                }

                #endregion

                List <Model_ConfigSchool> list = new List <Model_ConfigSchool>();
                list = new BLL_ConfigSchool().GetModelList("");
                string    Sql      = string.Format(@" select cs.School_Id,cs.School_Name,ssp.PhoneNum from 
ConfigSchool cs
inner join [dbo].[SchoolSMS_Person] ssp on ssp.School_Id=cs.School_Id ");
                DataTable dtPerson = Rc.Common.DBUtility.DbHelperSQL.Query(Sql).Tables[0];
                foreach (var item in list)
                {
                    if (!string.IsNullOrEmpty(model.Mobile) && !string.IsNullOrEmpty(item.D_PublicValue))
                    {
                        string getResult = Rc.Common.RemotWeb.PostDataToServer(item.D_PublicValue + "AuthApi/?key=onlinecheck", "", System.Text.Encoding.UTF8, "GET");
                        string schoolUrl = item.D_PublicValue.Replace("http://", "").TrimEnd('/');
                        string strWhere  = string.Empty;
                        #region 给运营平台发送短信
                        if (string.IsNullOrEmpty(getResult)) // 无法访问
                        {
                            strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' and datediff(MI,ctime,getdate())<180 order by CTime desc "
                                                     , model.Mobile, item.School_Name);
                            DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                            if (dt.Rows.Count == 0 || (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() != "false"))
                            {
                                // 180分钟内未发送短信 或 最新短信不是无法访问
                                Dictionary <string, string> Para = new Dictionary <string, string>();
                                Para.Add("template_id", "10580");
                                Para.Add("template_para_schoolname", item.School_Name);
                                Para.Add("template_para_schoolurl", schoolUrl);
                                string msg = (item.School_Name + schoolUrl + "无法访问");
                                Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "false", item.School_ID);
                            }
                        }
                        else
                        {
                            strWhere = string.Format(" Mobile='{0}' and SType='自动检测学校公网' and Content like '%{1}%' order by CTime desc "
                                                     , model.Mobile, item.School_Name);
                            DataTable dt = new BLL_SendSMSRecord().GetList(strWhere).Tables[0];
                            if (dt.Rows.Count > 0 && dt.Rows[0]["Status"].ToString() == "false")
                            {
                                Dictionary <string, string> Para = new Dictionary <string, string>();
                                Para.Add("template_id", "10581");
                                Para.Add("template_para_schoolname", item.School_Name);
                                Para.Add("template_para_schoolurl", schoolUrl);
                                string msg = (item.School_Name + schoolUrl + "已恢复正常");
                                Rc.Cloud.Web.Common.pfunction.SendSMS_New("/sendtongzhi/", model.Mobile, Para, msg, "自动检测学校公网", "true", item.School_ID);
                            }
                        }
                        #endregion
                        #region 给学校群发短信
                        if (dtPerson.Rows.Count > 0)
                        {
                            SendMsgSchoolPerson(dtPerson, item.School_ID, model.Mobile, item.D_PublicValue, getResult, schoolUrl);
                        }
                        #endregion
                    }
                }
                #region 记录检测结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "检测成功完成";
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";

                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "检测失败:" + ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
            }
        }
예제 #7
0
        /// <summary>
        /// 同步教案new
        /// </summary>
        public void ResSynchroTeachingPlan()
        {
            //生产环境web站点存放文件的主目录
            string strProductPublicUrl      = ConfigurationManager.AppSettings["ProductPublicUrl"].ToString();
            string strFileSyncExecRecord_id = Guid.NewGuid().ToString();
            bool   isCover      = true;//是否覆盖
            string strCondition = string.Format("日期【】;是覆盖:【{0}】", isCover);
            string strbookId    = hid_bookId.Value.Filter();
            string strrtrfId    = hid_rtrfId.Value.Filter();

            if (!string.IsNullOrEmpty(strbookId))
            {
                Model_ResourceFolder modelRF = new BLL_ResourceFolder().GetModel(strbookId);
                if (modelRF != null)
                {
                    strCondition += string.Format(";书本【{0}】【{1}】", modelRF.ResourceFolder_Name, modelRF.ResourceFolder_Id);
                }
            }
            if (!string.IsNullOrEmpty(strrtrfId))
            {
                Model_ResourceToResourceFolder modelRTRF = new BLL_ResourceToResourceFolder().GetModel(strrtrfId);
                if (modelRTRF != null)
                {
                    strCondition += string.Format(";资源【{0}】【{1}】", modelRTRF.Resource_Name, modelRTRF.ResourceToResourceFolder_Id);
                }
            }

            #region 记录同步开始信息
            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "同步教案new";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "正在同步...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            model_FileSyncExecRecord.createUser = SysUser_ID;
            model_FileSyncExecRecord.FileSyncExecRecord_Condition = strCondition;
            bll_FileSyncExecRecord.Add(model_FileSyncExecRecord);
            #endregion

            try
            {
                //教案文件,htm文件相关数据
                DataTable dtFilePlan = GetDtFilePlan(strbookId, strrtrfId);
                //教案预览图片文件相关数据
                DataTable dtFilePlanView = GetDtFilePlanView(strbookId, strrtrfId);

                DataView dataView = dtFilePlan.DefaultView;
                // 资源数据
                DataTable dtRTRF = new DataTable();
                if (dtFilePlan.Rows.Count > 0)
                {
                    dtRTRF = dataView.ToTable(true, "Book_Id", "ResourceToResourceFolder_Id");
                }

                foreach (DataRow item in dtRTRF.Rows)
                {
                    #region  载文件
                    //教案SW+thm
                    DataRow[] drSWdsc = dtFilePlan.Select(string.Format(" Resource_Type='{0}' and ResourceToResourceFolder_Id='{1}' "
                                                                        , Resource_TypeConst.ScienceWord类型文件, item["ResourceToResourceFolder_Id"]));
                    DownLoadFile(drSWdsc, "swDocument", "dsc", strProductPublicUrl, strFileSyncExecRecord_id, "教案SWdsc", isCover);
                    DownLoadFile(drSWdsc, "swDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "教案SWdsc", isCover);
                    //教案class+thm
                    DataRow[] drClass = dtFilePlan.Select(string.Format(" Resource_Type='{0}' and ResourceToResourceFolder_Id='{1}' "
                                                                        , Resource_TypeConst.class类型文件, item["ResourceToResourceFolder_Id"]));
                    DownLoadFile(drClass, "classDocument", "class", strProductPublicUrl, strFileSyncExecRecord_id, "教案class", isCover);
                    DownLoadFile(drClass, "classDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "教案class", isCover);
                    //微课class+thm
                    DataRow[] drMicroClass = dtFilePlan.Select(string.Format(" Resource_Type='{0}' and ResourceToResourceFolder_Id='{1}' "
                                                                             , Resource_TypeConst.class类型微课件, item["ResourceToResourceFolder_Id"]));
                    DownLoadFile(drMicroClass, "microClassDocument", "class", strProductPublicUrl, strFileSyncExecRecord_id, "微课class", isCover);
                    DownLoadFile(drMicroClass, "microClassDocument", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "微课class", isCover);


                    //教案SW+预览图片
                    DataRow[] drSWdscView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}' and ResourceToResourceFolder_Id='{1}' "
                                                                                , Resource_TypeConst.ScienceWord类型文件, item["ResourceToResourceFolder_Id"]));
                    DownLoadFile(drSWdscView, "swView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "教案SW预览图片", isCover);
                    //教案Class+预览图片
                    DataRow[] drClassView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}' and ResourceToResourceFolder_Id='{1}' "
                                                                                , Resource_TypeConst.class类型文件, item["ResourceToResourceFolder_Id"]));
                    DownLoadFile(drClassView, "classView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "教案Class预览图片", isCover);
                    //微课Class+预览图片
                    DataRow[] drMicroClassView = dtFilePlanView.Select(string.Format(" Resource_Type='{0}' and ResourceToResourceFolder_Id='{1}' "
                                                                                     , Resource_TypeConst.class类型微课件, item["ResourceToResourceFolder_Id"]));
                    DownLoadFile(drMicroClassView, "microClassView", "jpg", strProductPublicUrl, strFileSyncExecRecord_id, "微课Class预览图片", isCover);
                    #endregion

                    #region 更新SyncData
                    string strSqlSyncData = string.Format(@"update SyncData set SyncStatus='3' where TableName='ResourceFolder' and  SyncStatus<>'3' and DataId='{0}';
                        update SyncData set SyncStatus='3' where TableName='ResourceToResourceFolder' and  SyncStatus<>'3' and DataId='{1}'; "
                                                          , item["Book_Id"], item["ResourceToResourceFolder_Id"]);
                    Rc.Common.DBUtility.DbHelperSQL.ExecuteSqlByTime(strSqlSyncData, 60);
                    #endregion
                }



                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步成功完成";
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";

                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步失败:" + ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
            }
        }
        /// <summary>
        /// 同步习题集
        /// </summary>
        public void ResSynchroTeachingPlan()
        {
            //生产环境web站点存放文件的主目录
            string strProductPublicUrl      = ConfigurationManager.AppSettings["ProductPublicUrl"].ToString();
            string strFileSyncExecRecord_id = Guid.NewGuid().ToString();
            bool   isCover      = true;//是否覆盖
            string strCondition = string.Format("日期【】;是覆盖:【{0}】", isCover);
            string strbookId    = hid_bookId.Value.Filter();
            string strrtrfId    = hid_rtrfId.Value.Filter();

            if (!string.IsNullOrEmpty(strbookId))
            {
                Model_ResourceFolder modelRF = new BLL_ResourceFolder().GetModel(strbookId);
                if (modelRF != null)
                {
                    strCondition += string.Format(";书本【{0}】【{1}】", modelRF.ResourceFolder_Name, modelRF.ResourceFolder_Id);
                }
            }
            if (!string.IsNullOrEmpty(strrtrfId))
            {
                Model_ResourceToResourceFolder modelRTRF = new BLL_ResourceToResourceFolder().GetModel(strrtrfId);
                if (modelRTRF != null)
                {
                    strCondition += string.Format(";资源【{0}】【{1}】", modelRTRF.Resource_Name, modelRTRF.ResourceToResourceFolder_Id);
                }
            }

            #region 记录同步开始信息

            Rc.Model.Resources.Model_FileSyncExecRecord model_FileSyncExecRecord = new Rc.Model.Resources.Model_FileSyncExecRecord();
            Rc.BLL.Resources.BLL_FileSyncExecRecord     bll_FileSyncExecRecord   = new Rc.BLL.Resources.BLL_FileSyncExecRecord();
            model_FileSyncExecRecord.FileSyncExecRecord_id        = strFileSyncExecRecord_id;
            model_FileSyncExecRecord.FileSyncExecRecord_Type      = "同步试卷new";
            model_FileSyncExecRecord.FileSyncExecRecord_Remark    = "同步进行中...";
            model_FileSyncExecRecord.FileSyncExecRecord_TimeStart = DateTime.Now;
            model_FileSyncExecRecord.FileSyncExecRecord_Status    = "0";
            model_FileSyncExecRecord.FileSyncExecRecord_Condition = strCondition;
            model_FileSyncExecRecord.createUser = SysUser_ID;
            bll_FileSyncExecRecord.Add(model_FileSyncExecRecord);
            #endregion

            try
            {
                //试卷文件相关数据
                DataTable dtFileTestPaper = GetDtFileTestPaperTestQuestion(strbookId, strrtrfId);
                //试题相关数据
                DataTable dtFileTestPaperScore = GetDtFileTestPaperTestQuestions_Score(strbookId, strrtrfId);

                DataView dataView = dtFileTestPaper.DefaultView;
                // 资源数据
                DataTable dtRTRF = new DataTable();
                if (dtFileTestPaper.Rows.Count > 0)
                {
                    dtRTRF = dataView.ToTable(true, "Book_Id", "ResourceToResourceFolder_Id");
                }
                foreach (DataRow item in dtRTRF.Rows)
                {
                    #region  载文件
                    DataRow[] dvFileTestPaper = dtFileTestPaper.Select(string.Format(" ResourceToResourceFolder_Id='{0}' ", item["ResourceToResourceFolder_Id"]));
                    //题干	BASE64内容,存储目录:testQuestionBody/属性层次目录/试题标识.txt
                    DownLoadFile(dvFileTestPaper, "testQuestionBody", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "题干txt", isCover);
                    //题干 	HTML内容,存储目录:testQuestionBody/属性层次目录/试题标识.htm
                    DownLoadFile(dvFileTestPaper, "testQuestionBody", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "题干htm", isCover);

                    DataRow[] dvFileTestPaperScore = dtFileTestPaperScore.Select(string.Format(" ResourceToResourceFolder_Id='{0}' ", item["ResourceToResourceFolder_Id"]));
                    //	选择题的选项(数组对象)存储目录:testQuestionOption/属性层次目录/试题标识.txt(存储JSION结构到文本文件,一个题只有一个文件)
                    DownLoadFile(dvFileTestPaperScore, "testQuestionOption", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "选择题选项txt", isCover);
                    //	c)	标准答案(数组)存储目录:testQuestionCurrent/属性层次目录/试题标识.txt(存储JSION结构到文本文件,一个题只有一个文件)
                    DownLoadFile(dvFileTestPaperScore, "testQuestionCurrent", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "标准答案txt", isCover);
                    //	解析 	BASE64内容AnalyzeData/属性层次目录/试题标识.txt
                    DownLoadFile(dvFileTestPaperScore, "AnalyzeData", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "解析txt", isCover);
                    //	解析 	HTML内容AnalyzeHtml/属性层次目录/试题标识.htm
                    DownLoadFile(dvFileTestPaperScore, "AnalyzeHtml", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "解析htm", isCover);
                    //	e)	强化训练 		BASE64内容TrainData/属性层次目录/试题标识.txt
                    DownLoadFile(dvFileTestPaperScore, "TrainData", "txt", strProductPublicUrl, strFileSyncExecRecord_id, "强化训练txt", isCover);
                    //	e)	强化训练 		HTML内容TrainHtml/属性层次目录/试题标识.htm
                    DownLoadFile(dvFileTestPaperScore, "TrainHtml", "htm", strProductPublicUrl, strFileSyncExecRecord_id, "强化训练htm", isCover);
                    #endregion

                    #region 更新SyncData
                    string strSqlSyncData = string.Format(@"update SyncData set SyncStatus='3' where TableName='ResourceFolder' and  SyncStatus<>'3' and DataId='{0}';
                        update SyncData set SyncStatus='3' where TableName='ResourceToResourceFolder' and  SyncStatus<>'3' and DataId='{1}'; "
                                                          , item["Book_Id"], item["ResourceToResourceFolder_Id"]);
                    Rc.Common.DBUtility.DbHelperSQL.ExecuteSqlByTime(strSqlSyncData, 60);
                    #endregion
                }


                #region 记录同步结束信息并保存数据
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "1";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步已完成";
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                #endregion
            }
            catch (Exception ex)
            {
                model_FileSyncExecRecord.FileSyncExecRecord_TimeEnd = DateTime.Now;
                model_FileSyncExecRecord.FileSyncExecRecord_Status  = "2";
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = "同步失败:" + ex.Message.ToString();
                model_FileSyncExecRecord.FileSyncExecRecord_Remark  = ex.Message.ToString();
                bll_FileSyncExecRecord.Update(model_FileSyncExecRecord);
                throw;
            }
        }