@@ -81,6 +81,27 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
return Success(jsonData); | return Success(jsonData); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageListForTeacher(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = vaccinationInfoIBLL.GetPageListForTeacher(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | /// 获取表单数据 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -18,7 +18,7 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="VaccinationInfo"> | <div class="col-xs-6 lr-form-item" data-table="VaccinationInfo"> | ||||
<div class="lr-form-item-title">疫苗类型</div> | <div class="lr-form-item-title">疫苗类型</div> | ||||
<div id="VaccineType"></div> | |||||
<input id="VaccineType" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="VaccinationInfo"> | <div class="col-xs-6 lr-form-item" data-table="VaccinationInfo"> | ||||
<div class="lr-form-item-title">第一针时间</div> | <div class="lr-form-item-title">第一针时间</div> | ||||
@@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { | |||||
page.initData(); | page.initData(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
$('#VaccineType').lrDataItemSelect({ code: 'VaccineType' }); | |||||
//$('#VaccineType').lrDataItemSelect({ code: 'VaccineType' }); | |||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!keyValue) { | if (!!keyValue) { | ||||
@@ -25,7 +25,7 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">接种类型</div> | <div class="lr-form-item-title">接种类型</div> | ||||
<div id="VaccineType"></div> | |||||
<input id="VaccineType" type="text" class="form-control" /> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">身份证号</div> | <div class="lr-form-item-title">身份证号</div> | ||||
@@ -16,7 +16,7 @@ var bootstrap = function ($, learun) { | |||||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | ||||
page.search(queryJson); | page.search(queryJson); | ||||
}, 220, 400); | }, 220, 400); | ||||
$('#VaccineType').lrDataItemSelect({ code: 'VaccineType' }); | |||||
//$('#VaccineType').lrDataItemSelect({ code: 'VaccineType' }); | |||||
$('#DepartmentId').lrselect({ | $('#DepartmentId').lrselect({ | ||||
type: 'tree', | type: 'tree', | ||||
allowSearch: true, | allowSearch: true, | ||||
@@ -139,10 +139,23 @@ var bootstrap = function ($, learun) { | |||||
// 初始化列表 | // 初始化列表 | ||||
initGird: function () { | initGird: function () { | ||||
$('#gridtable').jfGrid({ | $('#gridtable').jfGrid({ | ||||
url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/GetPageList', | |||||
url: top.$.rootUrl + '/EducationalAdministration/VaccinationInfo/GetPageListForTeacher', | |||||
headData: [ | headData: [ | ||||
{ label: "职工编号", name: "EmpNo", width: 100, align: "left" }, | { label: "职工编号", name: "EmpNo", width: 100, align: "left" }, | ||||
{ label: "姓名", name: "EmpName", width: 150, align: "left" }, | { label: "姓名", name: "EmpName", width: 150, align: "left" }, | ||||
{ | |||||
label: "员工状态", name: "IsInActiveStatus", width: 100, align: "left", | |||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: 'JobStatus', | |||||
callback: function (_data) { | |||||
callback(_data.text); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ label: "身份证", name: "CardId", width: 160, align: "left" }, | { label: "身份证", name: "CardId", width: 160, align: "left" }, | ||||
{ | { | ||||
label: "部门", name: "DepartmentId", width: 200, align: "left", | label: "部门", name: "DepartmentId", width: 200, align: "left", | ||||
@@ -160,15 +173,15 @@ var bootstrap = function ($, learun) { | |||||
{ label: "电话号码", name: "Mobile", width: 120, align: "left" }, | { label: "电话号码", name: "Mobile", width: 120, align: "left" }, | ||||
{ | { | ||||
label: "疫苗类型", name: "VaccineType", width: 100, align: "left", | label: "疫苗类型", name: "VaccineType", width: 100, align: "left", | ||||
formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: 'VaccineType', | |||||
callback: function (_data) { | |||||
callback(_data.text); | |||||
} | |||||
}); | |||||
} | |||||
//formatterAsync: function (callback, value, row, op, $cell) { | |||||
// learun.clientdata.getAsync('dataItem', { | |||||
// key: value, | |||||
// code: 'VaccineType', | |||||
// callback: function (_data) { | |||||
// callback(_data.text); | |||||
// } | |||||
// }); | |||||
//} | |||||
}, | }, | ||||
{ label: "接种地", name: "VaccineAddress", width: 100, align: "left" }, | { label: "接种地", name: "VaccineAddress", width: 100, align: "left" }, | ||||
{ | { | ||||
@@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<VaccinationInfoEntity> GetPageListForTeacher(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return vaccinationInfoService.GetPageListForTeacher(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取VaccinationInfo表实体数据 | /// 获取VaccinationInfo表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -164,6 +164,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | #region 扩展字段 | ||||
[NotMapped] | |||||
public string IsInActiveStatus { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } | ||||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="queryJson">查询参数</param> | /// <param name="queryJson">查询参数</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<VaccinationInfoEntity> GetPageList(Pagination pagination, string queryJson); | IEnumerable<VaccinationInfoEntity> GetPageList(Pagination pagination, string queryJson); | ||||
IEnumerable<VaccinationInfoEntity> GetPageListForTeacher(Pagination pagination, string queryJson); | |||||
/// <summary> | /// <summary> | ||||
/// 获取VaccinationInfo表实体数据 | /// 获取VaccinationInfo表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -33,7 +33,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(@" t.StuNo,t.StuName,s.IdentityCardNo as CardId,s.DeptNo,s.MajorNo,s.ClassNo,s.Mobile,t.VaccineType, | |||||
strSql.Append(@" t.Id,t.StuNo,t.StuName,s.IdentityCardNo as CardId,s.DeptNo,s.MajorNo,s.ClassNo,s.Mobile,t.VaccineType, | |||||
t.VaccineAddress,t.FirstNeedle,t.SecondNeedle,t.ThirdNeedle,t.NotReason,t.Remark,t.CreateTime,t.CreateUser,t.LastTime,t.LastUser "); | t.VaccineAddress,t.FirstNeedle,t.SecondNeedle,t.ThirdNeedle,t.NotReason,t.Remark,t.CreateTime,t.CreateUser,t.LastTime,t.LastUser "); | ||||
strSql.Append(" FROM VaccinationInfo t "); | strSql.Append(" FROM VaccinationInfo t "); | ||||
strSql.Append(" left join StuInfoBasic s on s.stuno=t.stuno "); | strSql.Append(" left join StuInfoBasic s on s.stuno=t.stuno "); | ||||
@@ -105,8 +105,56 @@ t.VaccineAddress,t.FirstNeedle,t.SecondNeedle,t.ThirdNeedle,t.NotReason,t.Remark | |||||
} | } | ||||
} | } | ||||
} | } | ||||
else if (StuOrTeach == "1") | |||||
var data = this.BaseRepository("CollegeMIS").FindList<VaccinationInfoEntity>(strSql.ToString(), dp, pagination); | |||||
if (data.Count() > 0 && StuOrTeach == "0") | |||||
{ | |||||
foreach (var item in data) | |||||
{ | |||||
if (!string.IsNullOrEmpty(item.CardId)) | |||||
{ | |||||
item.Age = DateTime.Now.Year - Convert.ToInt32(item.CardId.ToString().Substring(6, 4)); | |||||
} | |||||
} | |||||
} | |||||
return data; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | { | ||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取页面显示列表数据(老师) | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<VaccinationInfoEntity> GetPageListForTeacher(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" t.Id,t.EmpNo,s.EmpName,s.IdentityCardNo as CardId,s.F_DepartmentId,s.Mobile,s.IsInActiveStatus,t.VaccineType, | |||||
t.VaccineAddress,t.FirstNeedle,t.SecondNeedle,t.ThirdNeedle,t.NotReason,t.Remark,t.CreateTime,t.CreateUser,t.LastTime,t.LastUser "); | |||||
strSql.Append(" FROM VaccinationInfo t "); | |||||
strSql.Append(" left join empinfo s on s.empno=t.empno "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var login = LoginUserInfo.Get(); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
var StuOrTeach = queryParam["StuOrTeach"].ToString(); | |||||
if (!queryParam["StuOrTeach"].IsEmpty()) | if (!queryParam["StuOrTeach"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("StuOrTeach", queryParam["StuOrTeach"].ToString(), DbType.Int32); | dp.Add("StuOrTeach", queryParam["StuOrTeach"].ToString(), DbType.Int32); | ||||
@@ -142,7 +190,7 @@ t.VaccineAddress,t.FirstNeedle,t.SecondNeedle,t.ThirdNeedle,t.NotReason,t.Remark | |||||
dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); | dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); | ||||
strSql.Append(" AND t.EmpName Like @EmpName "); | strSql.Append(" AND t.EmpName Like @EmpName "); | ||||
} | } | ||||
} | |||||
var data = this.BaseRepository("CollegeMIS").FindList<VaccinationInfoEntity>(strSql.ToString(), dp, pagination); | var data = this.BaseRepository("CollegeMIS").FindList<VaccinationInfoEntity>(strSql.ToString(), dp, pagination); | ||||
if (data.Count() > 0 && StuOrTeach == "0") | if (data.Count() > 0 && StuOrTeach == "0") | ||||