@@ -1,7 +1,11 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Application.Base.SystemModule; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Web.Mvc; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.StuInfoGraduateEntity; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
@@ -15,6 +19,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class StuInfoGraduateController : MvcControllerBase | |||
{ | |||
private StuInfoGraduateIBLL stuInfoGraduateIBLL = new StuInfoGraduateBLL(); | |||
private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL(); | |||
private StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); | |||
#region 视图功能 | |||
@@ -25,7 +31,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -34,7 +40,45 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 打印 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Printxjk(string keyValue) | |||
{ | |||
var stuInfoGraduateEntity = stuInfoGraduateIBLL.GetEntity(keyValue); | |||
ViewBag.PrintDate = DateTime.Now.ToDate(); | |||
if (stuInfoGraduateEntity == null) | |||
{ | |||
return View(new StuInfoGraduateEntity()); | |||
} | |||
//头像 | |||
stuInfoGraduateEntity.Photo = annexesFileIbll.GetEntityByFolderId(stuInfoGraduateEntity.Photo)?.F_FilePath; | |||
if (!string.IsNullOrEmpty(stuInfoGraduateEntity.Photo)) | |||
{ | |||
stuInfoGraduateEntity.Photo = stuInfoGraduateEntity.Photo.Substring(stuInfoGraduateEntity.Photo.IndexOf("Resource") - 1); | |||
} | |||
//学习成绩 | |||
stuInfoGraduateEntity.StuScoreClassOneList = stuScoreIBLL.GetAllScoreListByStuNo(stuInfoGraduateEntity.StuNo) | |||
.Where(x => x.AcademicYearNo != null && x.Semester != null && x.Score != null) | |||
.GroupBy(x => new { x.AcademicYearNo, x.Semester }) | |||
.Select(x => new StuScoreClassOne() | |||
{ | |||
AcademicYearNo = x.Key.AcademicYearNo, | |||
Semester = x.Key.Semester, | |||
StuScoreList = x.Select(y => new StuScoreEntity() | |||
{ | |||
LessonNo = y.LessonNo, | |||
LessonName = y.LessonName, | |||
Score = y.Score | |||
}).OrderBy(xx => xx.LessonNo).ToList() | |||
}).OrderBy(xx => xx.AcademicYearNo).ThenBy(xx => xx.Semester).ToList(); | |||
return View(stuInfoGraduateEntity); | |||
} | |||
#endregion | |||
@@ -46,7 +90,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetList( string queryJson ) | |||
public ActionResult GetList(string queryJson) | |||
{ | |||
var data = stuInfoGraduateIBLL.GetList(queryJson); | |||
return Success(data); | |||
@@ -107,7 +151,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue,StuInfoGraduateEntity entity) | |||
public ActionResult SaveForm(string keyValue, StuInfoGraduateEntity entity) | |||
{ | |||
stuInfoGraduateIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
@@ -52,6 +52,7 @@ | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | |||
<a id="lr_printxjk" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -51,7 +51,7 @@ var bootstrap = function ($, learun) { | |||
$('#ClassNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj', | |||
param: { strWhere: "1=1 AND order by classno desc" } | |||
param: { strWhere: "1=1 order by classno desc" } | |||
}); | |||
} | |||
} else { | |||
@@ -65,7 +65,7 @@ var bootstrap = function ($, learun) { | |||
$('#ClassNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj', | |||
param: { strWhere: "1=1 AND order by classno desc" } | |||
param: { strWhere: "1=1 order by classno desc" } | |||
}); | |||
} | |||
} | |||
@@ -90,7 +90,7 @@ var bootstrap = function ($, learun) { | |||
$('#ClassNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj', | |||
param: { strWhere: "1=1 AND order by classno desc" } | |||
param: { strWhere: "1=1 order by classno desc" } | |||
}); | |||
} | |||
} else { | |||
@@ -106,7 +106,7 @@ var bootstrap = function ($, learun) { | |||
$('#ClassNo').lrselectRefresh({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj', | |||
param: { strWhere: "1=1 AND order by classno desc" } | |||
param: { strWhere: "1=1 order by classno desc" } | |||
}); | |||
} | |||
} | |||
@@ -116,7 +116,7 @@ var bootstrap = function ($, learun) { | |||
$('#ClassNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=allbjqj', | |||
param: { strWhere: "1=1 AND order by classno desc" }, | |||
param: { strWhere: "1=1 order by classno desc" }, | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
@@ -129,6 +129,24 @@ var bootstrap = function ($, learun) { | |||
}); | |||
//打印学籍卡 | |||
$('#lr_printxjk').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('StuId'); | |||
if (learun.checkrow(keyValue)) { | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行查看!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'print', | |||
title: '学籍卡打印', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuInfoGraduate/Printxjk?keyValue=' + keyValue, | |||
width: 1100, | |||
height: 800, | |||
btn: null | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -577,7 +595,7 @@ var bootstrap = function ($, learun) { | |||
mainId: 'StuId', | |||
isPage: true, | |||
isMultiselect: false, | |||
sidx: "ClassNo desc,MajorNo desc,MajorNo desc,Grade desc,StuNo desc" | |||
}); | |||
page.search(); | |||
}, | |||
@@ -0,0 +1,337 @@ | |||
@using Learun.Util | |||
@using Microsoft.Practices.ObjectBuilder2 | |||
@model Learun.Application.TwoDevelopment.EducationalAdministration.StuInfoGraduateEntity | |||
<!DOCTYPE html | |||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||
<!-- saved from url=(0051)http://localhost:8080/MDITIP/printOutContent.action --> | |||
<html xmlns="http://www.w3.org/1999/xhtml"> | |||
<head> | |||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |||
<title>打印</title> | |||
<meta http-equiv="pragma" content="no-cache" /> | |||
<meta http-equiv="cache-control" content="no-cache" /> | |||
<meta http-equiv="expires" content="0" /> | |||
<style> | |||
h4 { | |||
font-size: 23px; | |||
font-weight: 400; | |||
width: 50%; | |||
text-align: center; | |||
margin: 0 auto; | |||
} | |||
em { | |||
font-style: normal | |||
} | |||
b { | |||
margin-left: 20px; | |||
} | |||
input { | |||
border: 0; | |||
outline: none; | |||
cursor: pointer; | |||
} | |||
span { | |||
width: 30%; | |||
float: right; | |||
} | |||
table { | |||
width: 100%; | |||
border: 1px solid #222; | |||
border-top: none; | |||
border-bottom: none; | |||
border-collapse: collapse; | |||
border-spacing: 0px; | |||
} | |||
td { | |||
width: 14%; | |||
height: 44px; | |||
border: 1px solid #222; | |||
text-align: center; | |||
} | |||
.pageBreak { | |||
page-break-after: always; | |||
} | |||
.btn { | |||
width: 100px; | |||
height: 34px; | |||
line-height: 34px; | |||
text-align: center; | |||
margin: 30px auto; | |||
border: 1px solid #ccc; | |||
cursor: pointer; | |||
border-radius: 4px; | |||
} | |||
</style> | |||
</head> | |||
<body> | |||
<div id="print-content"> | |||
<div class="header"> | |||
<h4>长阳土家族自治县职业教育中心学生学籍卡</h4> | |||
</div> | |||
<p> | |||
<b><em>经办人:</em><input type="text" /></b> | |||
<span>打印日期:@ViewBag.PrintDate.ToShortDateString().Replace("/", "-")</span> | |||
</p> | |||
<!-- 页面记录信息 --> | |||
<table cellpadding="0" cellspacing="0"> | |||
<tr> | |||
<td>姓名</td> | |||
<td>@Model.StuName</td> | |||
<td>性别</td> | |||
<td id="GenderNo">@Model.GenderNo</td> | |||
<td>出生日期</td> | |||
<td>@(Model.Birthday.HasValue ? Model.Birthday.Value.ToShortDateString().Replace("/", "-") : "")</td> | |||
<td rowspan="3"><img src="@Model.Photo" style="width: 80%;" alt="" /></td> | |||
</tr> | |||
<tr> | |||
<td>民族</td> | |||
<td id="NationalityNo">@Model.NationalityNo</td> | |||
<td>政治面貌</td> | |||
<td id="PartyFaceNo">@Model.PartyFaceNo</td> | |||
<td>班级</td> | |||
<td id="ClassNo">@Model.ClassNo</td> | |||
</tr> | |||
<tr> | |||
<td>学号</td> | |||
<td>@Model.StuNo</td> | |||
<td>学制</td> | |||
<td>@Model.EduSystem</td> | |||
<td>年级</td> | |||
<td>@Model.Grade</td> | |||
</tr> | |||
<tr> | |||
<td>学籍号</td> | |||
<td>@Model.StuCode</td> | |||
<td>专业</td> | |||
<td id="MajorNo">@Model.MajorNo</td> | |||
<td>身份证号</td> | |||
<td colspan="2">@Model.IdentityCardNo</td> | |||
</tr> | |||
<tr> | |||
<td>入学年月</td> | |||
<td>@(Model.EntranceDate.HasValue ? Model.EntranceDate.Value.ToShortDateString().Replace("/", "-") : "")</td> | |||
<td>入学方式</td> | |||
<td id="EntranceWay">@Model.EntranceWay</td> | |||
<td>学习形式</td> | |||
<td colspan="2" id="StudyModality">@Model.StudyModality</td> | |||
</tr> | |||
<tr> | |||
<td>家庭住址</td> | |||
<td colspan="3">@Model.MailAddress</td> | |||
<td>毕业时间</td> | |||
<td colspan="2">@(Model.FinishSchoolDate.HasValue ? Model.EntranceDate.Value.ToShortDateString().Replace("/", "-") : "")</td> | |||
</tr> | |||
<tr> | |||
<td>异动情况</td> | |||
<td colspan="7"><input type="text" style="width: 90% ;" /></td> | |||
</tr> | |||
<tr> | |||
<td colspan="8">学业成绩</td> | |||
</tr> | |||
<tr> | |||
<td>学期</td> | |||
<td>课程名称</td> | |||
<td>成绩</td> | |||
<td>课程名称</td> | |||
<td>成绩</td> | |||
<td>课程名称</td> | |||
<td>成绩</td> | |||
</tr> | |||
</table> | |||
<div class="tablehtml"> | |||
</div> | |||
<div class="btn">打印</div> | |||
</div> | |||
<script src="~/Content/jquery/plugin/fullcalendar/js/jquery-1.7.2.min.js"></script> | |||
<script src="~/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script> | |||
<script> | |||
$('.btn').click(function () { | |||
window.print(); | |||
}); | |||
//绑定字典或源的值 | |||
function GetDataSourceStr(code, value, text, valueStr, box) { | |||
$(box).html(""); | |||
$.ajax({ | |||
url: "/OnlineRegistrate/GetDataSourceMap?code=" + code, | |||
async: false, | |||
success: function (msg) { | |||
var msgObject = $.parseJSON(msg); | |||
if (msgObject.code == 200) { | |||
$.each(msgObject.data, function (i, item) { | |||
if (item[value] == valueStr) { | |||
$(box).html(item[text]); | |||
return; | |||
} | |||
}); | |||
} else { | |||
layer.msg(msgObject.info); | |||
} | |||
}, | |||
}); | |||
return; | |||
}; | |||
function GetDataItemStr(code, valueStr, box) { | |||
$(box).html(""); | |||
$.ajax({ | |||
url: "/OnlineRegistrate/GetDataItemMap?code=" + code, | |||
async: false, | |||
success: function (msg) { | |||
var msgObject = $.parseJSON(msg); | |||
if (msgObject.code == 200) { | |||
$.each(msgObject.data, function (i, item) { | |||
if (item["F_ItemValue"] == valueStr) { | |||
$(box).html(item["F_ItemName"]); | |||
return; | |||
} | |||
}); | |||
} else { | |||
layer.msg(msgObject.info); | |||
} | |||
}, | |||
}); | |||
return; | |||
}; | |||
GetDataItemStr("usersexbit", "@Model.GenderNo.ToString().ToLower()", "#GenderNo"); | |||
GetDataItemStr("National", "@Model.NationalityNo", "#NationalityNo"); | |||
GetDataItemStr("PolityStatus", "@Model.PartyFaceNo", "#PartyFaceNo"); | |||
GetDataItemStr("StudyModality", "@Model.StudyModality", "#StudyModality"); | |||
GetDataSourceStr("CdMajorInfo", "majorno", "majorname", "@Model.MajorNo", "#MajorNo"); | |||
GetDataSourceStr("allbjqj", "classno", "classname", "@Model.ClassNo", "#ClassNo"); | |||
$(window).load(function () { | |||
var listData1 = "@Model.StuScoreClassOneList.ToJson()"; | |||
var listData = JSON.parse(listData1.replace(/"/g, "\"")); | |||
// 有六个学期 | |||
var tableHtml = "" | |||
for (var j = 0; j < listData.length; j++) { | |||
tableHtml += "<table cellpadding='0' cellspacing='0' id='table" + j + "'>" | |||
var trNum = Math.ceil(listData[j].StuScoreList.length / 3) | |||
// 代表当前有几行 不确定是否每行都是满的 | |||
var str = "" | |||
// 循环其行tr | |||
for (var i = 0; i < trNum; i++) { | |||
var std = "" | |||
str += "<tr>" | |||
// 开始循环6列 三门成绩 | |||
// 循环3次td每次两个 | |||
for (var k = 0; k < 2; k++) { | |||
if(k==0){ | |||
// 如果是第一列 | |||
if(i==0){ | |||
// 如果是第一行的第一列 | |||
std += `<td rowspan='5'>第${j + 1}学期</td>` | |||
}else{ | |||
// 如果是不是第一行的第一列 则什么都不加 | |||
} | |||
}else{ | |||
// 如果不是第一列 | |||
// i是第几行 i*3-1 (i-1)*3 | |||
var startNum = (i)*3 | |||
var endNum = (i+1)*3-1 | |||
// 控制单元格从第几个开始,到底几个结束 | |||
for(var tdsNum = startNum;tdsNum<=endNum;tdsNum++){ | |||
// console.log(tdsNum,'222',listData[j].StuScoreList[3]['text']) | |||
// 有取到数据 | |||
if(listData[j].StuScoreList[tdsNum]){ | |||
std += `<td>${listData[j].StuScoreList[tdsNum]['LessonName']}</td><td>${listData[j].StuScoreList[tdsNum]['Score']}</td>` | |||
}else{ | |||
// 无数据 | |||
std +=`<td></td><td></td>` | |||
} | |||
} | |||
} | |||
} | |||
str += std + "</tr>" | |||
} | |||
tableHtml += str + "</table>" | |||
} | |||
setTimeout(() => { | |||
$(".tablehtml").html(tableHtml) | |||
},100) | |||
var yiH = $("#table0").height() | |||
var erH = $("#table1").height() | |||
var sanH = $("#table2").height() | |||
var siH = $("#table3").height() | |||
var wuH = $("#table4").height() | |||
var liuH = $("#table5").height() | |||
var siNumH = erH + sanH + siH | |||
// erDom.classList.add("pageBreak") | |||
$("#table1").addClass("pageBreak") | |||
// removeClass() | |||
if (yiH > 300) { | |||
$("#table0").addClass("pageBreak") | |||
$("#table5").addClass("pageBreak") | |||
} | |||
if (erH > 300) { | |||
$("#table0").addClass("pageBreak") | |||
$("#table1").removeClass("pageBreak") | |||
} | |||
if (sanH > 300) { | |||
$("#table1").removeClass("pageBreak") | |||
$("#table2").addClass("pageBreak") | |||
$("#table3").removeClass("pageBreak") | |||
$("#table4").removeClass("pageBreak") | |||
} | |||
if (siH > 400) { | |||
$("#table3").addClass("pageBreak") | |||
$("#table5").removeClass("pageBreak") | |||
$("#table4").removeClass("pageBreak") | |||
} | |||
if (wuH > 400) { | |||
$("#table4").addClass("pageBreak") | |||
liuDom.removeClass("pageBreak") | |||
} | |||
if (liuH > 400) { | |||
$("#table4").addClass("pageBreak") | |||
} | |||
if ((yiH + erH) > 200) { | |||
$("#table1").addClass("pageBreak") | |||
$("#table2").removeClass("pageBreak") | |||
$("#table3").removeClass("pageBreak") | |||
$("#table4").removeClass("pageBreak") | |||
$("#table5").removeClass("pageBreak") | |||
} | |||
if ((erH + sanH) > 600) { | |||
$("#table2").addClass("pageBreak") | |||
$("#table3").removeClass("pageBreak") | |||
$("#table4").removeClass("pageBreak") | |||
$("#table5").removeClass("pageBreak") | |||
} | |||
if ((sanH + siH) > 700) { | |||
// siDom.classList.add("pageBreak") | |||
$("#table4").removeClass("pageBreak") | |||
$("#table5").removeClass("pageBreak") | |||
} | |||
if ((siH + wuH) > 700) { | |||
$("#table4").addClass("pageBreak") | |||
$("#table5").removeClass("pageBreak") | |||
} | |||
if ((erH + sanH + siH) > 700) { | |||
$("#table2").addClass("pageBreak") | |||
$("#table3").removeClass("pageBreak") | |||
$("#table4").classList.add("pageBreak") | |||
} | |||
}) | |||
</script> | |||
</body> | |||
</html> |
@@ -8104,6 +8104,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuTransferInfo\QueryAPStuHealthIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuTransferInfo\QueryStuEncourgementIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuTransferInfo\QueryScoreIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoGraduate\printxjk.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -1,5 +1,6 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
@@ -11,7 +12,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2020-05-21 16:16 | |||
/// 描 述:毕业学生信息 | |||
/// </summary> | |||
public class StuInfoGraduateEntity | |||
public class StuInfoGraduateEntity | |||
{ | |||
#region 实体成员 | |||
@@ -933,6 +934,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
this.StuId = keyValue; | |||
} | |||
#endregion | |||
[NotMapped] | |||
public List<StuScoreClassOne> StuScoreClassOneList { get; set; } | |||
public class StuScoreClassOne | |||
{ | |||
public string AcademicYearNo { get; set; } | |||
public string Semester { get; set; } | |||
public List<StuScoreEntity> StuScoreList { get; set; } | |||
} | |||
} | |||
} | |||