From 375eba9aaad2e575878b520d89644d2e557a72ee Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 16 Oct 2024 09:40:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E5=BE=80=E5=B9=B4=E6=88=90=E7=BB=A9=E5=AF=BC=E5=85=A5excel?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/excel/StuScoreOfPreviousImport.xls | Bin 0 -> 22016 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuScoreOfPreviousImport.xls diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuScoreOfPreviousImport.xls b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuScoreOfPreviousImport.xls new file mode 100644 index 0000000000000000000000000000000000000000..b0ad9e3dac1ecc34cd12234418d3b19002f3a8cd GIT binary patch literal 22016 zcmeHP2UrwG`=33Ie@;%?&GrK$Qyz`rPep7aKX7|qhU|zLq zyF)cma&3qXsh8>#5l_y*HG0;W5#kOP7_OH}rBp}=T>j7fix_wVwt7P4>3|o4*9DJt zt_NNWULU*xcth|;;ElnXfHwsXO@Nq#w*YSm-U_@mcpLDx;O)TMgLeS$2)+^c#^9a6 zHvumJ?+o4ryeoJ&@Yt5nd%$%wUie=`>A%Xee zAelsrM?wy>N7A02=kYY&B16ak){Y@m_zp)4B4D`u@%%PP z(Zb;|R5OMoLdo->x`7;p4{`0o^WAYCvO~76cGKLI=UpmWu9Mr-f zmJ^iZlEH923=?Q@p0e^|-+kNsu|J=a;pvN^7mIYse&e%xM+zAtg3ez}1Z11=2pkEy z1->5{0p()`Lem&eB>x%LmbD?BK^qPO!L8wnfzbrRQ0H*8WRF`}jRWklH9Hc)xG}VM zKy%Q*yHg)QB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g~6XjMpXY;4wObT}7r3((m?vWX%DU zKgt2*pE_I~F+yYhBKNNO|3%r#VgBv;V>>`s2n~q63BYwEcx+GQ;K3DMgacODHSjoB zr~{8}4*%r~`$8g|F^oF6Y!=Hd%VffTsNuiZ;eY(mbl4wN<0P=VfV!jQ|98h?gKiuw z^Ynr<=7D{+6YOtvg?={*Fb6`b%>eYaa2^c3exM8m)L1)|`?qqR<@$UO@gu?DvCp8) z4SX~#mc@`Lc%Tf0KGY5t%bG(z?O^dJ27C~N0wEj#$1uH1~K{7ln bGrngY3P)d7?gvNA56{g(8V)G`Kkokki(%RM literal 0 HcmV?d00001 From 2a65ced6531f34b81ca0e6f314e9fb9a97173210 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Thu, 17 Oct 2024 10:18:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E5=BE=80=E5=B9=B4=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuScoreOfPreviousController.cs | 100 +++++ .../StuScoreOfPrevious/ImportForm.cshtml | 24 ++ .../Views/StuScoreOfPrevious/ImportForm.css | 136 +++++++ .../Views/StuScoreOfPrevious/ImportForm.js | 158 ++++++++ .../Views/StuScoreOfPrevious/Index.cshtml | 34 ++ .../Views/StuScoreOfPrevious/Index.js | 103 ++++++ .../Controllers/ExcelImportController.cs | 33 +- .../excel/StuScoreOfPreviousImport.xls | Bin 22016 -> 22016 bytes .../Learun.Application.Web.csproj | 9 +- .../StuScoreOfPreviousMap.cs | 29 ++ .../Learun.Application.Mapping.csproj | 1 + .../StuScoreOfPreviousBLL.cs | 74 ++++ .../StuScoreOfPreviousEntity.cs | 344 ++++++++++++++++++ .../StuScoreOfPreviousIBLL.cs | 38 ++ .../StuScoreOfPreviousService.cs | 316 ++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 16 files changed, 1401 insertions(+), 2 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOfPreviousController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOfPreviousMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOfPreviousController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOfPreviousController.cs new file mode 100644 index 000000000..9b56d8bf3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOfPreviousController.cs @@ -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 +{ + ///

+ /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-10-16 11:02 + /// 描 述:往年成绩管理 + /// + public class StuScoreOfPreviousController : MvcControllerBase + { + private StuScoreOfPreviousIBLL stuScoreOfPreviousIBLL = new StuScoreOfPreviousBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 导入 + /// + /// + [HttpGet] + public ActionResult ImportForm() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + 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 拓展数据 + + /// + /// 导入下载模板 + /// + /// + 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 + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.cshtml new file mode 100644 index 000000000..dc5ec1eff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.cshtml @@ -0,0 +1,24 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +@Html.AppendCssFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css") +
+
+
上传文件
+
下载模板
+
+
+
+
+ +
+
+

