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);
+ }
+ }
+ }
}
}