@@ -326,6 +326,26 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// <summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageListForTJ(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = stuEnrollIBLL.GetPageListForTJ(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 审核页面 获取考试科目信息 | |||
@@ -949,7 +969,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult UpdateEnrollStatus(string keyValue, string strEntity) | |||
{ | |||
var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue); | |||
if (string.IsNullOrEmpty(StuEnrollData.SubjectNo) ) | |||
if (string.IsNullOrEmpty(StuEnrollData.SubjectNo)) | |||
{ | |||
return Fail("考试科目不能为空!"); | |||
} | |||
@@ -10,39 +10,76 @@ | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">地市</div> | |||
<div id="City"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">县区</div> | |||
<div id="County"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">年度</div> | |||
<div id="Year"></div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">推荐教师</div> | |||
<div id="EmpNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">姓名</div> | |||
<input id="StuName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">手机号</div> | |||
<input id="StuMobile" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">身份证号</div> | |||
<input id="IDCard" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">手机号</div> | |||
<input id="StuMobile" type="text" class="form-control" /> | |||
<div class="lr-form-item-title">中考总分</div> | |||
<input id="MidTermExam1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="MidTermExam2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">推荐教师</div> | |||
<div id="EmpNo"></div> | |||
<div class="lr-form-item-title">语文</div> | |||
<input id="chinese1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="chinese2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">数学</div> | |||
<input id="math1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="math2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">英语</div> | |||
<input id="english1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="english2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">物理与化学</div> | |||
<input id="physicsAndChemistry1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="physicsAndChemistry2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">政治与历史</div> | |||
<input id="politicsAndHistory1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="politicsAndHistory2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">体育</div> | |||
<input id="physicalEducation1" type="number" class="form-control" style="width: 40%;float: left;" /> | |||
<div><span style="padding-left: 7%;">--</span></div> | |||
<input id="physicalEducation2" type="number" class="form-control" style=" width: 43%;float: right;margin-top: -18px;" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -15,12 +15,12 @@ var bootstrap = function ($, learun) { | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 400, 400); | |||
}, 500, 400); | |||
//地市 | |||
$('#City').lrselect({ | |||
allowSearch: true, | |||
type: 'multiple', | |||
//type: 'multiple', | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', | |||
param: { strWhere: "1=1 and cparent='650000'" }, | |||
value: "ccode", | |||
@@ -32,7 +32,6 @@ var bootstrap = function ($, learun) { | |||
//县区 | |||
$('#County').lrselectRefresh({ | |||
allowSearch: true, | |||
type: 'multiple', | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', | |||
param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, | |||
value: "acode", | |||
@@ -62,9 +61,9 @@ var bootstrap = function ($, learun) { | |||
//县区 | |||
$('#County').lrselect({ | |||
allowSearch: true, | |||
type: 'multiple', | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', | |||
param: { strWhere: "1=1 " }, | |||
//type: 'multiple', | |||
//url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', | |||
//param: { strWhere: "1=1 " }, | |||
value: "acode", | |||
text: "aname", | |||
maxHeight: 200, | |||
@@ -73,7 +72,7 @@ var bootstrap = function ($, learun) { | |||
//专业 | |||
$('#MajorNo').lrselect({ | |||
allowSearch: true, | |||
type: 'multiple', | |||
//type: 'multiple', | |||
url: top.$.rootUrl + | |||
'/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', | |||
param: { | |||
@@ -85,7 +84,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
//老师 | |||
$('#EmpNo').lrselect({ | |||
type: 'multiple', | |||
//type: 'multiple', | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo', | |||
param: { strWhere: "1=1 " }, | |||
value: "empno", | |||
@@ -94,14 +93,14 @@ var bootstrap = function ($, learun) { | |||
}); | |||
//年度 | |||
$('#Year').lrselect({ | |||
type: 'multiple', | |||
// type: 'multiple', | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorYear', | |||
param: { strWhere: "1=1 " }, | |||
value: "year", | |||
text: "year", | |||
maxHeight: 200, | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -116,11 +115,84 @@ var bootstrap = function ($, learun) { | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetTJList', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageListForTJ', | |||
headData: [ | |||
{ label: "教师编号", name: "empno", width: 100, align: "left" }, | |||
{ label: "姓名", name: "StuName", width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "Gender", width: 100, align: "left", | |||
formatter: function (value) { | |||
if (value == '0') { | |||
return '女'; | |||
} else { | |||
return '男'; | |||
} | |||
} | |||
}, | |||
{ | |||
label: "教师姓名", name: "empno", width: 100, align: "left", | |||
label: "民族", name: "Nationals", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'National', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "身份证号", name: "IDCard", width: 100, align: "left" }, | |||
{ label: "住址", name: "HomeAddress", width: 100, align: "left" }, | |||
{ label: "手机号", name: "StuMobile", width: 100, align: "left" }, | |||
{ label: "中考总分", name: "MidTermExam", width: 100, align: "left" }, | |||
{ label: "语文", name: "chinese", width: 100, align: "left" }, | |||
{ label: "数学", name: "math", width: 100, align: "left" }, | |||
{ label: "英语", name: "english", width: 100, align: "left" }, | |||
{ label: "物理与化学", name: "physicsAndChemistry", width: 100, align: "left" }, | |||
{ label: "政治与历史", name: "politicsAndHistory", width: 100, align: "left" }, | |||
{ label: "体育", name: "physicalEducation", width: 100, align: "left" }, | |||
{ label: "毕业学校", name: "FromSchool", width: 100, align: "left" }, | |||
{ label: "特长", name: "Specialty", 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: "County", 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']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "推荐教师", name: "EmpNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
@@ -131,18 +203,91 @@ var bootstrap = function ($, learun) { | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "人数", name: "num", width: 100, align: "left" }, | |||
} | |||
], | |||
//isMultiselect: true, | |||
mainId: 'StuId', | |||
isPage: false | |||
isPage: true | |||
}); | |||
//$('#gridtable').jfGrid({ | |||
// url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetTJList', | |||
// headData: [ | |||
// { label: "教师编号", name: "empno", width: 100, align: "left" }, | |||
// { | |||
// label: "教师姓名", name: "empno", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
// key: value, | |||
// keyId: 'empno', | |||
// callback: function (_data) { | |||
// callback(_data['empname']); | |||
// } | |||
// }); | |||
// } | |||
// }, | |||
// { label: "人数", name: "num", width: 100, align: "left" }, | |||
// ], | |||
// mainId: 'StuId', | |||
// isPage: false | |||
//}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
//param.Grade = "20"; | |||
//录取=是 | |||
param.SqlParameter = " and t.IsAdmission=1"; | |||
//中考总分 | |||
if (!!$('#MidTermExam1').val()) { | |||
param.SqlParameter += " and t.MidTermExam>=" + $('#MidTermExam1').val(); | |||
} | |||
if (!!$('#MidTermExam2').val()) { | |||
param.SqlParameter += " and t.MidTermExam<=" + $('#MidTermExam2').val(); | |||
} | |||
//语文 | |||
if (!!$('#chinese1').val()) { | |||
param.SqlParameter += " and s.chinese>=" + $('#chinese1').val(); | |||
} | |||
if (!!$('#chinese2').val()) { | |||
param.SqlParameter += " and s.chinese<=" + $('#chinese2').val(); | |||
} | |||
//数学 | |||
if (!!$('#math1').val()) { | |||
param.SqlParameter += " and s.math>=" + $('#math1').val(); | |||
} | |||
if (!!$('#math2').val()) { | |||
param.SqlParameter += " and s.math<=" + $('#math2').val(); | |||
} | |||
//英语 | |||
if (!!$('#english1').val()) { | |||
param.SqlParameter += " and s.english>=" + $('#english1').val(); | |||
} | |||
if (!!$('#english2').val()) { | |||
param.SqlParameter += " and s.english<=" + $('#english2').val(); | |||
} | |||
//物理与化学 | |||
if (!!$('#physicsAndChemistry1').val()) { | |||
param.SqlParameter += " and s.physicsAndChemistry>=" + $('#physicsAndChemistry1').val(); | |||
} | |||
if (!!$('#physicsAndChemistry2').val()) { | |||
param.SqlParameter += " and s.physicsAndChemistry<=" + $('#physicsAndChemistry2').val(); | |||
} | |||
//政治与历史 | |||
if (!!$('#politicsAndHistory1').val()) { | |||
param.SqlParameter += " and s.politicsAndHistory>=" + $('#politicsAndHistory1').val(); | |||
} | |||
if (!!$('#politicsAndHistory2').val()) { | |||
param.SqlParameter += " and s.politicsAndHistory<=" + $('#politicsAndHistory2').val(); | |||
} | |||
//体育 | |||
if (!!$('#physicalEducation1').val()) { | |||
param.SqlParameter += " and s.physicalEducation>=" + $('#physicalEducation1').val(); | |||
} | |||
if (!!$('#physicalEducation2').val()) { | |||
param.SqlParameter += " and s.physicalEducation<=" + $('#physicalEducation2').val(); | |||
} | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
@@ -15,20 +15,24 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetScoreListByStuId?stuid=' + keyValue, function (data) { | |||
//learun.loading(false); | |||
if (data.code == 200) { | |||
var data = data.data; | |||
var html = ''; | |||
for (var i = 0; i < data.length; i++) { | |||
html += '<div class="col-xs-6 lr-form-item" data-table="StuEnroll">'; | |||
html += '<div class="lr-form-item-title">' + data[i].SubjectName + ':</div>'; | |||
html += '<label class="lr-form-item-lable">' + data[i].Grade + '</label>'; | |||
var Grade = ''; | |||
if (!!data[i].Grade) { | |||
Grade = data[i].Grade; | |||
} | |||
html += '<label class="lr-form-item-lable">' + Grade + '</label>'; | |||
html += '</div>'; | |||
} | |||
$('#form').html(html); | |||
@@ -62,7 +66,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -42,6 +42,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 招生统计 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<StuEnrollEntity> GetPageListForTJ(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuEnrollService.GetPageListForTJ(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<StuEnrollEntity> AllStudent() | |||
{ | |||
try | |||
@@ -163,7 +163,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 中考成绩 | |||
/// </summary> | |||
[Column("MIDTERMEXAM")] | |||
public string MidTermExam { get; set; } | |||
public decimal? MidTermExam { get; set; } | |||
/// <summary> | |||
/// 语文 | |||
/// </summary> | |||
@@ -524,6 +524,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public decimal? physicsAndChemistry { get; set; } | |||
[NotMapped] | |||
public decimal? english { get; set; } | |||
[NotMapped] | |||
public decimal? chinese { get; set; } | |||
[NotMapped] | |||
public decimal? politicsAndHistory { get; set; } | |||
[NotMapped] | |||
public decimal? physicalEducation { get; set; } | |||
[NotMapped] | |||
public decimal? math { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<StuEnrollEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<StuEnrollEntity> GetPageListForTJ(Pagination pagination, string queryJson); | |||
DataTable GetTJList(string queryJson); | |||
IEnumerable<StuEnrollEntity> GetList(string queryJson); | |||
IEnumerable<StuEnrollEntity> AllStudent(); | |||
@@ -342,7 +342,145 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<StuEnrollEntity> GetPageListForTJ(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" s.physicsAndChemistry,s.english,s.chinese, s.politicsAndHistory,s.physicalEducation,s.math, | |||
t.StuName,t.Gender,t.Nationals,t.IDCard,t.HomeAddress,t.StuMobile, | |||
t.MidTermExam,t.FromSchool,t.Specialty,t.City,t.County,t.MajorNo,t.EmpNo "); | |||
strSql.Append(" FROM StuEnroll t "); | |||
strSql.Append(@" left join ( | |||
select a.StuEnrollId, max( case when a.subjectname = '物理与化学' then a.score else 0 end) as physicsAndChemistry, | |||
max(case when a.subjectname = '英语' then a.score else 0 end) as english, | |||
max( case when a.subjectname = '语文' then a.score else 0 end) as chinese, | |||
max(case when a.subjectname = '政治与历史' then a.score else 0 end) as politicsAndHistory, | |||
max(case when a.subjectname = '体育' then a.score else 0 end) as physicalEducation, | |||
max(case when a.subjectname = '数学' then a.score else 0 end) as math | |||
from StuEnrollMidExamScore a | |||
group by a.StuEnrollId | |||
) s | |||
on t.stuid = s.StuEnrollId "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
#region SqlWhere | |||
if (!queryParam["City"].IsEmpty()) | |||
{ | |||
dp.Add("City", queryParam["City"].ToString(), DbType.String); | |||
strSql.Append(" AND t.City = @City "); | |||
} | |||
if (!queryParam["County"].IsEmpty()) | |||
{ | |||
dp.Add("County", queryParam["County"].ToString(), DbType.String); | |||
strSql.Append(" AND t.County = @County "); | |||
} | |||
if (!queryParam["IDCard"].IsEmpty()) | |||
{ | |||
dp.Add("IDCard", "%" + queryParam["IDCard"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.IDCard Like @IDCard "); | |||
} | |||
if (!queryParam["Year"].IsEmpty()) | |||
{ | |||
dp.Add("Year", queryParam["Year"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Year = @Year "); | |||
} | |||
//sql条件 | |||
if (!queryParam["SqlParameter"].IsEmpty()) | |||
{ | |||
strSql.Append(queryParam["SqlParameter"].ToString()); | |||
} | |||
if (!queryParam["Admissions"].IsEmpty()) | |||
{ | |||
dp.Add("Admissions", queryParam["Admissions"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Admissions = @Admissions "); | |||
} | |||
if (!queryParam["DeptNo"].IsEmpty()) | |||
{ | |||
dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DeptNo = @DeptNo "); | |||
} | |||
if (!queryParam["MajorNo"].IsEmpty()) | |||
{ | |||
dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.MajorNo = @MajorNo "); | |||
} | |||
if (!queryParam["EmpNo"].IsEmpty()) | |||
{ | |||
dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.EmpNo = @EmpNo "); | |||
} | |||
if (!queryParam["Grade"].IsEmpty()) | |||
{ | |||
dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Grade = @Grade "); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ClassNo = @ClassNo "); | |||
} | |||
if (!queryParam["StuName"].IsEmpty()) | |||
{ | |||
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuName Like @StuName "); | |||
} | |||
if (!queryParam["StuMobile"].IsEmpty()) | |||
{ | |||
dp.Add("StuMobile", "%" + queryParam["StuMobile"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuMobile Like @StuMobile "); | |||
} | |||
if (!queryParam["Gender"].IsEmpty()) | |||
{ | |||
dp.Add("Gender", Convert.ToBoolean(queryParam["Gender"].ToString()), DbType.Boolean); | |||
strSql.Append(" AND t.Gender = @Gender "); | |||
} | |||
//获取班主任所带的班级 | |||
var roleid = this.BaseRepository().FindEntity<RoleEntity>(a => a.F_FullName == "班主任")?.F_RoleId; | |||
var userInfo = LoginUserInfo.Get(); | |||
var sqlClasses = ""; | |||
if (!string.IsNullOrEmpty(roleid)) | |||
{ | |||
if (userInfo.roleIds.Contains(roleid)) | |||
{ | |||
var classes = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(a => a.ClassDiredctorNo == userInfo.account).Select(a => a.ClassNo).ToList(); | |||
if (classes != null) | |||
{ | |||
foreach (var item in classes) | |||
{ | |||
sqlClasses += $"'{item}',"; | |||
} | |||
sqlClasses = sqlClasses.TrimEnd(','); | |||
} | |||
} | |||
if (!string.IsNullOrEmpty(sqlClasses)) | |||
{ | |||
strSql.Append($" AND t.ClassNo IN({sqlClasses})"); | |||
} | |||
} | |||
#endregion | |||
return this.BaseRepository("CollegeMIS").FindList<StuEnrollEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<StuEnrollEntity> AllStudent() | |||
{ | |||
@@ -2205,7 +2343,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
entity.Create(); | |||
entity.EnrollStatus = 0; | |||
db.Insert(entity); | |||
} | |||