From 44afca471fa96dff76dbdf63ecebdca57af84311 Mon Sep 17 00:00:00 2001 From: hwh2023 <598694955@qq.com> Date: Sun, 7 Jul 2024 18:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=94=E4=BE=8B=E5=AF=BC=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E8=AF=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrangeLessonTermAttemperController.cs | 16 +- .../Controllers/OpenLessonPlanController.cs | 75 ++++++ .../Controllers/StuScoreController.cs | 8 +- .../ArrangeLessonTermAttemper/Form.cshtml | 73 +++--- .../Views/ArrangeLessonTermAttemper/Form.js | 26 +- .../ArrangeLessonTermAttemper/FormView.cshtml | 5 + .../ArrangeLessonTermAttemper/FormView.js | 45 ++-- .../Views/ArrangeLessonTermAttemper/Index.js | 4 + .../Views/OpenLessonPlan/ImportForm.cshtml | 24 ++ .../Views/OpenLessonPlan/ImportForm.css | 136 ++++++++++ .../Views/OpenLessonPlan/ImportForm.js | 240 ++++++++++++++++++ .../Views/OpenLessonPlan/Index.cshtml | 3 +- .../Views/OpenLessonPlan/Index.js | 15 ++ .../StuScore/GraduateScoreQueryAllIndex.js | 38 +-- .../Controllers/ExcelImportController.cs | 31 +++ .../TimeTable/IndexInEducationSelect.cshtml | 8 +- .../Views/TimeTable/IndexInEducationSelect.js | 112 ++++++-- .../Content/excel/OpenLessonPlanImport.xls | Bin 0 -> 31232 bytes .../Learun.Application.Web.csproj | 3 + .../ArrangeLessonTermAttemperEntity.cs | 20 +- .../ArrangeLessonTermAttemperService.cs | 152 ++++++----- .../OpenLessonPlan/OpenLessonPlanBLL.cs | 47 ++++ .../OpenLessonPlan/OpenLessonPlanIBLL.cs | 13 + .../OpenLessonPlan/OpenLessonPlanService.cs | 221 ++++++++++++++++ 24 files changed, 1134 insertions(+), 181 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/ImportForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/ImportForm.css create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/ImportForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/OpenLessonPlanImport.xls diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs index 3c52846bc..6255248ce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs @@ -223,6 +223,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers itementity.NewEmpNo = entity.NewEmpNo; itementity.NewClassroomNo = entity.NewClassroomNo; + itementity.LessonDate = Convert.ToDateTime(item["LessonDate"].ToString()); + itementity.LessonTime = item["LessonTime"].ToString(); itementity.AcademicYearNo = item["Academicyear"].ToString(); itementity.Semester = item["Semester"].ToString(); itementity.DeptNo = item["DeptNo"].ToString(); @@ -231,14 +233,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers itementity.TeachClassNo = item["TeachClassNo"].ToString(); itementity.EmpNo = item["Empno"].ToString(); itementity.ClassroomNo = item["ClassRoomNo"].ToString(); + itementity.NewTime = entity.NewTime; itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限 itementity.AttemperStartTime = entity.AttemperStartTime; itementity.AttemperEndTime = entity.AttemperEndTime; - - itementity.Status = 0; - itementity.CheckStatus = 0; + if (itementity.AttemperType=="03") + { + itementity.Status = 1; + itementity.CheckStatus = 2;//通过 + } + else + { + itementity.Status = 0; + itementity.CheckStatus = 0; + } arrangeLessonTermAttemperIBLL.SaveEntity(keyValue, itementity); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanController.cs index 86cbf004f..16226850f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanController.cs @@ -3,6 +3,10 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System.IO; +using System; +using NPOI.HSSF.UserModel; +using NPOI.SS.UserModel; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -46,6 +50,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 导入表单页 + /// + /// + [HttpGet] + public ActionResult ImportForm() + { + return View(); + } #endregion #region 获取数据 @@ -159,6 +172,68 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("保存成功!"); } + /// + /// 下载文件 + /// + /// + public ActionResult DownTemplate() + { + FileStreamResult result = null; + try + { + var fileHead = "成绩比例设置导入模板"; + var path = Server.MapPath("~/Content/excel/"); + var pathoffull = path + "OpenLessonPlanImport.xls"; + string queryJson = "{}"; + var data = openLessonPlanIBLL.GetList( queryJson); + + IWorkbook book = null; + ISheet sheet = null; + FileStream fs = new FileStream(pathoffull, FileMode.Open, FileAccess.Read); + book = new HSSFWorkbook(fs); + sheet = book.GetSheetAt(0);//获取第一个工作表 + + //获取数据源 + int index = 1; + foreach (var item in data) + { + IRow row = sheet.CreateRow(index); + row.CreateCell(0).SetCellValue(item.ID); + row.CreateCell(1).SetCellValue(item.F_School); + row.CreateCell(2).SetCellValue(item.AcademicYearNo); + row.CreateCell(3).SetCellValue(item.Semester); + row.CreateCell(4).SetCellValue(item.Grade); + row.CreateCell(5).SetCellValue(item.DeptNo); + row.CreateCell(6).SetCellValue(item.DeptName); + row.CreateCell(7).SetCellValue(item.MajorNo); + row.CreateCell(8).SetCellValue(item.MajorName); + row.CreateCell(9).SetCellValue(item.LessonNo); + row.CreateCell(10).SetCellValue(item.LessonName); + index++; + } + + var fileguid = Guid.NewGuid().ToString(); + path = Server.MapPath("~/Resource/DormitoryBuildExportFile/" + DateTime.Now.ToString("yyyyMMdd") + "/"); + pathoffull = path + fileguid + ".xls"; + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + + FileStream fswrite = new FileStream(pathoffull, FileMode.Create, FileAccess.Write); + book.Write(fswrite); + fswrite.Close(); + FileStream fsread = new FileStream(pathoffull, FileMode.OpenOrCreate, FileAccess.Read); + result = File(fsread, "application/ms-excel", fileHead + ".xls"); + + + return result; + } + catch (Exception ex) + { + return null; + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs index 322bb0e19..d9144c8b3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs @@ -801,7 +801,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers aaa.Add("TotalScore", item.TotalScore.ToString()); foreach (var lessonInfoItem in item.LessonInfo) { - aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); + try + { + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); + } + catch (Exception) + { + } } result.Add(aaa); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml index 4e180d61a..bbfe6aa03 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml @@ -60,37 +60,37 @@
@*
-
学年*
-
-
-
-
学期*
-
-
-
-
系部*
-
-
-
-
专业*
-
-
-
-
课程*
-
-
-
-
班级*
-
-
-
-
教师*
-
-
-
-
教室*
-
-
*@ +
学年*
+
+
+
+
学期*
+
+
+
+
系部*
+
+
+
+
专业*
+
+
+
+
课程*
+
+
+
+
班级*
+
+
+
+
教师*
+
+
+
+
教室*
+
+
*@ *@ + @*
+
+
日期*
+
+
+
*@
学年*
@@ -146,6 +152,11 @@
调度结束时间*
+
+
日期*
+ @*
*@ + +
+
+
日期*
+ @*
*@ + +