From 4cb6f81292279b57d95b574a46931dc68dbf61aa Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 9 Aug 2022 09:39:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BC=80=E8=AF=BE=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanTeachController.cs | 4 +-- .../StuScore/StuScoreBLL.cs | 24 ++++++++++++++++ .../StuScore/StuScoreIBLL.cs | 1 + .../StuScore/StuScoreService.cs | 25 +++++++++++++++++ .../TeachClass/TeachClassBLL.cs | 23 +++++++++++++++ .../TeachClass/TeachClassIBLL.cs | 1 + .../TeachClass/TeachClassService.cs | 28 +++++++++++++++++++ 7 files changed, 104 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs index d71bb6b59..512b8cd1d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs @@ -217,8 +217,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var entityList = teachClassIBLL.GetTeachListById(keyValue).ToList(); foreach (var item in entityList) { - //teachClassIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo,item.Grade); - //stuScoreIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade); + teachClassIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo,item.Grade); + stuScoreIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade); } teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs index f311eb7a9..ff60ce650 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs @@ -1048,6 +1048,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade) + { + try + { + stuScoreService.UpEmpNos(xn, xq, classNo, LessonNo, EmpNo, HisEmpNo, Grade); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs index 7e987896c..e2945073e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs @@ -252,5 +252,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo); + void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index a1ac7a310..d9d7035da 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -1965,6 +1965,31 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string hisempno, string Grade) + { + try + { + StringBuilder sb = new StringBuilder(); + sb.Append(" update StuScore set EmpNo ='" + EmpNo + "' where classno = '" + classNo + "' and Semester ='" + xq + "' and AcademicYearNo ='" + xn + "' and LessonNo ='" + LessonNo + "' and empno = '" + hisempno + "' and Grade='" + Grade + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql(sb.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs index ef86f5a28..d784518c4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs @@ -274,6 +274,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade) + { + try + { + teachClassEntity.UpEmpNos(xn, xq, classNo, LessonNo, EmpNo, HisEmpNo, Grade); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs index e57f079fc..ec7d0b85a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs @@ -73,6 +73,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void UpEmpNo(string keyvalue, string EmpNo); string UpSetTeach(string keyvalue, string EmpNo); string UpQzSetTeach(string keyvalue, string EmpNo); + void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade); #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs index ea2dfbe83..4bb4388cc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs @@ -518,6 +518,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { string Result = ""; var db = BaseRepository("CollegeMIS").BeginTrans(); + try { #region 获取班级开课计划的数据 @@ -679,6 +680,33 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string hisempno, string Grade) + { + try + { + StringBuilder sb = new StringBuilder(); + sb.Append(" update StuSelectLessonList set EmpNo ='" + EmpNo + "' where classno = '" + classNo + "' and Semester ='" + xq + "' and AcademicYearNo ='" + xn + "' and LessonNo ='" + LessonNo + "' and empno = '" + hisempno + "' and Grade = '" + Grade + "'"); + this.BaseRepository("CollegeMIS").ExecuteBySql(sb.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion } } From 4f2b6b7cf20aff342f8cfbecc7c49d844702a9db Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 9 Aug 2022 10:00:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=B7=A6=E4=BE=A7=E6=A0=91=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/CdDeptController.cs | 13 +++- .../CdDept/CdDeptBLL.cs | 62 +++++++++++++++++++ .../CdDept/CdDeptIBLL.cs | 6 ++ .../CdDept/CdDeptService.cs | 26 ++++++++ 4 files changed, 106 insertions(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs index 9e6e7d06c..b7875fbfd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdDeptController.cs @@ -42,7 +42,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers #endregion #region 获取数据 - + /// + /// 获取树形数据 + /// + /// 父级id + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree(string parentId) + { + var data = cdDeptIBLL.GetTree(parentId); + return JsonResult(data); + } /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs index 761e51319..7f1f837a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs @@ -20,6 +20,68 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 获取数据 + public List GetTree(string parentId) + { + try + { + List list = GetList(); + List treeList = new List(); + foreach (var item in list) + { + TreeModel node = new TreeModel + { + id = item.DeptNo, + text = item.DeptName, + value = item.DeptNo, + showcheck = false, + checkstate = 0, + isexpand = true, + parentId = item.DeptId + }; + treeList.Add(node); + } + return treeList.ToTree(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取列表数据 + /// + /// + public List GetList() + { + try + { + //List list = cache.Read>(cacheKey); + //if (list == null) + //{ + // list = (List)cdDeptService.GetList(); + // cache.Write>(cacheKey, list, CacheId.company); + //} + return list; + } + 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/EducationalAdministration/CdDept/CdDeptIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs index f78a44803..065acaa4a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs @@ -15,6 +15,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { #region 获取数据 + /// + /// 获取树形数据 + /// + /// 父级id + /// + List GetTree(string parentId); /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs index dc46d1853..e32b67cd3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs @@ -20,6 +20,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { #region 获取数据 + /// + /// 获取公司列表信息(全部) + /// + /// + public IEnumerable GetList() + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(" * "); + strSql.Append(" FROM CdDept t WHERE 1=1 order by t.deptSort "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取页面显示列表数据 /// From 3e0726a15881d5fd9cb5f5c6a09eb67e44c93f82 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 9 Aug 2022 10:03:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=B7=A6=E4=BE=A7=E6=A0=91=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CdDept/CdDeptBLL.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs index 7f1f837a3..265df897c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs @@ -18,6 +18,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { private CdDeptService cdDeptService = new CdDeptService(); + #region 缓存定义 + private ICache cache = CacheFactory.CaChe(); + private string cacheKey = "Learun_adms_cddept"; + + #endregion #region 获取数据 public List GetTree(string parentId) @@ -62,12 +67,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - //List list = cache.Read>(cacheKey); - //if (list == null) - //{ - // list = (List)cdDeptService.GetList(); - // cache.Write>(cacheKey, list, CacheId.company); - //} + List list = cache.Read>(cacheKey); + if (list == null) + { + list = (List)cdDeptService.GetList(); + cache.Write>(cacheKey, list, CacheId.company); + } return list; } catch (Exception ex)