试试将电脑里的文件拖拽到此上传

+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css new file mode 100644 index 000000000..04b556b7a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css @@ -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; +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js new file mode 100644 index 000000000..907b10e4c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js @@ -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('
' + res.data.Success + '/' + res.data.Fail + '
'); + // 如果有失败 + 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('
'); + } + }); + } + // 触发清楚文件碎片 + 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('
'); + } + + 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 = $('
'); + $item.append('
'); + $item.append('' + file.name + '(' + learun.countFileSize(file.size) + ')'); + + $('#lr_form_file_queue_list').append($item); + }, + uploadStart: function (file) { + var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); + $fileItem.append('
'); + }, + 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(); + +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.cshtml new file mode 100644 index 000000000..925f5020d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.cshtml @@ -0,0 +1,34 @@ +@{ + ViewBag.Title = "往年成绩管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学号/姓名
+ +
+
+
+
+
+
+
+ +
+
+  导入 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.js new file mode 100644 index 000000000..cfa1f208d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/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" ? "已审核" : "未审核"; + } + }, + ], + mainId: 'ScoreId', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs index be98a21af..249e30646 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs @@ -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 视图功能 /// /// 导入模板管理页面 @@ -289,7 +290,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers } } /// - /// + /// 课表导入 /// /// /// @@ -317,6 +318,36 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return Fail("导入数据失败!"); } } + /// + /// 往年成绩管理导入 + /// + /// + /// + /// + /// + [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("导入数据失败!"); + } + } + /// /// 下载文件(导入文件未被导入的数据) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuScoreOfPreviousImport.xls b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuScoreOfPreviousImport.xls index b0ad9e3dac1ecc34cd12234418d3b19002f3a8cd..d545f4542e4c549083d08996a008a0246e5a002a 100644 GIT binary patch delta 2006 zcmbtVO-NKx6#nj;H$OU~&5!ddF$0xSYHHy`=-5lMW-2Ca(LzX)z+BX#cKyJcO!}cH z=n6u#s33^2-)Wsv?TTC^xoDAK%b=-rkz{u6eaODsfr?%q}>A89<9@5pH)yc)Kg$ zDakXCNNbGmbG7Od=p?z4)W{SnP)3T}Z{WTxUj7S@kmy)~Q$AxEaaNEb;|#f6!}ei2 z)Os18D$C)c;nA=TwL}_Rc?M&HfxB~fU!T|jb(8e>Wbp|cATg9JsNxsi3q*4V^JeiU zB#5Q16LI)ewUkS zyhdMw`~!LVr02%}#C+jijG1UC;8|G!FLcIQnRj!6U9z)~6>_ilMBtRI0;g=E>DkqR z=hdGdr6;{gS=zknQ-CG-Y;%Xd6U3WLTzXkD5%DCZnRr)=r$&NwYll4(pyz3}6|jvm zC!82#8p#XH1{=PklAmmuv8rID$sZT_u~;=*&9B8aDz}@{Y z@8(fTcQ>}tmDN0?362@I3bfI1WHm3@1fL9>k8Ct2i<+Nof=PxgK$$Rx_2rndBx zsMD3gX-o_O187+zh#t>-$<;g%2TFd-76pU_fbTk)FR(K~Pz&zm-lS zRxI_P^Mi4J9{H}v%N+rX6Bk1?8jnQDKK?3x^p6hyi;=eC%lK^q8XZB*$pR{&F#Bj>x4(wMveVWArZTJwI@wLl` zdp-V4OtBy`_3$N&h6-^%eslR+kLh>?b#S#pK|JMdYE`q`eiF4>+i|bTi3{Z0qQkEj z_dwB?;${x%_=a?Fy~-R^D$u6mrQU>o7OS4yY2K!0x(Nnh01IuDp|)uWPZwd6Ej()R zz-Y;i<0-h*HQprMtrM#8e8k0)*dGZ<_afi@>=BL~PsH1S`dU7!aF}F2tu`VMXyrVt zIBm4<2D?m64`VD&%0<>q-(TRvQ2Uxe0EXUDx0DfNX3u;kjlV+ zFLE^VFhO5{0y$eSn+jkg8NrF3**yY;q|!K?Y1$I{f8{rq z8ydf+YwQ7dq67@WFtW^K1#v88$7$@Xu?Im`;?#o!yL%_CrFO!l-p35^M&G^~>RYm5 z)W5W|;C$Z@t_+=f(eD+^okG+Qzm}4A47dgB3|TF%1I*yA0Uw*ecs7dp?3^k8@)`Yq KN=F9Yi+=!cxK_*n diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 8cf6c1fa9..663faaa5a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -23,7 +23,8 @@ ..\..\..\ true - false + + @@ -375,6 +376,7 @@ + @@ -1012,6 +1014,9 @@ + + + @@ -8003,6 +8008,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOfPreviousMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOfPreviousMap.cs new file mode 100644 index 000000000..059a405f7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOfPreviousMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-10-16 11:02 + /// 描 述:往年成绩管理 + /// + public class StuScoreOfPreviousMap : EntityTypeConfiguration + { + public StuScoreOfPreviousMap() + { + #region 表、主键 + //表 + this.ToTable("STUSCOREOFPREVIOUS"); + //主键 + this.HasKey(t => t.ScoreId); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index 87f819316..49a85cbda 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -110,6 +110,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousBLL.cs new file mode 100644 index 000000000..1400bca57 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousBLL.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 +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-10-16 11:02 + /// 描 述:往年成绩管理 + /// + public class StuScoreOfPreviousBLL : StuScoreOfPreviousIBLL + { + private StuScoreOfPreviousService stuScoreOfPreviousService = new StuScoreOfPreviousService(); + + #region 获取数据 + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable 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 拓展数据 + + /// + /// 导入 + /// + /// + /// + /// + 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 + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousEntity.cs new file mode 100644 index 000000000..5e5f54f37 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousEntity.cs @@ -0,0 +1,344 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-10-16 11:02 + /// 描 述:往年成绩管理 + /// + public class StuScoreOfPreviousEntity + { + #region 实体成员 + /// + /// ScoreId + /// + /// + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("SCOREID")] + public int? ScoreId { get; set; } + /// + /// 通知书号 + /// + /// + [Column("NOTICEBOOKNO")] + public string NoticeBookNo { get; set; } + /// + /// 学号 + /// + /// + [Column("STUNO")] + public string StuNo { get; set; } + /// + /// 学生所在系部 + /// + /// + [Column("DEPTNO")] + public string DeptNo { get; set; } + /// + /// 学生所在专业号 + /// + /// + [Column("MAJORNO")] + public string MajorNo { get; set; } + /// + /// 行政班号 + /// + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// 姓名 + /// + /// + [Column("STUNAME")] + public string StuName { get; set; } + /// + /// GenderNo + /// + /// + [Column("GENDERNO")] + public string GenderNo { get; set; } + /// + /// 学年度 + /// + /// + [Column("ACADEMICYEARNO")] + public string AcademicYearNo { get; set; } + /// + /// 学期 + /// + /// + [Column("SEMESTER")] + public string Semester { get; set; } + /// + /// 开课系部码 + /// + /// + [Column("OPENLESSONDEPTNO")] + public string OpenLessonDeptNo { get; set; } + /// + /// 开课专业码 + /// + /// + [Column("OPENLESSONMAJORNO")] + public string OpenLessonMajorNo { get; set; } + /// + /// 课程号 + /// + /// + [Column("LESSONNO")] + public string LessonNo { get; set; } + /// + /// 课程名称 + /// + /// + [Column("LESSONNAME")] + public string LessonName { get; set; } + /// + /// LessonNameEn + /// + /// + [Column("LESSONNAMEEN")] + public string LessonNameEn { get; set; } + /// + /// 教学班号 + /// + /// + [Column("TEACHCLASSNO")] + public string TeachClassNo { get; set; } + /// + /// 课程类别码 + /// + /// + [Column("LESSONSORTNO")] + public string LessonSortNo { get; set; } + /// + /// 学生类别 + /// + /// + [Column("STUSORTNO")] + public string StuSortNo { get; set; } + /// + /// 年级 + /// + /// + [Column("GRADE")] + public string Grade { get; set; } + /// + /// 学分 + /// + /// + [Column("STUDYSCORE")] + public decimal? StudyScore { get; set; } + /// + /// 总学时 + /// + /// + [Column("TOTALSTUDYHOUR")] + public decimal? TotalStudyHour { get; set; } + /// + /// 专业属性 + /// + /// + [Column("ZYSX")] + public string zysx { get; set; } + /// + /// 考核(试)方式码(关联表BCdTestMode) + /// + /// + [Column("TESTMODENO")] + public string TestModeNo { get; set; } + /// + /// ScoreRecordStyleNo + /// + /// + [Column("SCORERECORDSTYLENO")] + public string ScoreRecordStyleNo { get; set; } + /// + /// 平时成绩 + /// + /// + [Column("ORDINARYSCORE")] + public decimal? OrdinaryScore { get; set; } + /// + /// 期中成绩 + /// + /// + [Column("TERMINSCORE")] + public decimal? TermInScore { get; set; } + /// + /// 期末成绩 学期 + /// + /// + [Column("TERMENDSCORE")] + public decimal? TermEndScore { get; set; } + /// + /// OtherScore + /// + /// + [Column("OTHERSCORE")] + public decimal? OtherScore { get; set; } + /// + /// 总评成绩 + /// + /// + [Column("SCORE")] + public decimal? Score { get; set; } + /// + /// 绩点 + /// + /// + [Column("SCOREPOINT")] + public decimal? ScorePoint { get; set; } + /// + /// 考试日期 + /// + /// + [Column("TESTDATE")] + public DateTime? TestDate { get; set; } + /// + /// 是否有效 + /// + /// + [Column("ISINEFFECT")] + public string IsInEffect { get; set; } + /// + /// 备注 + /// + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 冲突课程代码 + /// + /// + [Column("CONFLICTLESSONNO")] + public string ConflictLessonNo { get; set; } + /// + /// 是否重修成绩 + /// + /// + [Column("ISRESTUDY")] + public string IsReStudy { get; set; } + /// + /// 审查标志 + /// + /// + [Column("CHECKMARK")] + public string CheckMark { get; set; } + /// + /// 是否选中 + /// + /// + [Column("ISPITCHON")] + public string IsPitchOn { get; set; } + /// + /// 教师号 + /// + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// 专业教学计划编码 + /// + /// + [Column("TECHPLANNO")] + public string TechPlanNo { get; set; } + /// + /// 考试性质码(关联表CdTestKind) + /// + /// + [Column("TESTKINDNO")] + public string TestKindNo { get; set; } + /// + /// 课程区别码(此编码针对同一课程编号,同一门课程、不同课时、学分的情况而加,由系统自动产生以区分此类课程) + /// + /// + [Column("PARTCODE")] + public string PartCode { get; set; } + /// + /// LessonSection + /// + /// + [Column("LESSONSECTION")] + public string LessonSection { get; set; } + /// + /// ClassRoomNo + /// + /// + [Column("CLASSROOMNO")] + public string ClassRoomNo { get; set; } + /// + /// ClassRoomName + /// + /// + [Column("CLASSROOMNAME")] + public string ClassRoomName { get; set; } + /// + /// IsEditable + /// + /// + [Column("ISEDITABLE")] + public string IsEditable { get; set; } + /// + /// EditUserId + /// + /// + [Column("EDITUSERID")] + public string EditUserId { get; set; } + /// + /// ModifyDate + /// + /// + [Column("MODIFYDATE")] + public DateTime? ModifyDate { get; set; } + + [Column("BEGINMODIFYDATE")] + public DateTime? BeginModifyDate { get; set; } + /// + /// ModifyUserId + /// + /// + [Column("MODIFYUSERID")] + public string ModifyUserId { get; set; } + /// + /// ModifyUserName + /// + /// + [Column("MODIFYUSERNAME")] + public string ModifyUserName { get; set; } + /// + /// 学校主键 + /// + /// + [Column("F_SCHOOLID")] + public string F_SchoolId { get; set; } + + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + } + /// + /// 编辑调用 + /// + /// + public void Modify(int? keyValue) + { + this.ScoreId = keyValue; + } + #endregion + + + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousIBLL.cs new file mode 100644 index 000000000..14f6d1754 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousIBLL.cs @@ -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 +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-10-16 11:02 + /// 描 述:往年成绩管理 + /// + public interface StuScoreOfPreviousIBLL + { + #region 获取数据 + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + #endregion + + #region 拓展数据 + + /// + /// 导入 + /// + /// + /// + /// + string StuScoreOfPreviousImport(DataTable dt, string fileId); + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousService.cs new file mode 100644 index 000000000..6fed1afd0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOfPrevious/StuScoreOfPreviousService.cs @@ -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 +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2024-10-16 11:02 + /// 描 述:往年成绩管理 + /// + 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 获取数据 + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable 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(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + #region 拓展数据 + + /// + /// 导入 + /// + /// + /// + /// + 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 StuScoreOfPreviousHistory = db.FindList("select * from StuScoreOfPrevious"); + var StuScoreOfPreviousinsert = new List(); + + // 循环遍历导入 + 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($"select * from EmpInfo where EmpNo='" + dr["教师编号"].ToString().Trim() + "' and CheckMark=1 "); + var CompanyEntity = BaseRepository().FindList(x => x.F_EnabledMark == 1).ToList().FirstOrDefault(); + if (empinfoEntity.Count() <= 0) + throw (new Exception("查无此教师")); + var dataItemDetailEntity = BaseRepository().FindEntity($@"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(cacheKey + fileId, errordt, CacheId.excel); + } + } + return snum + "|" + fnum; + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 8ed737ba9..757dc7938 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -289,6 +289,10 @@ + + + +