diff --git a/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园统一身份认证oauth2.0对接说明V1.0.docx b/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园统一身份认证oauth2.0对接说明V1.0.docx new file mode 100644 index 000000000..2032f6d43 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园统一身份认证oauth2.0对接说明V1.0.docx @@ -0,0 +1,72 @@ + + +数字化智慧校园 + + + + + +统一身份认证oauth2.0 +对接说明 + + + + + + +V1.0 + + +概述 + 由于各学校存在N套系统,各系统都存在自己独立的用户登录验证,给使用者造成了许多重复操作,也容易造成帐户密码混乱及丢失的情况。为了低成本的解决以上问题,我公司特开发了基于原系统验证方式、无需统一使用用户库的解决方案。 + 对接方当前所使用的用户验证体系无需更改,仅需增加数据解密部分代码。 +实现逻辑 + 标准oauth2.0认证。 +统一身份认证工作机制说明 +第一步,各对接方在数字化智慧校园系统中配置统一身份认证的登录接口地址 +我方提供配置UI +外网测试地址: +http://demo.bjquanjiang.com:8081/ 测试用户名:thirdtest密码:123456 +学校内网地址: +依照学校实际地址 +系统登录 + +应用添加 + +应用配置 + +权限配置 + +查看个人应用 + +点击【进入系统】访问 + +跳转页面如下图 + +至此,统一应用端配置完毕。 + +第二步 获取授权码(authorization code) +采用标准Http Get请求方式,code有效期为10分钟 +请求地址:http://demo.bjquanjiang.com:8081/SSOSystem/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code +参数说明 + 参数 + 是否必须 + 说明 +appid +是 +应用唯一标识 +redirect_uri +是 +获取授权码成功后重定向到的地址 +请使用urlEncode对链接进行处理 +response_type +是 +填code +获取到code后,授权系统会重定向到redirect_uri地址并携带code参数,例如: +http://demo.bjquanjiang.com:8081/Login/CheckLoginForSSO20?code=CODE +第三步:通过code获取access_token +通过code获取access_token + +示例代码仅供参考: +C# + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs index dc2182b7e..d86188c5b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs @@ -407,6 +407,31 @@ namespace Learun.Application.Organization } } } + /// + /// 获取实体,通过用户名 + /// + /// 用户账号 + /// + public UserEntity GetEntityByName(string name) + { + try + { + UserEntity userEntity; + userEntity = userService.GetEntityByName(name); + return userEntity; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } public void UpdateIp(string ip, string id) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs index 1472103c9..d3638ade7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs @@ -76,6 +76,12 @@ namespace Learun.Application.Organization /// UserEntity GetEntityByAccount(string account); /// + /// 获取实体,通过用户名 + /// + /// 用户账号 + /// + UserEntity GetEntityByName(string account); + /// /// 获取用户数据 /// /// 用户主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs index 4cc8bce5b..c3bd4ab11 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs @@ -55,6 +55,30 @@ namespace Learun.Application.Organization } } /// + /// 获取实体,通过用户账号 + /// + /// 用户账号 + /// + public UserEntity GetEntityByName(string name) + { + try + { + return this.BaseRepository() + .FindEntity(a => a.F_RealName.Equals(name) && a.F_DeleteMark == 0); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 用户列表(根据公司主键) /// /// 公司主键 @@ -81,7 +105,7 @@ namespace Learun.Application.Organization } } } - internal bool GetStuAny() + internal bool GetStuAny() { try { @@ -557,7 +581,7 @@ namespace Learun.Application.Organization { try { - return this.BaseRepository().FindList(a=>a.F_DepartmentId==departmentId).ToList(); + return this.BaseRepository().FindList(a => a.F_DepartmentId == departmentId).ToList(); } catch (Exception ex) { @@ -576,7 +600,7 @@ namespace Learun.Application.Organization try { var ids = departmentId.Split(','); - return this.BaseRepository().FindList(a=> ids.Contains(a.F_DepartmentId)).ToList(); + return this.BaseRepository().FindList(a => ids.Contains(a.F_DepartmentId)).ToList(); } catch (Exception ex) { @@ -590,7 +614,7 @@ namespace Learun.Application.Organization } } } - + /// @@ -798,14 +822,14 @@ namespace Learun.Application.Organization string path = ""; try { - var userentity=BaseRepository().FindEntity("select a.*,b.Photo from LR_Base_User a " + - "left join "+BaseRepository("CollegeMIS").getDbConnection().Database+ - ".dbo.empinfo b on a.F_Account=b.empno where a.F_UserId='"+userid+"'", null); - if (userentity!=null&&!string.IsNullOrEmpty(userentity.Photo)) + var userentity = BaseRepository().FindEntity("select a.*,b.Photo from LR_Base_User a " + + "left join " + BaseRepository("CollegeMIS").getDbConnection().Database + + ".dbo.empinfo b on a.F_Account=b.empno where a.F_UserId='" + userid + "'", null); + if (userentity != null && !string.IsNullOrEmpty(userentity.Photo)) { //获取图片 - var LR_Base_AnnexesFile = BaseRepository().FindEntity("select * from LR_Base_AnnexesFile where F_FolderId='"+ userentity.Photo + "'", null); - if (LR_Base_AnnexesFile!=null) + var LR_Base_AnnexesFile = BaseRepository().FindEntity("select * from LR_Base_AnnexesFile where F_FolderId='" + userentity.Photo + "'", null); + if (LR_Base_AnnexesFile != null) { path = LR_Base_AnnexesFile.F_FilePath; } 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 24c0d8cc3..7e7159e5f 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 @@ -226,6 +226,36 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return Fail("导入数据失败!"); } } + /// + /// 工资导入 + /// + /// 模板Id + /// 文件主键 + /// 分片数 + /// 文件扩展名 + /// + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult ExecuteImportSaralExcel(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 = excelImportIBLL.ImportSalaryInfo(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/Areas/LR_SystemModule/Views/ExcelExport/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/ExcelExport/Index.js index b0e741e6c..ada65c5bb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/ExcelExport/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/ExcelExport/Index.js @@ -24,6 +24,7 @@ var bootstrap = function ($, learun) { } else { moduleId = item.id; + page.search(); } $('#titleinfo').text(item.text); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.cshtml index 3283afc24..e1f4ef021 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.cshtml @@ -19,6 +19,10 @@
登录接口地址*
+
应用私钥*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.js index 741daf6f3..ef0fc852b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/Perm_Function/Form.js @@ -43,6 +43,7 @@ var bootstrap = function ($, learun) { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } + $("#divFId").css("display","block"); }); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Sal_UserSalaryController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Sal_UserSalaryController.cs index df439a7a6..b6df361d8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Sal_UserSalaryController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Sal_UserSalaryController.cs @@ -4,6 +4,7 @@ using System.Data; using Learun.Application.TwoDevelopment.PersonnelManagement; using System.Web.Mvc; using System.Collections.Generic; +using System.Drawing; using System.Linq; namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers @@ -42,6 +43,15 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers return View(); } /// + /// 工资导入 + /// + /// + [HttpGet] + public ActionResult ImportForm() + { + return View(); + } + /// /// 表单页 /// /// @@ -256,5 +266,47 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers } #endregion + #region 获取模板 + + /// + /// 下载工资导入模板 + /// + [HttpPost] + [ValidateAntiForgeryToken] + public void DownTemplate() + { + //设置导出格式 + ExcelConfig excelConfig=new ExcelConfig(); + excelConfig.FileName = "工资导入模板.xls"; + excelConfig.IsAllSizeColumn = true; + excelConfig.ColumnEntity=new List(); + //获取工资列 + var itemList = sal_UserSalaryIBLL.GetAllTemplateInfo(); + //表头 + DataTable dt=new DataTable(); + excelConfig.ColumnEntity.Add(new ColumnModel() + { + Column = "姓名", + ExcelColumn = "姓名", + Alignment = "center", + Background = new Color() + }); + dt.Columns.Add("姓名", typeof(string)); + foreach (var item in itemList) + { + excelConfig.ColumnEntity.Add(new ColumnModel() + { + Column = item.STIName, + ExcelColumn = item.STIName, + Alignment = "center", + Background = new Color() + }); + dt.Columns.Add(item.STIName, typeof(string)); + } + ExcelHelper.ExcelDownload(dt, excelConfig); + + } + #endregion + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.cshtml new file mode 100644 index 000000000..75bc4f7e7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.cshtml @@ -0,0 +1,25 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +@Html.AppendCssFile("/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.css") + +
+
+
上传文件
+
下载模板
+
+
+
+
+ +
+
+

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

