From f0b3f727f4e4711d589b99af2656f2849138ff80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=99=93=E7=90=AA?= Date: Thu, 11 Aug 2022 14:39:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AF=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LearunApp-2.2.0/common/js/common.js | 15 + .../LearunApp-2.2.0/config.js | 3 +- .../LearunApp-2.2.0/pages/timeTable/list.vue | 1274 ++++++++++++----- 3 files changed, 954 insertions(+), 338 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/common.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/common.js index 718569842..cc3c26170 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/common.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/js/common.js @@ -38,6 +38,21 @@ export default { Sunday: this.fmtDate(SundayTime) } }, + weekday2() { //根据今天得到周一与周日的时间 + var now = new Date();  + var nowTime = now.getTime();  + var day = now.getDay(); + //显示周一 + var MondayTime = nowTime - (day - 1) * this.oneDayTime() ;  + //显示周日 + var SundayTime =  nowTime + (14 - day) * this.oneDayTime() ;  + return { + MondayTime: MondayTime, + Monday: this.fmtDate(MondayTime), + SundayTime: SundayTime, + Sunday: this.fmtDate(SundayTime) + } + }, compare (key) { return (obj1, obj2) => { let value1 = obj1[key] diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index fb4b2bba2..7163f921a 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -21,7 +21,8 @@ export default { // "http://192.168.2.98:8088/" // ], "apiHost": [ - "http://localhost:31173/" + // "http://localhost:31173/" + "http://192.168.10.58:8012/" ], // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 "devAccount": [ diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue index 27b9a42c3..aae0ad956 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue @@ -11,34 +11,40 @@ {{todayWeek.Monday}} - {{todayWeek.Sunday}} - + - - {{ item.en }} - {{ item.cn }} + + + {{ item.en }} + {{ item.cn }} + + - + - 该时间段没有课表 - - - 第 {{ k.sectionTime }} 节 + + 该时间段没有课表 + + + + 第 {{ k.jc }} 节 - {{ k.LessonName }} + {{ k.curriculum }} - {{ k.EmpName }} + {{ k.teacher }} - {{ k.ClassroomName }} + {{ k.className }} @@ -51,339 +57,933 @@ From ed1aa900598257b8df937b49d78ee7952a790465 Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 11 Aug 2022 14:42:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?app2.0=20=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E5=AD=A6=E7=94=9F10=E5=A4=A9=E8=AF=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/TimeTable.cs | 87 ++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs index 22104a168..74cc17b24 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs @@ -22,11 +22,15 @@ namespace Learun.Application.WebApi.Modules Get["/StuList"] = GetStuInfo; Get["/StuLessonInfo"] = GetStuLessonInfo; Get["/timeTableData"] = GetTimeTableData; + Get["/TenDay"] = GetTenDay; } private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL(); private StuAttendanceLeaveIBLL stuAttendanceLeaveIBLL = new StuAttendanceLeaveBLL(); private StuAttendanceIBLL stuAttendanceIBLL = new StuAttendanceBLL(); + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + private SchoolCalendarIBLL schoolCalendarIbll = new SchoolCalendarBLL(); /// /// 课程表【教师功能、学生功能】 @@ -113,7 +117,7 @@ namespace Learun.Application.WebApi.Modules } - + /// /// 全院课程表【按班级分组】 /// @@ -171,11 +175,88 @@ namespace Learun.Application.WebApi.Modules }).OrderBy(x => x.LessonSortNo).ThenBy(x => x.ClassNo).ToList(); result.ClassDataList = dataTemp; - + return Success(result); } + /// + /// 课程表【教师功能、学生功能】 + /// + /// + /// + public Response GetTenDay(dynamic _) + { + var param = this.GetReqData(); + var startdate = DateTime.Today; + var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd"); + var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd"); + + //获取学年,学期 + var semesterAndYear = Common.GetSemesterAndYear(startDate); + var strAcademicYear = semesterAndYear.AcademicYearLong; + var strSemester = semesterAndYear.Semester; + + var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); + var StartTime = entity.StartTime.Value; + + + var Data = arrangeLessonTermIBLL.GetTimeTableInEducation("", "", "", "", ""); + if (param.Description == "学生") + { + var Stulist = stuInfoBasicIBLL.GetAllList().Where(x => x.StuNo == param.Account).FirstOrDefault(); + if (Stulist != null) + { + Data = arrangeLessonTermIBLL.GetTimeTableInEducation(param.StartDate, param.EndDate, param.ClassNo, "", ""); + } + } + else if (param.Description == "教师") + { + //教师 + var empInfo = empInfoIbll.GetAllList().Where(x => x.EmpNo == userInfo.account).FirstOrDefault().EmpNo; + if (empInfo != null) + { + Data = arrangeLessonTermIBLL.GetTimeTableInEducation(param.StartDate, param.EndDate, "", param.EmpNo, ""); + } + } + + var formatData = from d in Data.AsEnumerable() + let tt = d.LessonTime.Split('-')[0] + group d by tt into g + orderby g.Key + select new + { + time = g.Key, + list = from e in Data.AsEnumerable() + let ee = e.LessonTime.Split('-')[0] + where ee == g.Key + select new + { + ALTId = e.ALTId, + day = e.LessonTime.Split('-')[0], + jc = e.LessonTime.Split('-')[1], + curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName, + teacher = e?.EmpName, + classRoom = string.IsNullOrEmpty(e.ClassroomName) ? "" : e.ClassroomName.Trim(), + academicyear = semesterAndYear.AcademicYearShort, + semester = strSemester, + lessonNo = e?.LessonNo, + teachClassNo = e?.TeachClassNo, + empno = e?.EmpNo, + lessonTime = e.LessonTime, + lessonDate = e.LessonDate.ToString("yyyy-MM-dd"), + classRoomNo = string.IsNullOrEmpty(e.ClassRoomNo) ? "" : e.ClassRoomNo.Trim(), + lessonSortNo = e.LessonSortNo, + e?.OLPEId, + className = string.IsNullOrEmpty(e.ClassName) ? "" : e.ClassName + } + } + ; + var result = new + { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = formatData }; + return Success(result); + + } /// /// 数字转中文 /// @@ -238,6 +319,8 @@ namespace Learun.Application.WebApi.Modules /// 教师编号 /// public string EmpNo { get; set; } + public string Description { get; set; } + public string Account { get; set; } } public class TimeTableData {