@@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
#endregion | |||
@@ -71,8 +71,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var StuArriveSchoolData = stuArriveSchoolIBLL.GetStuArriveSchoolEntity( keyValue ); | |||
var jsonData = new { | |||
var StuArriveSchoolData = stuArriveSchoolIBLL.GetStuArriveSchoolEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
StuArriveSchool = StuArriveSchoolData, | |||
}; | |||
return Success(jsonData); | |||
@@ -112,7 +113,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return Fail("该班级当天的班级人数日报表已存在!"); | |||
} | |||
stuArriveSchoolIBLL.SaveEntity(keyValue,entity); | |||
stuArriveSchoolIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
@@ -123,9 +124,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DoSubmit(string keyValue) | |||
public ActionResult DoSubmit(string keyValue, string status) | |||
{ | |||
stuArriveSchoolIBLL.DoSubmit(keyValue); | |||
stuArriveSchoolIBLL.DoSubmit(keyValue, status); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
@@ -17,6 +17,10 @@ | |||
<div class="lr-form-item-title">专业部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">年级</div> | |||
<input id="Grade" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<input id="Class" type="text" class="form-control" /> | |||
@@ -34,7 +38,10 @@ | |||
<a id="lr_copy" class="btn btn-default"><i class="fa fa-plus"></i> 复制</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-lock"></i> 提交</a> | |||
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock"></i> 审核</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -126,10 +126,35 @@ var bootstrap = function ($, learun) { | |||
if (Status == "1") { | |||
learun.alert.warning("该项已提交!"); | |||
return false; | |||
}else if (Status == "2") { | |||
learun.alert.warning("该项已审核!"); | |||
return false; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/DoSubmit', { keyValue: keyValue }, function () { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/DoSubmit', { keyValue: keyValue, status: "1" }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//审核 | |||
$('#lr_check').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
var Status = $('#gridtable').jfGridValue('Status'); | |||
if (learun.checkrow(keyValue)) { | |||
if (Status == "2") { | |||
learun.alert.warning("该项已审核!"); | |||
return false; | |||
} | |||
if (Status != "1") { | |||
learun.alert.warning("该项未提交,无法审核!"); | |||
return false; | |||
} | |||
learun.layerConfirm('是否确认审核该项!', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuArriveSchool/DoSubmit', { keyValue: keyValue, status: "2" }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
@@ -177,14 +202,14 @@ var bootstrap = function ($, learun) { | |||
{ label: "拟转出人员", name: "NiZhuanChuPeople", width: 100, align: "left" }, | |||
{ | |||
label: "状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue) { | |||
return cellvalue == "1" ? "已提交" : "草稿"; | |||
return cellvalue == "1" ? "已提交" : (cellvalue == "2" ? "已审核" : "草稿"); | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sidx: 'Date desc,DeptNo', | |||
sord:'asc' | |||
sord: 'asc' | |||
}); | |||
}, | |||
search: function (param) { | |||
@@ -146,11 +146,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 提交实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DoSubmit(string keyValue) | |||
public void DoSubmit(string keyValue, string status) | |||
{ | |||
try | |||
{ | |||
stuArriveSchoolService.DoSubmit(keyValue); | |||
stuArriveSchoolService.DoSubmit(keyValue, status); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -105,7 +105,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[Column("NIZHUANCHUPEOPLE")] | |||
public string NiZhuanChuPeople { get; set; } | |||
/// <summary> | |||
/// 状态(0草稿,1已提交) | |||
/// 状态(0草稿,1已提交,2已审核) | |||
/// </summary> | |||
[Column("STATUS")] | |||
public string Status { get; set; } | |||
@@ -130,15 +130,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[Column("MODIFYTIME")] | |||
public DateTime? ModifyTime { get; set; } | |||
/// <summary> | |||
/// SubmitUserId | |||
/// 提交用户 | |||
/// </summary> | |||
[Column("SUBMITUSERID")] | |||
public string SubmitUserId { get; set; } | |||
/// <summary> | |||
/// SubmitTime | |||
/// 提交时间 | |||
/// </summary> | |||
[Column("SUBMITTIME")] | |||
public DateTime? SubmitTime { get; set; } | |||
/// <summary> | |||
/// 审核用户 | |||
/// </summary> | |||
[Column("CHECKUSERID")] | |||
public string CheckUserId { get; set; } | |||
/// <summary> | |||
/// 审核时间 | |||
/// </summary> | |||
[Column("CHECKTIME")] | |||
public DateTime? CheckTime { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -53,7 +53,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 提交实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DoSubmit(string keyValue); | |||
void DoSubmit(string keyValue, string status); | |||
#endregion | |||
} | |||
@@ -49,6 +49,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DeptNo = @DeptNo "); | |||
} | |||
if (!queryParam["Grade"].IsEmpty()) | |||
{ | |||
dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Grade Like @Grade "); | |||
} | |||
if (!queryParam["Class"].IsEmpty()) | |||
{ | |||
dp.Add("Class", "%" + queryParam["Class"].ToString() + "%", DbType.String); | |||
@@ -62,7 +67,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
else if (loginUserInfo.roleIds.Split(',').Contains(Config.GetValue("StuArriveSchoolRoleId"))) | |||
{ | |||
strSql.Append($" and (t.Status='1' or t.CreateUserId='{loginUserInfo.userId}') "); | |||
strSql.Append($" and (t.Status='2' or t.CreateUserId='{loginUserInfo.userId}') "); | |||
} | |||
else | |||
{ | |||
@@ -71,7 +76,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
if (cddeptList.Any()) | |||
{ | |||
var deptnos = string.Join(",", cddeptList.Select(x => "'" + x.DeptNo + "'").ToArray()); | |||
strSql.Append($" and ((t.DeptNo in ({deptnos}) and t.Status='1') or t.CreateUserId='{loginUserInfo.userId}') "); | |||
strSql.Append($" and ((t.DeptNo in ({deptnos}) and t.Status >= 1) or t.CreateUserId='{loginUserInfo.userId}') "); | |||
} | |||
else | |||
{ | |||
@@ -205,11 +210,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 提交实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DoSubmit(string keyValue) | |||
public void DoSubmit(string keyValue, string status) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuArriveSchool set Status='1',SubmitUserId='{LoginUserInfo.Get().userId}',SubmitTime='{DateTime.Now}' where Id='{keyValue}' "); | |||
if (status == "1")//提交 | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuArriveSchool set Status='{status}',SubmitUserId='{LoginUserInfo.Get().userId}',SubmitTime='{DateTime.Now}' where Id='{keyValue}' "); | |||
} | |||
else//审核 | |||
{ | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuArriveSchool set Status='{status}',CheckUserId='{LoginUserInfo.Get().userId}',CheckTime='{DateTime.Now}' where Id='{keyValue}' "); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||