+
+
+
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.css new file mode 100644 index 000000000..04b556b7a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/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/PersonnelManagement/Views/Sal_UserSalary/ImportForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/ImportForm.js new file mode 100644 index 000000000..50fa7e312 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/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/ExecuteImportSaralExcel", 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 + '/PersonnelManagement/Sal_UserSalary/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/PersonnelManagement/Views/Sal_UserSalary/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.cshtml index ce7d4451a..bb14df0c5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.cshtml @@ -7,6 +7,19 @@
+
+
+
+
+
+
+
+
单位组织
+
+
+
+
+
@@ -17,6 +30,7 @@  编辑  查看  删除 +  导入
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.js index b84d17809..b2a5bbc2a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/Index.js @@ -7,12 +7,48 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var startTime; + var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + + $('#F_UserId').lrUserSelect(0); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -46,6 +82,18 @@ var bootstrap = function ($, learun) { }); } }); + $('#lr_import').on('click',function() { + learun.layerForm({ + id: 'form', + title: '导入', + url: top.$.rootUrl + '/PersonnelManagement/Sal_UserSalary/ImportForm', + width: 400, + height: 300, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }) //查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('USId'); @@ -87,7 +135,7 @@ var bootstrap = function ($, learun) { { label: "人员", name: "F_UserId", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('user', { + learun.clientdata.getAsyncReal('user', { key: value, callback: function (_data) { callback(_data.name); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.cshtml index 17cd47c3d..738e454ca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.cshtml @@ -7,6 +7,10 @@
+
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.js index 617815bf4..8abcd970b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Sal_UserSalary/IndexOfMy.js @@ -7,12 +7,42 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var startTime; + var endTime; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs index c991b88a0..eacf1a3c8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs @@ -15,6 +15,7 @@ using Learun.Application.TwoDevelopment.LogisticsManagement; using System.Linq; using Learun.Application.OA; using Learun.Application.TwoDevelopment.LR_Desktop; +using Learun.Application.TwoDevelopment.Permission; using Learun.Application.WorkFlow; namespace Learun.Application.Web.Controllers @@ -54,6 +55,7 @@ namespace Learun.Application.Web.Controllers private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL(); private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL(); + private Perm_FunctionIBLL perm_FunctionIBLL = new Perm_FunctionBLL(); #region 视图功能 public ActionResult ChangePwd() @@ -61,11 +63,34 @@ namespace Learun.Application.Web.Controllers return View(); } + #region 统一身份认证2.0 public ActionResult SSOApplication() { + var userinfo = LoginUserInfo.Get(); + ViewBag.FunctionList = perm_FunctionIBLL.GetListByUserId(userinfo.userId); + return View(); + } + /// + /// 跳转网站 + /// + /// + public ActionResult GoToApplication() + { + string redi = Request.QueryString["redi"]; + if (!string.IsNullOrEmpty(redi)) + { + var perm_application = perm_FunctionIBLL.GetPerm_FunctionEntity(Request.QueryString["appid"]); + if (perm_application != null) + { + return Redirect(perm_application.FInterfaceUrl); + } + else + return RedirectToAction("Index"); + } return View(); } + #endregion public ActionResult NeedToDoForm() { var userinfo = LoginUserInfo.Get(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs index 62d7daa89..2121a95cf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs @@ -35,6 +35,50 @@ namespace Learun.Application.Web.Controllers private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL(); private Perm_FunctionVisitIBLL functionVisitIbll = new Perm_FunctionVisitBLL(); + #region 统一身份认证2.0 + /// + /// 请求code + /// + /// + public ActionResult authorize() + { + string appid = Request.QueryString["appid"]; + string redirect_uri = Request.QueryString["redirect_uri"]; + string response_type = Request.QueryString["response_type"]; + if (string.IsNullOrEmpty(appid)) + { + return Fail("参数:appid不能为空"); + } + if (string.IsNullOrEmpty(redirect_uri)) + { + return Fail("参数:redirect_uri不能为空"); + } + if (string.IsNullOrEmpty(response_type)) + { + return Fail("参数:response_type不能为空"); + } + if (response_type!="code") + { + return Fail("参数:response_type必须为code"); + } + var application = perm_FunctionIBLL.GetPerm_FunctionEntity(appid); + if (application != null) + { + if (application.FInterfaceUrl.Equals(redirect_uri)) + { + var code = appid + Util.CommonHelper.RndNum(9); + return Success(""); + } + else + { + return Fail("未授权的redirect_uri"); + } + } + else + return Fail("未授权的appid"); + } + + #endregion public ActionResult Index() { string account = ""; 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 4ad27cb59..0d9a731ac 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 @@ -1323,6 +1323,8 @@ + + @@ -6836,6 +6838,7 @@ + @@ -6905,6 +6908,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/GoToApplication.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/GoToApplication.cshtml new file mode 100644 index 000000000..9bd99ede7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/GoToApplication.cshtml @@ -0,0 +1,34 @@ +@{ + Layout = null; +} + + + + + + + 统一身份认证平台 + + + + + + +
+
+ +
+
IDENTITY AUTHENTICATION
+
统一身份认证平台
+
系统认证中,请耐心等待...
+
+ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/SSOApplication.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/SSOApplication.cshtml index a9e8e0bb3..3c12e9bb9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/SSOApplication.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/SSOApplication.cshtml @@ -1,4 +1,5 @@ -@{ +@using Learun.Application.TwoDevelopment.Permission +@{ ViewBag.Title = "title"; Layout = "~/Views/Shared/_Index.cshtml"; } @@ -131,13 +132,15 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js index 0e1a5ee34..f0f8a5e68 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-clientdata.js @@ -99,6 +99,10 @@ }, update: function (name) { clientAsyncData[name].update && clientAsyncData[name].update(); + }, + getAsyncReal:function(name, op) { + clientAsyncData[name].states = 1; + return clientAsyncData[name].get(op); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config index 489b3b61f..98052c85f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config @@ -9,16 +9,16 @@ --> - + - +