@@ -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 获取数据 | |||
/// <summary> | |||
/// 返回前五年+后五年的年份yyyy | |||
/// </summary> | |||
/// <returns></returns> | |||
public ActionResult GenerateNearByYear() | |||
{ | |||
return Success(WebHelper.GenerateNearByYear()); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
@@ -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 | |||
@@ -15,14 +15,31 @@ | |||
<div class="lr-form-item-title">学制<font face="宋体">*</font></div> | |||
<input id="LengthOfSchooling" type="text" class="form-control" isvalid="yes" checkexpession="Num" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">学科门类</div> | |||
<div id="SubjectSpeciesNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">校区<font face="宋体">*</font></div> | |||
<div id="F_SchoolId" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">考试科目<font face="宋体">*</font></div> | |||
<div id="SubjectNo" isvalid="yes" checkexpession="NotNull"></div> | |||
<input id="SubjectName" type="hidden" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">年度<font face="宋体">*</font></div> | |||
<div id="Year" isvalid="yes" checkexpession="Num"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">地市<font face="宋体">*</font></div> | |||
<div id="City" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">县区<font face="宋体">*</font></div> | |||
<div id="Area" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">学科门类</div> | |||
<div id="SubjectSpeciesNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="CdMajor"> | |||
<div class="lr-form-item-title">系别</div> | |||
<div id="DeptNo"></div> | |||
@@ -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()) | |||
}; | |||
@@ -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', | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 11:19 | |||
/// 描 述:MajorAndSubject | |||
/// </summary> | |||
public class MajorAndSubjectMap : EntityTypeConfiguration<MajorAndSubjectEntity> | |||
{ | |||
public MajorAndSubjectMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("MAJORANDSUBJECT"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -86,6 +86,7 @@ | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamStudent.cs" /> | |||
<Compile Include="EducationalAdministration\LeaveSchoolMap.cs" /> | |||
<Compile Include="EducationalAdministration\MajorAndSubjectMap.cs" /> | |||
<Compile Include="EducationalAdministration\PracticeBaseMap.cs" /> | |||
<Compile Include="EducationalAdministration\R_EnterBuildingMap.cs" /> | |||
<Compile Include="EducationalAdministration\R_EnterSchoolMap.cs" /> | |||
@@ -127,6 +127,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
[Column("PHOTO")] | |||
public string Photo { get; set; } | |||
/// <summary> | |||
/// 年度 | |||
/// </summary> | |||
[Column("YEAR")] | |||
public string Year { get; set; } | |||
/// <summary> | |||
/// 地市 | |||
/// </summary> | |||
[Column("CITY")] | |||
public string City { get; set; } | |||
/// <summary> | |||
/// 区县 | |||
/// </summary> | |||
[Column("AREA")] | |||
public string Area { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -172,6 +187,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
[NotMapped] | |||
public string SchoolName { get; set; } | |||
/// <summary> | |||
/// 科目名称 | |||
/// </summary> | |||
[NotMapped] | |||
public string SubjectName { get; set; } | |||
/// <summary> | |||
/// 科目编码 | |||
/// </summary> | |||
[NotMapped] | |||
public string SubjectNo { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -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<CdMajorEntity>(keyValue); | |||
var List = this.BaseRepository("CollegeMIS").FindEntity<CdMajorEntity>(keyValue); | |||
if (List != null) | |||
{ | |||
List.SubjectNo = string.Join(",", BaseRepository("CollegeMIS").FindList<MajorAndSubjectEntity>(o => o.MajorId == List.ID).Select(o => o.SubId)); | |||
} | |||
return List; | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -253,6 +261,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <returns></returns> | |||
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<CdMajorEntity>(t => t.ID == item); | |||
} | |||
db.Commit(); | |||
@@ -380,7 +390,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
try | |||
{ | |||
return BaseRepository("CollegeMIS").FindList<CdMajorEntity>(m=>m.CheckMark==true); | |||
return BaseRepository("CollegeMIS").FindList<CdMajorEntity>(m => m.CheckMark == true); | |||
} | |||
catch (Exception ex) | |||
{ | |||