From 3482ebd409f56fc66583878c9ad435cb8c5b5e36 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 28 Dec 2022 11:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E6=9D=A1=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/WageScheduleController.cs | 35 +++ .../Views/WageSchedule/Form.cshtml | 39 +-- .../Views/WageSchedule/Form.js | 6 + .../Views/WageSchedule/ImportForm.cshtml | 25 ++ .../Views/WageSchedule/ImportForm.css | 136 ++++++++++ .../Views/WageSchedule/ImportForm.js | 242 ++++++++++++++++++ .../Views/WageSchedule/Index.cshtml | 1 + .../Views/WageSchedule/Index.js | 16 +- .../Controllers/ExcelImportController.cs | 33 +++ .../Content/excel/SalarySheetImport.xls | Bin 0 -> 20480 bytes .../Learun.Application.Web.csproj | 4 + .../WageSchedule/WageScheduleBLL.cs | 18 ++ .../WageSchedule/WageScheduleEntity.cs | 4 +- .../WageSchedule/WageScheduleIBLL.cs | 7 + .../WageSchedule/WageScheduleService.cs | 132 ++++++++++ 15 files changed, 676 insertions(+), 22 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/SalarySheetImport.xls diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/WageScheduleController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/WageScheduleController.cs index ed352b695..687ba14e8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/WageScheduleController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/WageScheduleController.cs @@ -1,6 +1,8 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; using Learun.Util; +using System; using System.Data; +using System.IO; using System.Web.Mvc; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers @@ -45,6 +47,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + /// + /// 导入页面 + /// + /// + [HttpGet] + public ActionResult ImportForm() + { + return View(); + } + #endregion #region 获取数据 @@ -165,6 +178,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers wageScheduleIBLL.CheckEntity(keyValue, Status); return Success("审核成功!"); } + + /// + /// 下载文件 + /// + /// + public ActionResult DownTemplate() + { + FileStreamResult result = null; + try + { + var path = Server.MapPath("~/Content/excel/"); + var pathoffull = path + "SalarySheetImport.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/WageSchedule/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.cshtml index de95507f4..dbbd761d1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.cshtml @@ -7,9 +7,9 @@
序号
-
+
姓名*
- +
人员类别
@@ -35,22 +35,7 @@
百分之十
-
-
艰边津贴
- -
-
-
民族津贴
- -
-
-
教龄津贴
- -
-
-
津贴补贴小计
- -
+
基础性绩效(绩效)
@@ -67,6 +52,22 @@
奖励绩效(单列)
+
+
艰边津贴
+ +
+
+
民族津贴
+ +
+
+
教龄津贴
+ +
+
+
特级教师津贴
+ +
交通补贴
@@ -145,7 +146,7 @@
工资卡号*
- +
发放年份*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.js index a160c9a33..3714661fb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.js @@ -23,6 +23,11 @@ var bootstrap = function ($, learun) { text: 'text' }); $('#IssueMonth').lrDataItemSelect({ code: 'MPMonth' }); + $('#EmpName').lrDataSourceSelect({ + allowSearch: true, + Height: 200, + code: 'teacheruserdata', value: 'f_realname', text: 'f_realname' + }); }, initData: function () { //if (!!selectedRow) { @@ -49,6 +54,7 @@ var bootstrap = function ($, learun) { return false; } var postData = $('#form').lrGetFormData(); + $("#EmpName").val($("#EmpName").find(".lr-select-placeholder").text()); $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/WageSchedule/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.cshtml new file mode 100644 index 000000000..c8b810d15 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.cshtml @@ -0,0 +1,25 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +@Html.AppendCssFile("/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css") + +
+
+
上传文件
+
下载模板
+
+
+
+
+ +
+
+

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

+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css new file mode 100644 index 000000000..04b556b7a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/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/WageSchedule/ImportForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js new file mode 100644 index 000000000..1a7f06293 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js @@ -0,0 +1,242 @@ +/* + * 版 本 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/SalarySheetImport", 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/WageSchedule/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/WageSchedule/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.cshtml index 20a5dba0b..322af1f40 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.cshtml @@ -53,6 +53,7 @@  审核全部  审核  去审核 +  导入
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.js index 3a08c880f..9c3c52e51 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.js @@ -148,6 +148,21 @@ var bootstrap = function ($, learun) { } }); }); + ///上传 + $('#lr_import').on('click', + function () { + learun.layerForm({ + id: 'form', + title: '导入', + url: top.$.rootUrl + '/EducationalAdministration/WageSchedule/ImportForm', + width: 600, + height: 400, + btn: null, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); }, initGird: function () { $('#gridtable').jfGrid({ @@ -190,7 +205,6 @@ var bootstrap = function ($, learun) { { label: '民族津贴', name: 'NationAllowance', width: 70, align: "left", statistics: true }, { label: '教龄补贴', name: 'TeachAllowance', width: 70, align: "left", statistics: true }, { label: '特级教师津贴', name: 'SuperfineTeacherResearch', width: 80, align: "left", statistics: true }, - //{ label: '小计', name: 'SubsidiesAllowances', width: 70, align: "left", statistics: true }, ] }, { 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 94ab4f5b0..a73267113 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,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers private ExcelImportIBLL excelImportIBLL = new ExcelImportBLL(); private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + private WageScheduleIBLL wageScheduleIBLL = new WageScheduleBLL(); + #region 视图功能 /// /// 导入模板管理页面 @@ -319,6 +321,37 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return Fail("导入数据失败!"); } } + + /// + /// 工资条导入 + /// + /// 模板Id + /// 文件主键 + /// 分片数 + /// 文件扩展名 + /// + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult SalarySheetImport(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 = wageScheduleIBLL.SalarySheelImport(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/SalarySheetImport.xls b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/SalarySheetImport.xls new file mode 100644 index 0000000000000000000000000000000000000000..fd307900989ee9e03d3ad1ad58136f16e9451fc8 GIT binary patch literal 20480 zcmeG^2S8LwvOPl@P-IY&ATT6BK_!TYs0?5h$p%h9K!&g?Dx#|*$|{Bx6i`uQS;fWd z8rCd`dBuPUMGkjW6m!;95fi`ay?Hak%$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VK5TayXo8g#w>I_}^UOf#+yAtzrwx^hf!))#s{W?;YfCwQ2ZH01lhscL0geb2w=4+5XaP~HuI*Sug{{ztP`~PUV16SG64p{!ffSb$( zDD0mUesBGMQneB`fA#v&4={X$i1R-N^dD@ZR0P1EWB`T`DlV`(2K@t++2 E2N~Opwg3PC 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 94375cfe8..fcc8ee05a 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 @@ -1427,6 +1427,8 @@ + + @@ -8019,6 +8021,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleBLL.cs index 886529b8f..c14ba98a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleBLL.cs @@ -217,6 +217,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public string SalarySheelImport(DataTable dt, string fileId) + { + try + { + return wageScheduleService.SalarySheelImport(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/WageSchedule/WageScheduleEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleEntity.cs index 79d44d371..e2d7becc9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleEntity.cs @@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// [Column("TOTALGROSSPAY")] - public string TotalGrossPay { get; set; } + public decimal? TotalGrossPay { get; set; } /// /// 岗位工资 /// @@ -271,7 +271,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
/// [Column("ISSUEMONTH")] - public string IssueMonth { get; set; } + public int? IssueMonth { get; set; } /// /// 发放年份 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleIBLL.cs index 1c648eed2..2f64a32f9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleIBLL.cs @@ -57,6 +57,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void CheckEntity(string keyValue,string Status); + /// + /// 工资条导入 + /// + /// + /// + /// + string SalarySheelImport(DataTable dt, string fileId); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleService.cs index 8dbdb7a58..6f9774d23 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleService.cs @@ -1,4 +1,6 @@ using Dapper; +using Learun.Cache.Base; +using Learun.Cache.Factory; using Learun.DataBase.Repository; using Learun.Util; using System; @@ -320,6 +322,136 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + #region 缓存定义 + private ICache cache = CacheFactory.CaChe(); + private string cacheKey = "Learun_adms_excelError_"; // +公司主键 + #endregion + /// + /// 学生学籍信息修改 + /// + /// + public string SalarySheelImport(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 EmpInfoEntities = this.BaseRepository("CollegeMIS").FindList("select * from empinfo"); + //修改学生list + List wageScheduleEntityList = new List(); + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + // 循环遍历导入 + foreach (DataRow dr in dt.Rows) + { + try + { + //检测是否有空值 + if (dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "" || dr[4].ToString() == "" || dr[5].ToString() == "" || dr[6].ToString() == "" || dr[26].ToString() == "" || dr[35].ToString() == "") + { + throw (new Exception("行内必填项数据有空值,不能为空!")); + } + if (dr[36].ToString() == "" || dr[37].ToString() == "") + { + throw (new Exception("发放年月不能为空")); + } + if (EmpInfoEntities.Count(m => m.EmpName.ToUpper() == dr[1].ToString().ToUpper()) == 0) + { + throw (new Exception("【姓名】不存在,请核对!")); + } + + if (wageScheduleEntityList.Count(x => x.IssueYear == dr[37].ToString() && x.IssueMonth == dr[36].ToInt() && x.EmpName == dr[1].ToString()) > 0) + { + throw (new Exception("当月信息已重复,信息已忽略")); + } + + //写入要导入的数据 + WageScheduleEntity wageScheduleEntity = new WageScheduleEntity + { + Id = Guid.NewGuid().ToString(), + No = dr[0].ToString(), + EmpName = dr[1].ToString(), + WageCardNo = dr[2].ToString(), + PeopleType = dr[3].ToString(), + PostType = dr[4].ToString(), + PayGrade = dr[5].ToString(), + TotalGrossPay = dr[6].ToDecimalOrNull(), + PostWage = dr[7].ToDecimalOrNull(), + PayGradeWage = dr[8].ToDecimalOrNull(), + TenPercent = dr[9].ToDecimalOrNull(), + BasicsPerformance = dr[10].ToDecimalOrNull(), + AwardPerformance = dr[11].ToDecimalOrNull(), + SeparateBasicsPerformance = dr[12].ToDecimalOrNull(), + SeparateAwardPerformance = dr[13].ToDecimalOrNull(), + RoughEdgeAllowance = dr[14].ToDecimalOrNull(), + NationAllowance = dr[15].ToDecimalOrNull(), + TeachAllowance = dr[16].ToDecimalOrNull(), + SuperfineTeacherResearch = dr[17].ToDecimalOrNull(), + Transportation = dr[18].ToDecimalOrNull(), + RealeState = dr[19].ToDecimalOrNull(), + WorkKeep = dr[20].ToDecimalOrNull(), + GirlStaffSanitation = dr[21].ToDecimalOrNull(), + TownshipSubsidy = dr[22].ToDecimalOrNull(), + HousingAllowance = dr[23].ToDecimalOrNull(), + HousingFundAllowance = dr[24].ToDecimalOrNull(), + OtherOne = dr[25].ToDecimalOrNull(), + DeductionsSubtotal = dr[26].ToDecimalOrNull(), + AccumulationFund = dr[27].ToDecimalOrNull(), + EndowmentInsurance = dr[28].ToDecimalOrNull(), + OccupationalAnnuities = dr[29].ToDecimalOrNull(), + MedicalInsurance = dr[30].ToDecimalOrNull(), + UnemploymentInsurance = dr[31].ToDecimalOrNull(), + PersonalIncomeTax = dr[32].ToDecimalOrNull(), + LaborUnionWage = dr[33].ToDecimalOrNull(), + Other = dr[34].ToDecimalOrNull(), + NetCombined = dr[35].ToDecimalOrNull(), + IssueMonth = dr[36].ToInt(), + IssueYear = dr[37].ToString(), + F_EnabledMark = "0" + }; + + wageScheduleEntityList.Add(wageScheduleEntity); + db.Delete(x => x.EmpName == wageScheduleEntity.EmpName && x.IssueMonth == wageScheduleEntity.IssueMonth && x.IssueYear == wageScheduleEntity.IssueYear); + snum++; + } + catch (Exception ex) + { + fnum++; + dr["导入错误"] = ex.Message; + failDt.Rows.Add(dr.ItemArray); + } + } + //执行导入 + db.Insert(wageScheduleEntityList); + 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 }