Parcourir la source

工资条管理

新疆警官学校中职
ndbs il y a 1 an
Parent
révision
3482ebd409
15 fichiers modifiés avec 676 ajouts et 22 suppressions
  1. +35
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/WageScheduleController.cs
  2. +20
    -19
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.cshtml
  3. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.js
  4. +25
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.cshtml
  5. +136
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css
  6. +242
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js
  7. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.cshtml
  8. +15
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.js
  9. +33
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs
  10. BIN
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/SalarySheetImport.xls
  11. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  12. +18
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleBLL.cs
  13. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleEntity.cs
  14. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleIBLL.cs
  15. +132
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleService.cs

+ 35
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/WageScheduleController.cs Voir le fichier

@@ -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();
}

/// <summary>
/// 导入页面
/// <summary>
/// <returns></returns>
[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("审核成功!");
}

/// <summary>
/// 下载文件
/// </summary>
/// <returns></returns>
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
}
}

+ 20
- 19
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.cshtml Voir le fichier

@@ -7,9 +7,9 @@
<div class="lr-form-item-title">序号</div>
<input id="No" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="col-xs-6 lr-form-item" data-table="ClassInfo">
<div class="lr-form-item-title">姓名<font face="宋体">*</font></div>
<input id="EmpName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
<div id="EmpName" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-4 lr-form-item">
<div class="lr-form-item-title">人员类别</div>
@@ -35,22 +35,7 @@
<div class="lr-form-item-title">百分之十</div>
<input id="TenPercent" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">艰边津贴</div>
<input id="RoughEdgeAllowance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">民族津贴</div>
<input id="NationAllowance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">教龄津贴</div>
<input id="TeachAllowance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">津贴补贴小计</div>
<input id="SubsidiesAllowances" type="text" class="form-control" />
</div>

<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title" style="width: 40%;">基础性绩效(绩效)</div>
<input id="BasicsPerformance" type="text" class="form-control" style="width: 80%; float: right;" />
@@ -67,6 +52,22 @@
<div class="lr-form-item-title">奖励绩效(单列)</div>
<input id="SeparateAwardPerformance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">艰边津贴</div>
<input id="RoughEdgeAllowance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">民族津贴</div>
<input id="NationAllowance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">教龄津贴</div>
<input id="TeachAllowance" type="text" class="form-control" />
</div>
<div class="col-xs-3 lr-form-item">
<div class="lr-form-item-title">特级教师津贴</div>
<input id="SuperfineTeacherResearch" type="text" class="form-control" />
</div>
<div class="col-xs-4 lr-form-item">
<div class="lr-form-item-title">交通补贴</div>
<input id="Transportation" type="text" class="form-control" />
@@ -145,7 +146,7 @@
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">工资卡号<font face="宋体">*</font></div>
<input id="WageCardNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
<input id="WageCardNo" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">发放年份<font face="宋体">*</font></div>


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Form.js Voir le fichier

@@ -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) {


+ 25
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.cshtml Voir le fichier

@@ -0,0 +1,25 @@
@{
ViewBag.Title = "Form";
Layout = "~/Views/Shared/_Form.cshtml";
}
<link href="~/Content/webuploader/webuploader.css" rel="stylesheet" />
<script src="~/Content/webuploader/webuploader.nolog.min.js"></script>
@Html.AppendCssFile("/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css")

<div class="lr-form-layout lr-form-layout-top-bottom">
<div class="lr-form-layout-header">
<div id="lr_add_file_btn"><i class="fa fa-cloud-upload"></i><span class="lrlt">上传文件</span></div>
<div class="webuploader-pick" id="lr_down_file_btn"><i class="fa fa-download"></i><span class="lrlt">下载模板</span></div>
</div>
<div class="lr-form-layout-body">
<div class="lr-form-file-queue-wrap" id="lr_form_file_queue">
<div class="lr-form-file-queue" id="lr_form_file_queue_list">

</div>
<div class="lr-form-file-queue-bg">
<h1><span class="lrlt">试试将电脑里的文件拖拽到此上传</span></h1>
</div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js")

+ 136
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.css Voir le fichier

@@ -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;
}

+ 242
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/ImportForm.js Voir le fichier

@@ -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('<div class="lr-msg2"><span>' + res.data.Success + '</span><span>/</span><span style="color:#b94a48;" >' + res.data.Fail + '</span></div>');
// 如果有失败
if (res.data.Fail != '0')
{
learun.download({ url: top.$.rootUrl + '/LR_SystemModule/ExcelImport/DownImportErrorFile', param: { fileId: fileInfo[file.id].fileGuid, fileName: fileInfo[file.id].name, __RequestVerificationToken: $.lrToken }, method: 'POST' });
}
}
else {
$fileItem.append('<div class="lr-msg"><i class="fa fa-exclamation-circle"></i></div>');
}
});
}
// 触发清楚文件碎片
var reomveFileChunks = function (file) {
var param = {};
param['__RequestVerificationToken'] = $.lrToken;
param['fileGuid'] = fileInfo[file.id].fileGuid;
param['chunks'] = fileInfo[file.id].chunks;
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/Annexes/MergeAnnexesFile", param, function (res) { });
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id);
$fileItem.find('.lr-uploader-progress').remove();
$fileItem.append('<div class="lr-msg"><i class="fa fa-exclamation-circle"></i></div>');
}

var page = {
uploader: null,
init: function () {
/*模板下载*/
$('#lr_down_file_btn').on('click', function () {
learun.download({ url: top.$.rootUrl + '/EducationalAdministration/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 = $('<div class="lr-form-file-queue-item" id="lr_filequeue_' + file.id + '" ></div>');
$item.append('<div class="lr-file-image"><img src="' + top.$.rootUrl + '/Content/images/filetype/' + file.ext + '.png"></div>');
$item.append('<span class="lr-file-name">' + file.name + '(' + learun.countFileSize(file.size) + ')</span>');

$('#lr_form_file_queue_list').append($item);
},
uploadStart: function (file) {
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id);
$fileItem.append('<div class="lr-uploader-progress"><div class="lr-uploader-progress-bar" style="width:0%;"></div></div>');
},
uploadBeforeSend: function (object, data, headers) {
data.chunk = data.chunk || 0;
data.chunks = data.chunks || 1;
fileInfo[data.id].fileGuid = fileInfo[data.id].fileGuid || WebUploader.Base.guid();
data.fileGuid = fileInfo[data.id].fileGuid;
fileInfo[data.id].chunks = data.chunks;
},
uploadProgress: function (file, percentage) {
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id);
$fileItem.find('.lr-uploader-progress-bar').css('width', (percentage * 100 + '%'));
},
uploadSuccess: function (file, res) {
if (res.code == 200) {// 上传成功
mergeFileChunks(file);
}
else {// 上传失败
reomveFileChunks(file);
}
},
uploadError: function (file, code) {
reomveFileChunks(file);
},
uploadComplete: function (file) {
},
error: function (type) {
switch (type) {
case 'Q_TYPE_DENIED':
learun.alert.error('当前文件类型不允许上传');
break;
};
}
};
page.init();

}

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.cshtml Voir le fichier

@@ -53,6 +53,7 @@
<a id="lr_checkall" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;审核全部</a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;审核</a>
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;去审核</a>
<a id="lr_import" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;导入</a>
</div>
</div>
</div>


+ 15
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/WageSchedule/Index.js Voir le fichier

@@ -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 },
]
},
{


+ 33
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs Voir le fichier

@@ -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 视图功能
/// <summary>
/// 导入模板管理页面
@@ -319,6 +321,37 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
return Fail("导入数据失败!");
}
}

/// <summary>
/// 工资条导入
/// </summary>
/// <param name="templateId">模板Id</param>
/// <param name="fileId">文件主键</param>
/// <param name="chunks">分片数</param>
/// <param name="ext">文件扩展名</param>
/// <returns></returns>
[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("导入数据失败!");
}
}
/// <summary>
/// 下载文件(导入文件未被导入的数据)
/// </summary>


BIN
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/SalarySheetImport.xls Voir le fichier


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Voir le fichier

@@ -1427,6 +1427,8 @@
<Content Include="Areas\EducationalAdministration\Views\Thermography\IndexResult.js" />
<Content Include="Areas\EducationalAdministration\Views\Thermography\StatisticIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\Thermography\SubmitIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\WageSchedule\ImportForm.css" />
<Content Include="Areas\EducationalAdministration\Views\WageSchedule\ImportForm.js" />
<Content Include="Areas\EducationalAdministration\Views\WageSchedule\IndexMy.js" />
<Content Include="Areas\EvaluationTeach\Views\Eval_Main\AnswerIndex.js" />
<Content Include="Areas\EvaluationTeach\Views\Eval_Main\TeacherIndex2.js" />
@@ -8019,6 +8021,8 @@
<Content Include="Content\excel\AccommodationImport.xls" />
<Content Include="Content\excel\StuInfoBasicImport.xls" />
<Content Include="Areas\EducationalAdministration\Views\WageSchedule\IndexMy.cshtml" />
<Content Include="Content\excel\SalarySheetImport.xls" />
<Content Include="Areas\EducationalAdministration\Views\WageSchedule\ImportForm.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 18
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleBLL.cs Voir le fichier

@@ -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

}


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleEntity.cs Voir le fichier

@@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <returns></returns>
[Column("TOTALGROSSPAY")]
public string TotalGrossPay { get; set; }
public decimal? TotalGrossPay { get; set; }
/// <summary>
/// 岗位工资
/// </summary>
@@ -271,7 +271,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <returns></returns>
[Column("ISSUEMONTH")]
public string IssueMonth { get; set; }
public int? IssueMonth { get; set; }
/// <summary>
/// 发放年份
/// </summary>


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleIBLL.cs Voir le fichier

@@ -57,6 +57,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration

void CheckEntity(string keyValue,string Status);

/// <summary>
/// 工资条导入
/// </summary>
/// <param name="dt"></param>
/// <param name="fileId"></param>
/// <returns></returns>
string SalarySheelImport(DataTable dt, string fileId);
#endregion

}


+ 132
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/WageSchedule/WageScheduleService.cs Voir le fichier

@@ -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
/// <summary>
/// 学生学籍信息修改
/// </summary>
/// <param name="dt"></param>
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<EmpInfoEntity> EmpInfoEntities = this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>("select * from empinfo");
//修改学生list
List<WageScheduleEntity> wageScheduleEntityList = new List<WageScheduleEntity>();
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<WageScheduleEntity>(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<string>(cacheKey + fileId, errordt, CacheId.excel);
}
}
return snum + "|" + fnum;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}


Chargement…
Annuler
Enregistrer