From ce391f99f59bbb9ec089cc4b928e496d8c7c5c37 Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 19 Dec 2022 11:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=AD=A6=E7=B1=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=AF=BC=E5=85=A5=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuInfoBasicController.cs | 32 +++ .../Views/StuInfoBasic/ImportForm.cshtml | 24 ++ .../Views/StuInfoBasic/ImportForm.css | 136 ++++++++++ .../Views/StuInfoBasic/ImportForm.js | 240 ++++++++++++++++++ .../Views/StuInfoBasic/Index.cshtml | 2 +- .../Views/StuInfoBasic/Index.js | 14 +- .../Controllers/ExcelImportController.cs | 52 +++- .../Content/excel/StuInfoBasicImport.xls | Bin 0 -> 18944 bytes .../Learun.Application.Web.csproj | 5 + .../StuInfoBasic/StuInfoBasicBLL.cs | 19 +- .../StuInfoBasic/StuInfoBasicIBLL.cs | 14 +- .../StuInfoBasic/StuInfoBasicService.cs | 82 ++++++ 12 files changed, 601 insertions(+), 19 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.css create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuInfoBasicImport.xls diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs index e70b2484e..8dd58a724 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs @@ -265,6 +265,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } + /// + /// 导入页面 + /// + /// + [HttpGet] + public ActionResult ImportForm() + { + return View(); + } #endregion @@ -743,6 +752,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuInfoBasicIBLL.SynPhoto(); return Success("同步成功!"); } + + + /// + /// 宿舍信息导入模板 + /// + /// + public ActionResult DownTemplate() + { + FileStreamResult result = null; + try + { + var path = Server.MapPath("~/Content/excel/"); + var pathoffull = path + "StuInfoBasicImport.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/StuInfoBasic/ImportForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.cshtml new file mode 100644 index 000000000..e45c62394 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.cshtml @@ -0,0 +1,24 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +@Html.AppendCssFile("/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.css") +
+
+
上传文件
+
下载模板
+
+
+
+
+ +
+
+

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

