@@ -0,0 +1,100 @@ | |||
using DocumentFormat.OpenXml.Math; | |||
using Hangfire; | |||
using Learun.Application.Base.SystemModule; | |||
using Learun.Application.Organization; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Util; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Configuration; | |||
using System.Data; | |||
using System.IO; | |||
using System.Linq; | |||
using System.Web.Mvc; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousController : MvcControllerBase | |||
{ | |||
private StuScoreOfPreviousIBLL stuScoreOfPreviousIBLL = new StuScoreOfPreviousBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 导入 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult ImportForm() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = stuScoreOfPreviousIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入下载模板 | |||
/// </summary> | |||
/// <returns></returns> | |||
public ActionResult DownTemplate() | |||
{ | |||
FileStreamResult result = null; | |||
try | |||
{ | |||
var path = Server.MapPath("~/Content/excel/"); | |||
var pathoffull = path + "StuScoreOfPreviousImport.xls"; | |||
FileStream fsread = fsread = new FileStream(pathoffull, FileMode.OpenOrCreate, FileAccess.ReadWrite); | |||
result = File(fsread, "application/ms-excel", "往年成绩导入模版.xls"); | |||
return result; | |||
} | |||
catch (Exception ex) | |||
{ | |||
return null; | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
@{ | |||
ViewBag.Title = "Form"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<link href="~/Content/webuploader/webuploader.css" rel="stylesheet" /> | |||
<script src="~/Content/webuploader/webuploader.nolog.min.js"></script> | |||
@Html.AppendCssFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css") | |||
<div class="lr-form-layout lr-form-layout-top-bottom"> | |||
<div class="lr-form-layout-header"> | |||
<div id="lr_add_file_btn"><i class="fa fa-cloud-upload"></i><span class="lrlt">上传文件</span></div> | |||
<div class="webuploader-pick" id="lr_down_file_btn"><i class="fa fa-download"></i><span class="lrlt">下载模板</span></div> | |||
</div> | |||
<div class="lr-form-layout-body"> | |||
<div class="lr-form-file-queue-wrap" id="lr_form_file_queue"> | |||
<div class="lr-form-file-queue" id="lr_form_file_queue_list"> | |||
</div> | |||
<div class="lr-form-file-queue-bg"> | |||
<h1><span class="lrlt">试试将电脑里的文件拖拽到此上传</span></h1> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js") |
@@ -0,0 +1,136 @@ | |||
.lr-form-layout-body { | |||
padding:0 5px 5px 5px; | |||
} | |||
.lr-form-file-queue-wrap { | |||
position:relative; | |||
width:100%; | |||
height:100%; | |||
border:1px solid #ddd; | |||
border-radius:4px; | |||
} | |||
.lr-form-file-queue { | |||
position:relative; | |||
} | |||
.lr-form-file-queue { | |||
position:relative; | |||
} | |||
.lr-form-file-queue-item { | |||
position:relative; | |||
width:100%; | |||
height:50px; | |||
border-bottom:1px solid #ddd; | |||
padding-left:60px; | |||
} | |||
.lr-file-image { | |||
position:absolute; | |||
top:5px; | |||
left:5px; | |||
} | |||
.lr-file-image img { | |||
width:40px; | |||
height:40px; | |||
} | |||
.lr-file-name{ | |||
line-height:50px; | |||
} | |||
.lr-msg { | |||
position:absolute; | |||
top:0; | |||
right:5px; | |||
font-size: 25px; | |||
line-height:50px; | |||
} | |||
.lr-msg .fa-check-circle{ | |||
color: #5cb85c; | |||
} | |||
.lr-msg .fa-exclamation-circle { | |||
color: #b94a48; | |||
} | |||
.lr-msg2 { | |||
position:absolute; | |||
top:0; | |||
right:5px; | |||
line-height:50px; | |||
} | |||
.lr-msg2 span { | |||
color:#333; | |||
font-size:14px; | |||
margin-right:5px; | |||
} | |||
.lr-tool-bar { | |||
position:absolute; | |||
top:0; | |||
right:35px; | |||
font-size: 25px; | |||
line-height:50px; | |||
color:#666; | |||
cursor:pointer; | |||
} | |||
.lr-tool-bar > i { | |||
margin-left:8px; | |||
} | |||
.lr-tool-bar .fa-minus-circle { | |||
color: #b94a48; | |||
} | |||
.lr-tool-bar .fa-cloud-download { | |||
color: #3498db; | |||
} | |||
.lr-uploader-progress { | |||
position:absolute; | |||
bottom:2px; | |||
left:60px; | |||
height:4px; | |||
width:500px; | |||
width:calc(100% - 90px); | |||
} | |||
.lr-uploader-progress-bar { | |||
position:relative; | |||
height:100%; | |||
background-color:#039cfd; | |||
border-radius:4px; | |||
} | |||
.lr-form-file-queue-bg { | |||
position:absolute; | |||
top:50%; | |||
left:50%; | |||
width:300px; | |||
height:30px; | |||
line-height:30px; | |||
margin:-15px 0 0 -150px; | |||
} | |||
.lr-form-file-queue-bg h1 { | |||
color: #666; | |||
font-size: 20px; | |||
font-family: Microsoft Yahei; | |||
padding-bottom: 2px; | |||
margin: 0; | |||
} | |||
#lr_down_file_btn { | |||
position:absolute; | |||
right:5px; | |||
background:#fff; | |||
border:1px solid #ddd; | |||
color:#333; | |||
} | |||
#lr_down_file_btn:hover { | |||
color:#337ab7; | |||
} | |||
/*对百度插件的样式重写*/ | |||
.webuploader-container { | |||
position:absolute; | |||
} | |||
.webuploader-pick { | |||
padding:8px 15px; | |||
background-color:#039cfd; | |||
} | |||
.webuploader-pick-hover { | |||
background-color:#027dcb; | |||
} |
@@ -0,0 +1,158 @@ | |||
/* | |||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:陈彬彬 | |||
* 日 期:2024-10-16 11:02 | |||
* 描 述:导入往年成绩管理 | |||
*/ | |||
var id = request('id'); | |||
var keyVaule = ''; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var fileInfo = {}; | |||
// 触发合并文件碎片 | |||
var mergeFileChunks = function (file) { | |||
var param = {}; | |||
param['__RequestVerificationToken'] = $.lrToken; | |||
param['fileId'] = fileInfo[file.id].fileGuid; | |||
param['chunks'] = fileInfo[file.id].chunks; | |||
param['ext'] = file.ext; | |||
param['templateId'] = id; | |||
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/ExcelImport/StuScoreOfPreviousImport", param, function (res) { | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.find('.lr-uploader-progress').remove(); | |||
if (res.code == learun.httpCode.success) { | |||
if (res.data.Success != '0') { | |||
learun.alert.success('导入成功' + res.data.Success + '条'); | |||
} | |||
// 文件保存成功后 | |||
$fileItem.append('<div class="lr-msg2"><span>' + res.data.Success + '</span><span>/</span><span style="color:#b94a48;" >' + res.data.Fail + '</span></div>'); | |||
// 如果有失败 | |||
if (res.data.Fail != '0') | |||
{ | |||
learun.download({ url: top.$.rootUrl + '/LR_SystemModule/ExcelImport/DownImportErrorFile', param: { fileId: fileInfo[file.id].fileGuid, fileName: fileInfo[file.id].name, __RequestVerificationToken: $.lrToken }, method: 'POST' }); | |||
} | |||
} | |||
else { | |||
$fileItem.append('<div class="lr-msg"><i class="fa fa-exclamation-circle"></i></div>'); | |||
} | |||
}); | |||
} | |||
// 触发清楚文件碎片 | |||
var reomveFileChunks = function (file) { | |||
var param = {}; | |||
param['__RequestVerificationToken'] = $.lrToken; | |||
param['fileGuid'] = fileInfo[file.id].fileGuid; | |||
param['chunks'] = fileInfo[file.id].chunks; | |||
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/Annexes/MergeAnnexesFile", param, function (res) { }); | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.find('.lr-uploader-progress').remove(); | |||
$fileItem.append('<div class="lr-msg"><i class="fa fa-exclamation-circle"></i></div>'); | |||
} | |||
var page = { | |||
uploader: null, | |||
init: function () { | |||
/*模板下载*/ | |||
$('#lr_down_file_btn').on('click', function () { | |||
learun.download({ url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/DownTemplate', param: { keyValue: id, __RequestVerificationToken: $.lrToken }, method: 'POST' }); | |||
}); | |||
if (!WebUploader.Uploader.support()) { | |||
alert('Web Uploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器'); | |||
throw new Error('WebUploader does not support the browser you are using.'); | |||
} | |||
page.uploader = WebUploader.create({ | |||
auto: true, | |||
swf: top.$.rootUrl + '/Content/webuploader/Uploader.swf', | |||
// 文件接收服务端。 | |||
server: top.$.rootUrl + "/LR_SystemModule/Annexes/UploadAnnexesFileChunk", | |||
// 选择文件的按钮。可选。 | |||
// 内部根据当前运行是创建,可能是input元素,也可能是flash. | |||
pick: '#lr_add_file_btn', | |||
dnd: '#lr_form_file_queue', | |||
paste: 'document.body', | |||
disableGlobalDnd: true, | |||
accept: { | |||
extensions: "xls,xlsx" | |||
}, | |||
multiple: true, | |||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传! | |||
resize: false, | |||
// 文件分片上传 | |||
chunked: true, | |||
chunkRetry: 3, | |||
prepareNextFile: true, | |||
chunkSize: '1048576', | |||
// 上传参数 | |||
formData: { | |||
__RequestVerificationToken: $.lrToken | |||
} | |||
}); | |||
page.uploader.on('fileQueued', page.fileQueued); | |||
page.uploader.on('uploadStart', page.uploadStart); | |||
page.uploader.on('uploadBeforeSend', page.uploadBeforeSend); | |||
page.uploader.on('uploadProgress', page.uploadProgress); | |||
page.uploader.on('uploadSuccess', page.uploadSuccess); | |||
page.uploader.on('uploadError', page.uploadError); | |||
page.uploader.on('uploadComplete', page.uploadComplete); | |||
page.uploader.on('error', page.error); | |||
$('#lr_form_file_queue').lrscroll(); | |||
}, | |||
fileQueued: function (file) {// 文件加载到队列 | |||
fileInfo[file.id] = { name: file.name }; | |||
$('#lr_form_file_queue .lr-form-file-queue-bg').hide(); | |||
// 添加一条文件记录 | |||
var $item = $('<div class="lr-form-file-queue-item" id="lr_filequeue_' + file.id + '" ></div>'); | |||
$item.append('<div class="lr-file-image"><img src="' + top.$.rootUrl + '/Content/images/filetype/' + file.ext + '.png"></div>'); | |||
$item.append('<span class="lr-file-name">' + file.name + '(' + learun.countFileSize(file.size) + ')</span>'); | |||
$('#lr_form_file_queue_list').append($item); | |||
}, | |||
uploadStart: function (file) { | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.append('<div class="lr-uploader-progress"><div class="lr-uploader-progress-bar" style="width:0%;"></div></div>'); | |||
}, | |||
uploadBeforeSend: function (object, data, headers) { | |||
data.chunk = data.chunk || 0; | |||
data.chunks = data.chunks || 1; | |||
fileInfo[data.id].fileGuid = fileInfo[data.id].fileGuid || WebUploader.Base.guid(); | |||
data.fileGuid = fileInfo[data.id].fileGuid; | |||
fileInfo[data.id].chunks = data.chunks; | |||
}, | |||
uploadProgress: function (file, percentage) { | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.find('.lr-uploader-progress-bar').css('width', (percentage * 100 + '%')); | |||
}, | |||
uploadSuccess: function (file, res) { | |||
if (res.code == 200) {// 上传成功 | |||
mergeFileChunks(file); | |||
} | |||
else {// 上传失败 | |||
reomveFileChunks(file); | |||
} | |||
}, | |||
uploadError: function (file, code) { | |||
reomveFileChunks(file); | |||
}, | |||
uploadComplete: function (file) { | |||
}, | |||
error: function (type) { | |||
switch (type) { | |||
case 'Q_TYPE_DENIED': | |||
learun.alert.error('当前文件类型不允许上传'); | |||
break; | |||
}; | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,34 @@ | |||
@{ | |||
ViewBag.Title = "往年成绩管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<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="lr-form-item-title">学号/姓名</div> | |||
<input id="keyword" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="importBtn" class="btn btn-default"><i class="fa fa-plus"></i> 导入</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.js") |
@@ -0,0 +1,103 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2024-10-16 11:02 | |||
* 描 述:往年成绩管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
//导入弹窗 | |||
$('#importBtn').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form_import', | |||
title: '导入数据', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/ImportForm', | |||
width: 600, | |||
height: 400, | |||
btn: null | |||
}); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/GetPageList', | |||
headData: [ | |||
{ label: '学号', name: 'StuNo', width: 100, align: "left" }, | |||
{ label: '姓名', name: 'StuName', width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "GenderNo", width: 80, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "男" : "女"; | |||
} | |||
}, | |||
{ | |||
label: "系所", name: "DeptNo", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", width: 100, align: "left" | |||
}, | |||
{ label: "年级", name: "Grade", width: 100, align: "left" }, | |||
{ label: '学年', name: 'AcademicYearNo', width: 100, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 80, align: "left" }, | |||
{ | |||
label: '课程类型', name: 'LessonSortNo', width: 100, align: "left", formatter: function (cellvalue) { | |||
return cellvalue == "1" ? "必修课" : "选修课"; | |||
} | |||
}, | |||
{ label: '课程编号', name: 'LessonNo', width: 200, align: "left" }, | |||
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" }, | |||
{ label: '学分', name: 'StudyScore', width: 100, align: "left" }, | |||
{ | |||
label: '平时成绩', name: 'OrdinaryScore', width: 100, align: "left" | |||
}, | |||
{ label: '期中成绩', name: 'TermInScore', width: 100, align: "left" }, | |||
{ | |||
label: '期末成绩', name: 'TermEndScore', width: 100, align: "left" | |||
}, | |||
{ label: '总成绩', name: 'Score', width: 100, align: "left" }, | |||
{ label: '教师编号', name: 'EmpNo', width: 100, align: "left" }, | |||
{ label: '上课节次', name: 'LessonSection', width: 100, align: "left" }, | |||
{ label: '教室编号', name: 'ClassRoomNo', width: 100, align: "left" }, | |||
{ label: '教室名称', name: 'ClassRoomName', width: 100, align: "left" }, | |||
{ label: '编辑日期', name: 'ModifyDate', width: 150, align: "left" }, | |||
{ label: '编辑用户', name: 'ModifyUserName', width: 100, align: "left" }, | |||
{ | |||
label: "审核状态", name: "CheckMark", width: 80, align: "center", | |||
formatter: function (cellvalue) { | |||
return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>"; | |||
} | |||
}, | |||
], | |||
mainId: 'ScoreId', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -22,6 +22,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
private ExcelImportIBLL excelImportIBLL = new ExcelImportBLL(); | |||
private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); | |||
private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); | |||
private StuScoreOfPreviousIBLL stuScoreOfPreviousIBLL = new StuScoreOfPreviousBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 导入模板管理页面 | |||
@@ -289,7 +290,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
} | |||
} | |||
/// <summary> | |||
/// | |||
/// 课表导入 | |||
/// </summary> | |||
/// <param name="fileId"></param> | |||
/// <param name="chunks"></param> | |||
@@ -317,6 +318,36 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
return Fail("导入数据失败!"); | |||
} | |||
} | |||
/// <summary> | |||
/// 往年成绩管理导入 | |||
/// </summary> | |||
/// <param name="fileId"></param> | |||
/// <param name="chunks"></param> | |||
/// <param name="ext"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
public ActionResult StuScoreOfPreviousImport(string fileId, int chunks, string ext) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); | |||
if (!string.IsNullOrEmpty(path)) | |||
{ | |||
DataTable dt = ExcelHelper.ExcelImport(path); | |||
var res = stuScoreOfPreviousIBLL.StuScoreOfPreviousImport(dt, fileId); | |||
var data = new | |||
{ | |||
Success = res.Split('|')[0], | |||
Fail = res.Split('|')[1] | |||
}; | |||
return JsonResult(data); | |||
} | |||
else | |||
{ | |||
return Fail("导入数据失败!"); | |||
} | |||
} | |||
/// <summary> | |||
/// 下载文件(导入文件未被导入的数据) | |||
/// </summary> | |||
@@ -23,7 +23,8 @@ | |||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> | |||
<RestorePackages>true</RestorePackages> | |||
<UseGlobalApplicationHostFile /> | |||
<Use64BitIISExpress>false</Use64BitIISExpress> | |||
<Use64BitIISExpress> | |||
</Use64BitIISExpress> | |||
<SccProjectName> | |||
</SccProjectName> | |||
<SccLocalPath> | |||
@@ -375,6 +376,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuGraduateConditionController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuGrantController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuInfoBasicChangeController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreOfPreviousController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreNotPassController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_DefaultPwdConfigController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_PsychologicalCounseController.cs" /> | |||
@@ -1012,6 +1014,9 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTermAttemperChild\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTermAttemperChild\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\ImportForm.css" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\ImportForm.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\IndexClassRoom.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityPrint.js" /> | |||
@@ -8003,6 +8008,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityPrint.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\IndexClassRoom.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\ImportForm.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousMap : EntityTypeConfiguration<StuScoreOfPreviousEntity> | |||
{ | |||
public StuScoreOfPreviousMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("STUSCOREOFPREVIOUS"); | |||
//主键 | |||
this.HasKey(t => t.ScoreId); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -111,6 +111,7 @@ | |||
<Compile Include="EducationalAdministration\StuInfoBasicChangeMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoFreshMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoFreshOnlineServiceMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPreviousMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPassMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePreMap.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfigMap.cs" /> | |||
@@ -0,0 +1,74 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.StuScoreOfPreviousService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousBLL : StuScoreOfPreviousIBLL | |||
{ | |||
private StuScoreOfPreviousService stuScoreOfPreviousService = new StuScoreOfPreviousService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreOfPreviousEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuScoreOfPreviousService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="dt"></param> | |||
/// <param name="fileId"></param> | |||
/// <returns></returns> | |||
public string StuScoreOfPreviousImport(DataTable dt, string fileId) | |||
{ | |||
try | |||
{ | |||
return stuScoreOfPreviousService.StuScoreOfPreviousImport(dt, fileId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,344 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ScoreId | |||
/// </summary> | |||
/// <returns></returns> | |||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | |||
[Column("SCOREID")] | |||
public int? ScoreId { get; set; } | |||
/// <summary> | |||
/// 通知书号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("NOTICEBOOKNO")] | |||
public string NoticeBookNo { get; set; } | |||
/// <summary> | |||
/// 学号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUNO")] | |||
public string StuNo { get; set; } | |||
/// <summary> | |||
/// 学生所在系部 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("DEPTNO")] | |||
public string DeptNo { get; set; } | |||
/// <summary> | |||
/// 学生所在专业号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MAJORNO")] | |||
public string MajorNo { get; set; } | |||
/// <summary> | |||
/// 行政班号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSNO")] | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// 姓名 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUNAME")] | |||
public string StuName { get; set; } | |||
/// <summary> | |||
/// GenderNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("GENDERNO")] | |||
public string GenderNo { get; set; } | |||
/// <summary> | |||
/// 学年度 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ACADEMICYEARNO")] | |||
public string AcademicYearNo { get; set; } | |||
/// <summary> | |||
/// 学期 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SEMESTER")] | |||
public string Semester { get; set; } | |||
/// <summary> | |||
/// 开课系部码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("OPENLESSONDEPTNO")] | |||
public string OpenLessonDeptNo { get; set; } | |||
/// <summary> | |||
/// 开课专业码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("OPENLESSONMAJORNO")] | |||
public string OpenLessonMajorNo { get; set; } | |||
/// <summary> | |||
/// 课程号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNO")] | |||
public string LessonNo { get; set; } | |||
/// <summary> | |||
/// 课程名称 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNAME")] | |||
public string LessonName { get; set; } | |||
/// <summary> | |||
/// LessonNameEn | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNAMEEN")] | |||
public string LessonNameEn { get; set; } | |||
/// <summary> | |||
/// 教学班号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TEACHCLASSNO")] | |||
public string TeachClassNo { get; set; } | |||
/// <summary> | |||
/// 课程类别码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONSORTNO")] | |||
public string LessonSortNo { get; set; } | |||
/// <summary> | |||
/// 学生类别 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUSORTNO")] | |||
public string StuSortNo { get; set; } | |||
/// <summary> | |||
/// 年级 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("GRADE")] | |||
public string Grade { get; set; } | |||
/// <summary> | |||
/// 学分 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUDYSCORE")] | |||
public decimal? StudyScore { get; set; } | |||
/// <summary> | |||
/// 总学时 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TOTALSTUDYHOUR")] | |||
public decimal? TotalStudyHour { get; set; } | |||
/// <summary> | |||
/// 专业属性 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ZYSX")] | |||
public string zysx { get; set; } | |||
/// <summary> | |||
/// 考核(试)方式码(关联表BCdTestMode) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TESTMODENO")] | |||
public string TestModeNo { get; set; } | |||
/// <summary> | |||
/// ScoreRecordStyleNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SCORERECORDSTYLENO")] | |||
public string ScoreRecordStyleNo { get; set; } | |||
/// <summary> | |||
/// 平时成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ORDINARYSCORE")] | |||
public decimal? OrdinaryScore { get; set; } | |||
/// <summary> | |||
/// 期中成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TERMINSCORE")] | |||
public decimal? TermInScore { get; set; } | |||
/// <summary> | |||
/// 期末成绩 学期 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TERMENDSCORE")] | |||
public decimal? TermEndScore { get; set; } | |||
/// <summary> | |||
/// OtherScore | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("OTHERSCORE")] | |||
public decimal? OtherScore { get; set; } | |||
/// <summary> | |||
/// 总评成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SCORE")] | |||
public decimal? Score { get; set; } | |||
/// <summary> | |||
/// 绩点 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SCOREPOINT")] | |||
public decimal? ScorePoint { get; set; } | |||
/// <summary> | |||
/// 考试日期 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TESTDATE")] | |||
public DateTime? TestDate { get; set; } | |||
/// <summary> | |||
/// 是否有效 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISINEFFECT")] | |||
public string IsInEffect { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
/// <summary> | |||
/// 冲突课程代码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CONFLICTLESSONNO")] | |||
public string ConflictLessonNo { get; set; } | |||
/// <summary> | |||
/// 是否重修成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISRESTUDY")] | |||
public string IsReStudy { get; set; } | |||
/// <summary> | |||
/// 审查标志 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CHECKMARK")] | |||
public string CheckMark { get; set; } | |||
/// <summary> | |||
/// 是否选中 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISPITCHON")] | |||
public string IsPitchOn { get; set; } | |||
/// <summary> | |||
/// 教师号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("EMPNO")] | |||
public string EmpNo { get; set; } | |||
/// <summary> | |||
/// 专业教学计划编码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TECHPLANNO")] | |||
public string TechPlanNo { get; set; } | |||
/// <summary> | |||
/// 考试性质码(关联表CdTestKind) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TESTKINDNO")] | |||
public string TestKindNo { get; set; } | |||
/// <summary> | |||
/// 课程区别码(此编码针对同一课程编号,同一门课程、不同课时、学分的情况而加,由系统自动产生以区分此类课程) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("PARTCODE")] | |||
public string PartCode { get; set; } | |||
/// <summary> | |||
/// LessonSection | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONSECTION")] | |||
public string LessonSection { get; set; } | |||
/// <summary> | |||
/// ClassRoomNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNO")] | |||
public string ClassRoomNo { get; set; } | |||
/// <summary> | |||
/// ClassRoomName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNAME")] | |||
public string ClassRoomName { get; set; } | |||
/// <summary> | |||
/// IsEditable | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISEDITABLE")] | |||
public string IsEditable { get; set; } | |||
/// <summary> | |||
/// EditUserId | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("EDITUSERID")] | |||
public string EditUserId { get; set; } | |||
/// <summary> | |||
/// ModifyDate | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MODIFYDATE")] | |||
public DateTime? ModifyDate { get; set; } | |||
[Column("BEGINMODIFYDATE")] | |||
public DateTime? BeginModifyDate { get; set; } | |||
/// <summary> | |||
/// ModifyUserId | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MODIFYUSERID")] | |||
public string ModifyUserId { get; set; } | |||
/// <summary> | |||
/// ModifyUserName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MODIFYUSERNAME")] | |||
public string ModifyUserName { get; set; } | |||
/// <summary> | |||
/// 学校主键 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("F_SCHOOLID")] | |||
public string F_SchoolId { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(int? keyValue) | |||
{ | |||
this.ScoreId = keyValue; | |||
} | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,38 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.StuScoreOfPreviousService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public interface StuScoreOfPreviousIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreOfPreviousEntity> GetPageList(Pagination pagination, string queryJson); | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="dt"></param> | |||
/// <param name="fileId"></param> | |||
/// <returns></returns> | |||
string StuScoreOfPreviousImport(DataTable dt, string fileId); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,316 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Net.Http; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Newtonsoft.Json; | |||
using Learun.Cache.Base; | |||
using Learun.Cache.Factory; | |||
using Learun.Application.Organization; | |||
using Learun.Application.Base.SystemModule; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousService : RepositoryFactory | |||
{ | |||
private ICache cache = CacheFactory.CaChe(); | |||
private string cacheKey = "Learun_adms_excelError_"; | |||
#region 构造函数和属性 | |||
private string fieldSql; | |||
public StuScoreOfPreviousService() | |||
{ | |||
fieldSql = @"t.*"; | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreOfPreviousEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql); | |||
strSql.Append(" FROM StuScoreOfPrevious t where 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["keyword"].IsEmpty()) | |||
{ | |||
strSql.Append(" and (stuno like @keyword or stuname like @keyword )"); | |||
dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<StuScoreOfPreviousEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="dt"></param> | |||
/// <param name="fileId"></param> | |||
/// <returns></returns> | |||
public string StuScoreOfPreviousImport(DataTable dt, string fileId) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
int snum = 0; | |||
int fnum = 0; | |||
//插入时间 | |||
var Insertdate = DateTime.Now; | |||
if (dt.Rows.Count > 0) | |||
{ | |||
DataTable failDt = new DataTable(); | |||
dt.Columns.Add("导入错误", typeof(string)); | |||
foreach (DataColumn dc in dt.Columns) | |||
{ | |||
failDt.Columns.Add(dc.ColumnName, dc.DataType); | |||
} | |||
IEnumerable<StuScoreOfPreviousEntity> StuScoreOfPreviousHistory = db.FindList<StuScoreOfPreviousEntity>("select * from StuScoreOfPrevious"); | |||
var StuScoreOfPreviousinsert = new List<StuScoreOfPreviousEntity>(); | |||
// 循环遍历导入 | |||
foreach (DataRow dr in dt.Rows) | |||
{ | |||
try | |||
{ | |||
#region 必填项空验证 | |||
if (dr["学号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学号不能为空")); | |||
} | |||
if (dr["学生姓名"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学生姓名不能为空")); | |||
} | |||
if (dr["系部编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("系部编号不能为空")); | |||
} | |||
if (dr["专业编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("专业编号不能为空")); | |||
} | |||
if (dr["班级编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("班级编号不能为空")); | |||
} | |||
if (dr["性别"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("性别不能为空")); | |||
} | |||
if (dr["学年"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学年不能为空")); | |||
} | |||
if (dr["学期"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学期不能为空")); | |||
} | |||
if (dr["课程编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("课程编号不能为空")); | |||
} | |||
if (dr["课程名称"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("课程名称不能为空")); | |||
} | |||
if (dr["课程类型"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("课程类型不能为空")); | |||
} | |||
if (dr["年级"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("年级不能为空")); | |||
} | |||
if (dr["总成绩"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("总成绩不能为空")); | |||
} | |||
if (dr["教师编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("教师编号不能为空")); | |||
} | |||
if (dr["校区"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("校区不能为空")); | |||
} | |||
#endregion | |||
#region 选择性必填判断 | |||
if (dr["课程类型"].ToString() == "1") | |||
{ | |||
if (dr["开课系部编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("必修课的开课系部编号不能为空")); | |||
} | |||
if (dr["开课专业编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("必修课的开课专业编号不能为空")); | |||
} | |||
if (dr["教学班级编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("必修课的教学班级编号不能为空")); | |||
} | |||
} | |||
else if (dr["课程类型"].ToString() == "2") | |||
{ | |||
if (dr["上课节次"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("选修课的上课节次不能为空")); | |||
} | |||
if (dr["教室编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("选修课的教室编号不能为空")); | |||
} | |||
if (dr["教室名称"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("选修课的教室名称不能为空")); | |||
} | |||
} | |||
#endregion | |||
//基础数据 | |||
var empinfoEntity = db.FindList<EmpInfoEntity>($"select * from EmpInfo where EmpNo='" + dr["教师编号"].ToString().Trim() + "' and CheckMark=1 "); | |||
var CompanyEntity = BaseRepository().FindList<CompanyEntity>(x => x.F_EnabledMark == 1).ToList().FirstOrDefault(); | |||
if (empinfoEntity.Count() <= 0) | |||
throw (new Exception("查无此教师")); | |||
var dataItemDetailEntity = BaseRepository().FindEntity<DataItemDetailEntity>($@"select dd.F_ItemName,dd.F_ItemValue from LR_Base_DataItem d left join LR_Base_DataItemDetail dd on d.F_ItemId=dd.F_ItemId | |||
where d.F_ItemCode = 'usersex' and dd.F_EnabledMark = 1 and dd.F_DeleteMark = 0 and dd.F_ItemName = '{dr["性别"].ToString()}' ", null); | |||
if (dataItemDetailEntity == null) | |||
{ | |||
throw (new Exception("数据字典找不到对应值")); | |||
} | |||
//写入要导入替换的数据 | |||
StuScoreOfPreviousEntity stuScoreOfPreviousEntity = new StuScoreOfPreviousEntity | |||
{ | |||
StuNo = dr["学号"].ToString(), | |||
StuName = dr["学生姓名"].ToString(), | |||
DeptNo = dr["系部编号"].ToString(), | |||
MajorNo = dr["专业编号"].ToString(), | |||
ClassNo = dr["班级编号"].ToString(), | |||
GenderNo = dataItemDetailEntity.F_ItemValue, | |||
AcademicYearNo = dr["学年"].ToString(), | |||
Semester = dr["学期"].ToString(), | |||
OpenLessonDeptNo = dr["开课系部编号"].ToString(), | |||
OpenLessonMajorNo = dr["开课专业编号"].ToString(), | |||
LessonNo = dr["课程编号"].ToString(), | |||
LessonName = dr["课程名称"].ToString(), | |||
TeachClassNo = dr["教学班级编号"].ToString(), | |||
LessonSortNo = dr["课程类型"].ToString(), | |||
Grade = dr["年级"].ToString(), | |||
StudyScore = dr["学分"].ToDecimal(), | |||
zysx = "1", | |||
TestModeNo = "1", | |||
ScoreRecordStyleNo = "1", | |||
OrdinaryScore = dr["平时成绩"].ToDecimal(), | |||
TermInScore = dr["期中成绩"].ToDecimal(), | |||
TermEndScore = dr["期末成绩"].ToDecimal(), | |||
OtherScore = dr["其他成绩"].ToDecimal(), | |||
Score = dr["总成绩"].ToDecimal(), | |||
IsInEffect = "1", | |||
Remark = dr["备注"].ToString(), | |||
CheckMark = "1", | |||
IsPitchOn = "1", | |||
EmpNo = dr["教师编号"].ToString(), | |||
TestKindNo = "1", | |||
LessonSection = dr["上课节次"].ToString(), | |||
ClassRoomNo = dr["教室编号"].ToString(), | |||
ClassRoomName = dr["教室名称"].ToString(), | |||
IsEditable = "1", | |||
ModifyDate = Insertdate, | |||
ModifyUserId = LoginUserInfo.Get().userId, | |||
ModifyUserName = LoginUserInfo.Get().realName, | |||
F_SchoolId = CompanyEntity.F_CompanyId | |||
}; | |||
#region 判断是否重复 | |||
if (StuScoreOfPreviousHistory.Count(m => m.AcademicYearNo == stuScoreOfPreviousEntity.AcademicYearNo && m.Semester == stuScoreOfPreviousEntity.Semester | |||
&& m.LessonNo == stuScoreOfPreviousEntity.LessonNo && m.StuNo == stuScoreOfPreviousEntity.StuNo | |||
&& m.LessonSortNo == stuScoreOfPreviousEntity.LessonSortNo && m.EmpNo == stuScoreOfPreviousEntity.EmpNo | |||
&& m.F_SchoolId == stuScoreOfPreviousEntity.F_SchoolId) == 0 | |||
&& StuScoreOfPreviousinsert.Count(m => m.AcademicYearNo == stuScoreOfPreviousEntity.AcademicYearNo && m.Semester == stuScoreOfPreviousEntity.Semester | |||
&& m.LessonNo == stuScoreOfPreviousEntity.LessonNo && m.StuNo == stuScoreOfPreviousEntity.StuNo | |||
&& m.LessonSortNo == stuScoreOfPreviousEntity.LessonSortNo && m.EmpNo == stuScoreOfPreviousEntity.EmpNo | |||
&& m.F_SchoolId == stuScoreOfPreviousEntity.F_SchoolId) == 0) | |||
{ | |||
StuScoreOfPreviousinsert.Add(stuScoreOfPreviousEntity); | |||
snum++; | |||
} | |||
else | |||
{ | |||
throw (new Exception("当前数据重复")); | |||
} | |||
#endregion | |||
} | |||
catch (Exception ex) | |||
{ | |||
fnum++; | |||
dr["导入错误"] = ex.Message; | |||
failDt.Rows.Add(dr.ItemArray); | |||
} | |||
} | |||
//执行导入 | |||
db.Insert(StuScoreOfPreviousinsert); | |||
db.Commit(); | |||
if (failDt.Rows.Count > 0) | |||
{ | |||
string errordt = failDt.ToJson(); | |||
cache.Write<string>(cacheKey + fileId, errordt, CacheId.excel); | |||
} | |||
} | |||
return snum + "|" + fnum; | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -293,6 +293,10 @@ | |||
<Compile Include="EducationalAdministration\StuInfoGraduate\StuInfoGraduateEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoGraduate\StuInfoGraduateIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoGraduate\StuInfoGraduateService.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousService.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassIBLL.cs" /> | |||