diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs index 8c247613b..f18eff3af 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/CdMajorController.cs @@ -18,6 +18,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { private CdMajorIBLL cdMajorIBLL = new CdMajorBLL(); private ArrangeLessonSyncIBLL arrangeLessonSyncIBLL = new ArrangeLessonSyncBLL(); + private StuEnrollScoreIBLL stuEnrollScoreIBLL = new StuEnrollScoreBLL(); + private ExamSubjectIBLL examSubjectIBLL = new ExamSubjectBLL(); + private MajorAndSubjectIBLL majorAndSubjectIBLL = new MajorAndSubjectBLL(); #region 视图功能 @@ -51,6 +54,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers #endregion #region 获取数据 + /// + /// 返回前五年+后五年的年份yyyy + /// + /// + public ActionResult GenerateNearByYear() + { + return Success(WebHelper.GenerateNearByYear()); + } /// /// 获取页面显示列表数据 @@ -128,6 +139,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult DeleteForm(string keyValue) { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var model = cdMajorIBLL.GetCdMajorEntity(item); + int AuditCout = stuEnrollScoreIBLL.IsExistNoCheck(model.Year, keyValue); + if (AuditCout > 0) + { + return Fail("不能删除关联学科"); + } + } + cdMajorIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } @@ -168,8 +190,25 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { entity.SyncFlag = false; } + //删除所关联的科目 + majorAndSubjectIBLL.DeleteEntityById(keyValue); + } + int AuditCout = stuEnrollScoreIBLL.IsExistNoCheck(entity.Year, keyValue); + if (AuditCout > 0) + { + return Fail("不能修改关联学科"); } cdMajorIBLL.SaveEntity(keyValue, entity); + #region 给关联表添加科目 + MajorAndSubjectEntity majorAndSubjectEntity = new MajorAndSubjectEntity(); + string[] SubNo = entity.SubjectNo.Split(','); + for (int i = 0; i < SubNo.Length; i++) + { + majorAndSubjectEntity.MajorId = entity.ID;//关联专业主键 + majorAndSubjectEntity.SubId = SubNo[i];//考试科目的主键 + majorAndSubjectIBLL.SaveEntity("", majorAndSubjectEntity); + } + #endregion return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.cshtml index 66ba2d1fe..06abe549b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.cshtml @@ -15,14 +15,31 @@
学制*
-
-
学科门类
-
-
校区*
+
+
考试科目*
+
+ +
+
+
年度*
+
+
+
+
地市*
+
+
+
+
县区*
+
+
+
+
学科门类
+
+
系别
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.js index 2c061f39d..a03206c16 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Form.js @@ -15,6 +15,46 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { + $('#Year').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear', + value: 'value', + text: 'text' + }); + $('#SubjectNo').lrselect({ + type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject', + value: 'id', + text: 'subjectname', + maxHeight: 200 + }); + $('#City').lrselect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', + param: { strWhere: " cparent= 650000 " }, + value: 'ccode', + text: 'cname', + maxHeight: 200, + select: function (item) { + var Citys = $("#City").lrselectGet(); + if (Citys != null && Citys != "" && Citys != undefined) { + $('#Area').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: " 1=1 and aparent in (" + Citys + ")" }, + value: "acode", + text: "aname", + maxHeight: 200 + }); + } else { + $('#Area').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: " 1=1 and aparent ='' " }, + value: "acode", + text: "aname", + maxHeight: 200 + }); + } + } + }) + $("#Area").lrselect(); $('#SubjectSpeciesNo').lrDataItemSelect({ code: 'SubjectSpecies' }); $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { @@ -54,6 +94,8 @@ var bootstrap = function ($, learun) { if (!$('body').lrValidform()) { return false; } + $("#SubjectName").val($("#SubjectNo").find(".lr-select-placeholder").text()); + var sss = $("#SubjectName").val($("#SubjectNo").find(".lr-select-placeholder").text()); var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Index.js index eb7909c2e..8743eebc5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/CdMajor/Index.js @@ -17,6 +17,8 @@ var bootstrap = function ($, learun) { page.search(queryJson); }, 220, 400); $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#Area').lrDataSourceSelect({ code: 'DIC_AREA', value: 'acode', text: 'aname' }); + $('#City').lrDataSourceSelect({ code: 'DIC_CITY', value: 'ccode', text: 'cname' }); $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); // 刷新 $('#lr_refresh').on('click', function () { @@ -29,7 +31,7 @@ var bootstrap = function ($, learun) { title: '新增', url: top.$.rootUrl + '/EducationalAdministration/CdMajor/Form', width: 1000, - height: 600, + height: 700, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -53,7 +55,7 @@ var bootstrap = function ($, learun) { title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/CdMajor/Form?keyValue=' + keyValue, width: 1000, - height: 600, + height: 700, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -207,6 +209,48 @@ var bootstrap = function ($, learun) { } }); } + }, + //{ + // label: "考试科目", name: "SubjectNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getsAsync('custmerData', + // { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject', + // key: value, + // keyId: 'Id', + // textId: 'subjectname', + // callback: function (text) { + // callback(text); + // } + // }); + // } + //}, + { label: "年度", name: "Year", width: 100, align: "left" }, + { + label: "地市", name: "City", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', + key: value, + keyId: 'ccode', + callback: function (_data) { + callback(_data['cname']); + } + }); + } + }, + { + label: "县区", name: "Area", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA', + key: value, + keyId: 'acode', + callback: function (_data) { + callback(_data['aname']); + } + }); + } } ], mainId: 'ID', diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/MajorAndSubjectMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/MajorAndSubjectMap.cs new file mode 100644 index 000000000..069fb6b20 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/MajorAndSubjectMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-18 11:19 + /// 描 述:MajorAndSubject + /// + public class MajorAndSubjectMap : EntityTypeConfiguration + { + public MajorAndSubjectMap() + { + #region 表、主键 + //表 + this.ToTable("MAJORANDSUBJECT"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index e45cf113a..24bb0b26e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -86,6 +86,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs index 3637f9715..da22b69f3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorEntity.cs @@ -127,6 +127,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("PHOTO")] public string Photo { get; set; } + /// + /// 年度 + /// + [Column("YEAR")] + public string Year { get; set; } + /// + /// 地市 + /// + [Column("CITY")] + public string City { get; set; } + /// + /// 区县 + /// + [Column("AREA")] + public string Area { get; set; } #endregion #region 扩展操作 @@ -172,6 +187,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [NotMapped] public string SchoolName { get; set; } + /// + /// 科目名称 + /// + [NotMapped] + public string SubjectName { get; set; } + /// + /// 科目编码 + /// + [NotMapped] + public string SubjectNo { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs index 50ebe5dee..ae284b0ec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdMajor/CdMajorService.cs @@ -45,7 +45,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration t.GovMajorName, t.GraduateNo, t.MajorDirector, - t.CheckMark + t.CheckMark, + t.Year, + t.City, + t.Area "); strSql.Append(" FROM CdMajor t "); strSql.Append(" WHERE 1=1 "); @@ -203,7 +206,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + var List = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + if (List != null) + { + List.SubjectNo = string.Join(",", BaseRepository("CollegeMIS").FindList(o => o.MajorId == List.ID).Select(o => o.SubId)); + } + return List; } catch (Exception ex) { @@ -253,6 +261,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public void DeleteEntity(string keyValue) { + MajorAndSubjectIBLL majorAndSubjectIBLL = new MajorAndSubjectBLL(); var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { @@ -263,6 +272,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var keyValueArr = keyValue.Split(','); foreach (var item in keyValueArr) { + majorAndSubjectIBLL.DeleteEntityById(item);//删除关联科目垃圾数据 db.Delete(t => t.ID == item); } db.Commit(); @@ -380,7 +390,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return BaseRepository("CollegeMIS").FindList(m=>m.CheckMark==true); + return BaseRepository("CollegeMIS").FindList(m => m.CheckMark == true); } catch (Exception ex) {