+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.css new file mode 100644 index 000000000..04b556b7a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/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/StuInfoBasic/ImportForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.js new file mode 100644 index 000000000..c9af166f7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/ImportForm.js @@ -0,0 +1,240 @@ +/* + * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:陈彬彬 + * 日 期:2017.04.11 + * 描 述:导入Excel + */ +var id = request('id'); + +var keyVaule = ''; + +var bootstrap = function ($, learun) { + "use strict"; + + var page1 = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + $('#lr_add_format').on('click', function () { + currentColRow = null; + learun.layerForm({ + id: 'FormatForm', + title: '添加', + url: top.$.rootUrl + '/LR_SystemModule/CodeRule/FormatForm', + width: 450, + height: 310, + callBack: function (id) { + return top[id].acceptClick(function (data) { + $('#gridtable').jfGridSet('addRow', { row: data }); + }); + } + }); + }); + $('#lr_edit_format').on('click', function () { + currentColRow = $('#gridtable').jfGridGet('rowdata'); + var _id = currentColRow ? currentColRow.itemTypeName : ''; + if (learun.checkrow(_id)) { + learun.layerForm({ + id: 'FormatForm', + title: '修改', + url: top.$.rootUrl + '/LR_SystemModule/CodeRule/FormatForm', + width: 450, + height: 310, + callBack: function (id) { + return top[id].acceptClick(function (data) { + $('#gridtable').jfGridSet('updateRow', { row: data }); + }); + } + }); + } + + }); + $('#lr_delete_format').on('click', function () { + currentColRow = null; + var row = $('#gridtable').jfGridGet('rowdata'); + var _id = row ? row.itemTypeName : ''; + if (learun.checkrow(_id)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $('#gridtable').jfGridSet('removeRow'); + top.layer.close(index); //再执行关闭 + } + }); + } + }); + + $('#gridtable').jfGrid({ + headData: [ + { label: "前缀", name: "itemTypeName", width: 120, align: "left" }, + { label: "格式", name: "formatStr", width: 120, align: "left" }, + { label: "步长", name: "stepValue", width: 100, align: "left" }, + { label: "初始值", name: "initValue", width: 120, align: "left" }, + { label: "说明", name: "description", width: 180, align: "left" } + ] + }); + + /*检测重复项*/ + $('#F_EnCode').on('blur', function () { + $.lrExistField(keyValue, 'F_EnCode', top.$.rootUrl + '/LR_SystemModule/CodeRule/ExistEnCode'); + }); + $('#F_FullName').on('blur', function () { + $.lrExistField(keyValue, 'F_FullName', top.$.rootUrl + '/LR_SystemModule/CodeRule/ExistFullName'); + }); + }, + initData: function () { + if (!!selectedRow) { + keyValue = selectedRow.F_RuleId; + $('#form').lrSetFormData(selectedRow); + var formatdata = JSON.parse(selectedRow.F_RuleFormatJson); + $('#gridtable').jfGridSet('refreshdata', formatdata); + } + } + }; + + 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/StuInfoBasicImport", 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/StuInfoBasic/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/StuInfoBasic/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml index c8f6ed840..914c64532 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml @@ -100,7 +100,7 @@  拍照  学生简历表  学籍卡打印 - +  信息批量修改 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js index c5fa514c3..f0a831e5d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js @@ -366,7 +366,19 @@ var bootstrap = function ($, learun) { }); } }); - + $('#lr_import').on('click', + function () { + learun.layerForm({ + id: 'form', + title: '导入', + url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/ImportForm', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); }, // 初始化列表 initGird: function () { 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 909ff2cb2..94ab4f5b0 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 @@ -6,6 +6,7 @@ using System.Data; using Learun.Application.Base.SystemModule; using System; using System.Drawing; +using Learun.Application.TwoDevelopment.EducationalAdministration; namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers { @@ -20,6 +21,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers { private ExcelImportIBLL excelImportIBLL = new ExcelImportBLL(); private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); #region 视图功能 /// /// 导入模板管理页面 @@ -206,10 +208,10 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers /// [HttpPost] [ValidateAntiForgeryToken] - public ActionResult ExecuteImportExcel(string templateId, string fileId, int chunks,string ext) + public ActionResult ExecuteImportExcel(string templateId, string fileId, int chunks, string ext) { UserInfo userInfo = LoginUserInfo.Get(); - string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "."+ ext, chunks, userInfo); + string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); if (!string.IsNullOrEmpty(path)) { DataTable dt = ExcelHelper.ExcelImport(path); @@ -236,14 +238,14 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers /// [HttpPost] [ValidateAntiForgeryToken] - public ActionResult ExecuteImportSaralExcel(string fileId, int chunks,string ext) + public ActionResult ExecuteImportSaralExcel(string fileId, int chunks, string ext) { UserInfo userInfo = LoginUserInfo.Get(); - string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "."+ ext, chunks, userInfo); + string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); if (!string.IsNullOrEmpty(path)) { DataTable dt = ExcelHelper.ExcelImport(path); - string res = excelImportIBLL.ImportSalaryInfo(dt,fileId); + string res = excelImportIBLL.ImportSalaryInfo(dt, fileId); var data = new { Success = res.Split('|')[0], @@ -266,14 +268,14 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers /// [HttpPost] [ValidateAntiForgeryToken] - public ActionResult EmpInfoImport(string fileId, int chunks,string ext) + public ActionResult EmpInfoImport(string fileId, int chunks, string ext) { UserInfo userInfo = LoginUserInfo.Get(); - string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "."+ ext, chunks, userInfo); + string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); if (!string.IsNullOrEmpty(path)) { DataTable dt = ExcelHelper.ExcelImport(path); - string res = excelImportIBLL.EmpInfoImport(dt,fileId); + string res = excelImportIBLL.EmpInfoImport(dt, fileId); var data = new { Success = res.Split('|')[0], @@ -287,6 +289,36 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers } } + /// + /// 学生学籍信息批量修改 + /// + /// 模板Id + /// 文件主键 + /// 分片数 + /// 文件扩展名 + /// + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult StuInfoBasicImport(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); + string res = stuInfoBasicIBLL.StuInfoBasicImport(dt, fileId); + var data = new + { + Success = res.Split('|')[0], + Fail = res.Split('|')[1] + }; + return JsonResult(data); + } + else + { + return Fail("导入数据失败!"); + } + } /// /// 下载文件(导入文件未被导入的数据) /// @@ -294,7 +326,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers /// [HttpPost] [ValidateAntiForgeryToken] - public void DownImportErrorFile(string fileId,string fileName) + public void DownImportErrorFile(string fileId, string fileName) { //设置导出格式 ExcelConfig excelconfig = new ExcelConfig(); @@ -325,7 +357,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers }); } - + } ExcelHelper.ExcelDownload(dt, excelconfig); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuInfoBasicImport.xls b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/StuInfoBasicImport.xls new file mode 100644 index 0000000000000000000000000000000000000000..f97076dfbe23fc3690566bfaa99f87bf17545f72 GIT binary patch literal 18944 zcmeHP30zI-`+x84RyRaxFV$^PY167O+QgtJ%9>QT$(jkNp(#saDM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_=O{?Y({x6SqYZ>;+#{e3Ke4=nK0 z+BR$WW$1Fs=O5d&=5Gu=sOFEqD24#ZZ~VILKYd1dsQWgY?n8$D*FC1s61rSH(@s*~ z$Ol}FdN4N!x=i6=-F>=@m&)|j!Z8AJFlUBOzRbuee`eY8l=FVkh$;$C6;+|Wxhz)YT6XtbU%Ilo4SxVt({AS#KHF9 zEf=8WLso~3^}QfNN(+Sp`eg`YeCV1C8ReZ18Rx6zka4ZI0WyO}qD2G}0w z%E7SY2?LxE_%(klV2*-?3|r#TALZkhT`J3QHqpvn3Hm$M?Fj^$svIp7XuTk#{%8|B z$dJ;|Rw#!zWG%>kkmYs8dQ}n#%d%0_GEGeV4-kLs|0D1QRN2`MAb&UEWBhy+_Ag3* zwEw@TTM5kHy?=}YO!biQ{*MXc2VFE33lL8;;ehco7cxF8>}xC|4aZOrM0*Itd;&z% zXo#j!z!?DNv9K918W!7PsKLZMXY?lBfvOmjIDT-f;)gq)aCCyjzbkzGg4u;SyOGWi z)hHjfwSbH*d%)2Pa(DRig4O{*@qm^+U~9o2Vmtt7$mb210YF1+Z0!#%{y(Sx0d3qd Al>h($ literal 0 HcmV?d00001 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 f4e9eabdd..fd925a48c 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 @@ -1229,6 +1229,8 @@ + + @@ -1319,6 +1321,7 @@ + @@ -8010,6 +8013,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs index 8502745a8..d7bc8a492 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs @@ -705,7 +705,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + public string StuInfoBasicImport(DataTable dt, string fileId) + { + try + { + return stuInfoBasicService.StuInfoBasicImport(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/StuInfoBasic/StuInfoBasicIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs index f8314c069..159aa4526 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs @@ -28,7 +28,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// StuInfoBasicEntity GetStuInfoBasicEntity(string keyValue); List GetMajorInfoWithGraduation(); - void CreateGraduateNoByMajor(string CityCode,string SchoolCode,string MajorList); + void CreateGraduateNoByMajor(string CityCode, string SchoolCode, string MajorList); /// /// 获取StuInfoBasic表实体数据 @@ -42,7 +42,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration StuInfoBasicEntity GetStuInfoBasicEntityByStuNo(string enCode); StuInfoBasicEntity GetStuInfoBasicEntityByStuName(string name); - StuInfoBasicEntity GetStuInfoBasicEntityByStuNoOrStuName(string stuno,string stuname); + StuInfoBasicEntity GetStuInfoBasicEntityByStuNoOrStuName(string stuno, string stuname); /// /// 获取左侧树形数据 /// @@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 审核全部 /// void CheckAll(); - void AllowGraduate(string stuNo,string status); + void AllowGraduate(string stuNo, string status); void SynPhoto(); /// /// 删除实体数据 @@ -67,7 +67,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 领取毕业证 /// /// - void GetCard(string keyValue,string status, StuInfoBasicEntity entity); + void GetCard(string keyValue, string status, StuInfoBasicEntity entity); /// /// 图书资料归还 /// @@ -97,7 +97,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 档案与组织关系转出 /// /// - void IsFileTransfer(string keyValue, string status,string fort); + void IsFileTransfer(string keyValue, string status, string fort); void StuStore(); @@ -108,7 +108,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// void SaveEntity(string keyValue, StuInfoBasicEntity entity); void UpdateAccount(); - void UpdateState(string keyValue,string state); + void UpdateState(string keyValue, string state); #endregion void GenerateAccout(); @@ -116,5 +116,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetAllList(); IEnumerable GetAllList(string ChangeType); IEnumerable GetStuInfoByClassNo(string classNo); + + string StuInfoBasicImport(DataTable dt, string fileId); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs index 6893b9cf1..59eacba08 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs @@ -11,6 +11,8 @@ using Learun.Application.Organization; using System.Reflection; using Learun.Application.Base.SystemModule; using Learun.Application.TwoDevelopment.LogisticsManagement; +using Learun.Cache.Base; +using Learun.Cache.Factory; namespace Learun.Application.TwoDevelopment.EducationalAdministration { @@ -1299,6 +1301,86 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + #region 缓存定义 + private ICache cache = CacheFactory.CaChe(); + private string cacheKey = "Learun_adms_excelError_"; // +公司主键 + #endregion + + /// + /// 学生学籍信息修改 + /// + /// + public string StuInfoBasicImport(DataTable dt, string fileId) + { + try + { + int snum = 0; + int fnum = 0; + 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 stuInfoBasicEntities = this.BaseRepository("CollegeMIS").FindList("select * from StuInfoBasic"); + //修改学生list + List insertedorderlist = new List(); + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + // 循环遍历导入 + foreach (DataRow dr in dt.Rows) + { + try + { + //检测是否有空值 + if (dr[0].ToString() == "" || dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "") + { + throw (new Exception("行内数据有空值,不能为空!")); + } + if (stuInfoBasicEntities.Count(m => m.IdentityCardNo.ToUpper() == dr[0].ToString().ToUpper()) == 0) + { + throw (new Exception("【身份证号】不存在,请核对!")); + } + //写入要导入的数据 + StuInfoBasicEntity stuUpdateList = new StuInfoBasicEntity(); + stuUpdateList.StuId = stuInfoBasicEntities.FirstOrDefault(s => s.IdentityCardNo.ToUpper() == dr[0].ToString().ToUpper())?.StuId.ToString(); + stuUpdateList.StuCode = dr[1].ToString(); + stuUpdateList.MailAddress = dr[2].ToString(); + stuUpdateList.mobile = dr[3].ToString(); + insertedorderlist.Add(stuUpdateList); + snum++; + } + catch (Exception ex) + { + fnum++; + dr["导入错误"] = ex.Message; + failDt.Rows.Add(dr.ItemArray); + } + } + //执行导入 + db.Update(insertedorderlist); + db.Commit(); + if (failDt.Rows.Count > 0) + { + string errordt = failDt.ToJson(); + cache.Write(cacheKey + fileId, errordt, CacheId.excel); + } + } + return snum + "|" + fnum; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion