From 7edc0d1573f930d1a4260e41547536e20eafe5f0 Mon Sep 17 00:00:00 2001 From: liangkun Date: Tue, 31 Aug 2021 18:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E7=AE=A1=E7=90=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=90=8C=E6=AD=A5=E7=B3=BB=E4=B8=93=E4=B8=9A=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuInfoBasicController.cs | 15 ++++++ .../Views/StuInfoBasic/Index.cshtml | 2 + .../Views/StuInfoBasic/Index.js | 12 +++++ .../StuInfoBasic/StuInfoBasicBLL.cs | 38 ++++++++++++++ .../StuInfoBasic/StuInfoBasicIBLL.cs | 2 + .../StuInfoBasic/StuInfoBasicService.cs | 52 +++++++++++++++++++ 6 files changed, 121 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs index f21e8e63c..5a8050e97 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs @@ -522,6 +522,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuInfoBasicIBLL.SynPhoto(); return Success("同步成功!"); } + + [HttpPost] + [AjaxOnly] + public ActionResult SyncDept() + { + stuInfoBasicIBLL.SyncDept(); + return Success("同步成功"); + } + [HttpPost] + [AjaxOnly] + public ActionResult SyncMajor() + { + stuInfoBasicIBLL.SyncMajor(); + return Success("同步成功"); + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml index 85e50b95a..3c338ac37 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml @@ -53,6 +53,8 @@  查看异动  拍照  学生简历表 +   同步系部 +   同步专业 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js index 034ffda3b..eae134310 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js @@ -216,6 +216,18 @@ var bootstrap = function ($, learun) { }); } }); + // 同步系部 + $('#lr_syn').on('click', function () { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SyncDept', function () { + refreshGirdData(); + }); + }); + // 同步专业 + $('#lr_synmajor').on('click', function () { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SyncMajor', function () { + refreshGirdData(); + }); + }); }, // 初始化列表 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs index a52ae99af..1235a1458 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs @@ -315,6 +315,44 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public void SyncDept() + { + try + { + stuInfoBasicService.SyncDept(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SyncMajor() + { + try + { + stuInfoBasicService.SyncMajor(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public void UpdateAccount() { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs index 738ce5d45..fafb58369 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs @@ -76,5 +76,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration bool GetAny(); IEnumerable GetAllList(); IEnumerable GetStuInfoByClassNo(string classNo); + void SyncDept(); + void SyncMajor(); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs index a1dc54122..f68f07af5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs @@ -868,5 +868,57 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + public void SyncDept() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList().ToList(); + var majorList = this.BaseRepository("CollegeMIS").FindList().ToList(); + foreach (var item in data) + { + var deptNo = majorList.FirstOrDefault(a => a.MajorNo == item.MajorNo)?.DeptNo; + item.DeptNo = deptNo; + this.BaseRepository("CollegeMIS").Update(item); + + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public void SyncMajor() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList().ToList(); + var classList = this.BaseRepository("CollegeMIS").FindList().ToList(); + foreach (var item in data) + { + var majorNo = classList.FirstOrDefault(a => a.ClassNo == item.ClassNo)?.MajorNo; + item.MajorNo = majorNo; + this.BaseRepository("CollegeMIS").Update(item); + + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } }