From 676b7e0baa1beb87a0025f055557d14ad7cc4231 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 25 Jul 2022 11:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DataCollectionController.cs | 12 +++ .../Views/DataCollection/Index.cshtml | 1 + .../LR_Desktop/Views/DataCollection/Index.js | 10 +++ .../DataCollection/DataCollectionBLL.cs | 19 +++++ .../DataCollection/DataCollectionIBLL.cs | 1 + .../DataCollection/DataCollectionService.cs | 81 +++++++++++++++++++ 6 files changed, 124 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs index d09deaef2..7e86701a6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/DataCollectionController.cs @@ -63,5 +63,17 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers dataCollectionIBLL.SyncTextBook(); return Success("操作成功"); } + /// + /// 排课数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SyncArrangeLessonTerm() + { + dataCollectionIBLL.SyncArrangeLessonTerm(); + return Success("操作成功"); + } + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml index 920f3e6ec..6ff187475 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.cshtml @@ -25,6 +25,7 @@  校区基础数据  课程信息数据  教材信息数据 +  排课数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js index a093b61f6..2bbdba997 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/DataCollection/Index.js @@ -52,6 +52,16 @@ var bootstrap = function ($, learun) { } }); }); + //排课数据 + $('#lr_arrangeLessonTerm').on('click', function () { + learun.layerConfirm('是否确认推送排课数据!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncArrangeLessonTerm', function () { + refreshGirdData(); + }); + } + }); + }); }, // 初始化列表 initGird: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs index 4122edbf4..12edef764 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionBLL.cs @@ -103,5 +103,24 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + public void SyncArrangeLessonTerm() + { + try + { + dataCollectionService.SyncArrangeLessonTerm(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs index 5faf2e24c..d1744ea49 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionIBLL.cs @@ -9,5 +9,6 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop void SaveXqjbsj(); void SyncLesson(); void SyncTextBook(); + void SyncArrangeLessonTerm(); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs index 5882e6a98..16fd8cd01 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/DataCollection/DataCollectionService.cs @@ -300,6 +300,87 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } } + + + /// + /// 排课数据 + /// + public void SyncArrangeLessonTerm() + { + try + { + //校区信息 + var company = this.BaseRepository().FindList(x => x.F_DeleteMark == 0 && x.F_EnabledMark == 1).FirstOrDefault(); + + var semesterAndYear = Common.GetSemesterAndYear(); + var strAcademicYear = semesterAndYear.AcademicYearShort; + var strSemester = semesterAndYear.Semester; + string sql = $@"select b.ALTId,b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName + from ArrangeLessonTerm b + left join ClassroomInfo c on c.ClassroomNo=b.classroomNo + left join ClassInfo d on replace(b.TeachClassNo,b.LessonName,'')=d.ClassNo + where b.AcademicYearNo='{strAcademicYear}' and b.Semester='{strSemester}' + and b.LessonDate>='{DateTime.Now.AddDays(-30)}' and b.LessonDate<='{DateTime.Now}' + and b.CheckMark=1"; + var result = BaseRepository("CollegeMIS").FindList(sql); + + ParamModel paramModel = new ParamModel(); + paramModel.dataObjName = "ods_jcxysj"; + + var list = new List(); + foreach (var data in result) + { + var param = new + { + gzzyqksjid = data.ALTId, + xxjgdm = company.F_USCreditCode, + xxjgmc = company.F_FullName, + ssxqbh = company.F_EnCode, + //jcbh = data.TextBookNo, + ////教材性质 + //jcxz = "1", + ////ISBN号,必填 + //isbn = "9787040195194", + //zzxm = data.FirstAuthor, + //cbrq = data.Pubdate, + //cbs = data.Publisher, + ////适用层次 + //sycc = "1", + ////价格 + //jg = data.Price > 0 ? data.Price : 0, + ////版次 + //bc = string.IsNullOrEmpty(data.Edition) ? "1" : data.Edition, + ////印次 + //yc = string.IsNullOrEmpty(data.Impression) ? "1" : data.Impression, + ////是否有练习册 + //sfylxc = data.IsWorkBook == true ? 1 : 0, + ////是否有教参教辅 + //sfyjcjf = data.IsTeachConsult == true ? 1 : 0, + //获奖情况 + hjqk = "0", + sjcjsj = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + }; + list.Add(param); + } + + paramModel.fileds = list; + var json = JsonConvert.SerializeObject(paramModel); + var connect = _redis.Read("access_token"); + connect = (connect).Replace("\"", ""); + var res = HttpMethods.HttpPostConnect(saveIncrUrl, json, connect); + } + catch (ExceptionEx ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region MyRegion