From 23e77fe98fc0f73b89fc5d5365aa923df379171b Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 26 Jul 2022 09:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E6=85=A7=E5=A4=A7=E8=84=91=E6=8E=92?= =?UTF-8?q?=E8=AF=BE=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DataCollectionController.cs | 11 ++ .../Views/DataCollection/Index.cshtml | 16 +- .../LR_Desktop/Views/DataCollection/Index.js | 12 ++ .../ArrangeLessonTermService.cs | 2 + .../DataCollection/DataCollectionBLL.cs | 21 +++ .../DataCollection/DataCollectionIBLL.cs | 1 + .../DataCollection/DataCollectionService.cs | 154 +++++++++++++++--- 7 files changed, 179 insertions(+), 38 deletions(-) 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 7e86701a6..5ecd8ef1c 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 @@ -74,6 +74,17 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers dataCollectionIBLL.SyncArrangeLessonTerm(); return Success("操作成功"); } + /// + /// 教师进修培训数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SyncTeacherTrain() + { + dataCollectionIBLL.SyncTeacherTrain(); + 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 6ff187475..cdac17bde 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 @@ -6,26 +6,14 @@
- @*
- -
-
-
- -
- -
*@ +
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 2bbdba997..ce667ca6b 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 @@ -62,6 +62,18 @@ var bootstrap = function ($, learun) { } }); }); + //教师进修培训 + $('#lr_teacherTrain').on('click', function () { + learun.layerConfirm('是否确认推送教师培训数据!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/LR_Desktop/DataCollection/SyncTeacherTrain', function () { + refreshGirdData(); + }); + } + }); + }); + + }, // 初始化列表 initGird: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs index 063724e29..da0273401 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs @@ -2363,6 +2363,8 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les public class TimeTable { + public string Grade { get; set; } + public string StuNum { get; set; } public string ALTId { get; set; } public DateTime LessonDate { get; set; } public string EnName { get; set; } 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 12edef764..d442f34f7 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 @@ -122,5 +122,26 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } } + + + public void SyncTeacherTrain() + { + try + { + dataCollectionService.SyncTeacherTrain(); + } + 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 d1744ea49..bc3998567 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 @@ -10,5 +10,6 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop void SyncLesson(); void SyncTextBook(); void SyncArrangeLessonTerm(); + void SyncTeacherTrain(); } } 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 16fd8cd01..c4aad960b 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 @@ -315,7 +315,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop 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 + string sql = $@"select d.Grade,d.StuNum,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 @@ -325,39 +325,35 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop var result = BaseRepository("CollegeMIS").FindList(sql); ParamModel paramModel = new ParamModel(); - paramModel.dataObjName = "ods_jcxysj"; + paramModel.dataObjName = "ods_zzxkpksj"; var list = new List(); foreach (var data in result) { + var lessonTime = data.LessonTime.Split('-'); 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", + nj = data.Grade, + bj = data.TeachClassNo, + xn = data.AcademicYear, + xq = data.Semester == "1" ? "第一学期" : "第二学期", + zc = "", + xqj = GetStr(lessonTime[0]), + skjc = lessonTime[1], + skrq = data.LessonDate, + kcmc = data.LessonName, + kcdm = data.LessonNo, + jgh = data.EmpNo, + jxbrs = data.StuNum, + skkssj = GetTime(lessonTime[1])[0], + skjssj = GetTime(lessonTime[1])[1], + sdxsrs = data.StuNum, + jsdkqk = "1", + xkr = "", sjcjsj = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") }; list.Add(param); @@ -381,6 +377,116 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } } + + private string GetStr(string num) + { + var str = ""; + switch (num) + { + case "1": + str = "星期一"; break; + case "2": + str = "星期二"; break; + case "3": + str = "星期三"; break; + case "4": + str = "星期四"; break; + case "5": + str = "星期五"; break; + case "6": + str = "星期六"; break; + case "7": + str = "星期日"; break; + case "8": + str = "星期八"; break; + case "9": + str = "星期九"; break; + case "10": + str = "星期十"; break; + } + return str; + } + + private string GetTime(string jc) + { + var str = ""; + //06:55-07:30,08:10-08:55,09:05-09:50,10:20-11:05,11:15-12:00,14:30-15:15,15:25-16:10,16:20-17:05,18:20-19:05,19:15-20:00,20:10-20:55 + switch (jc) + { + case "1": + str = "06:55-07:30"; break; + case "2": + str = "08:10-08:55"; break; + case "3": + str = "09:05-09:50"; break; + case "4": + str = "10:20-11:05"; break; + case "5": + str = "11:15-12:00"; break; + case "6": + str = "14:30-15:15"; break; + case "7": + str = "15:25-16:10"; break; + case "8": + str = "16:20-17:05"; break; + case "9": + str = "18:20-19:05"; break; + case "10": + str = "19:15-20:00"; break; + case "11": + str = "20:10-20:55"; break; + } + + return str; + } + + /// + /// 教师进修培训 + /// + public void SyncTeacherTrain() + { + try + { + //校区信息 + var company = this.BaseRepository().FindList(x => x.F_DeleteMark == 0 && x.F_EnabledMark == 1).FirstOrDefault(); + //教材数据 + var textBookInfo = this.BaseRepository("CollegeMIS").FindList(x => x.IsValid == true && x.IsDel == 0); + + ParamModel paramModel = new ParamModel(); + paramModel.dataObjName = "ods_jxpxsj"; + + var list = new List(); + foreach (var book in textBookInfo) + { + var param = new + { + //gzzyqksjid = book.ID, + //xxjgdm = company.F_USCreditCode, + //xxjgmc = company.F_FullName, + + //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