From 4a612ba3c76d7ac004765c7f33c937f259b05fe7 Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Tue, 11 May 2021 09:49:13 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E9=95=BF=E7=94=A8=E6=88=B7=E7=AE=A1?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../User/UserBLL.cs | 48 +++
.../User/UserIBLL.cs | 5 +
.../User/UserService.cs | 39 ++
.../Controllers/UserController.cs | 10 +
.../Views/User/FamilyIndex.cshtml | 75 ++++
.../Views/User/FamilyIndex.js | 335 ++++++++++++++++++
.../Learun.Application.Web.csproj | 2 +
7 files changed, 514 insertions(+)
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.cshtml
create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js
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 28166cfc8..079f0848b 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs
@@ -382,6 +382,54 @@ namespace Learun.Application.Organization
}
}
}
+
+ ///
+ /// 用户列表(导出Excel)【家长】
+ ///
+ ///
+ public void GetExportListOfFamily()
+ {
+ try
+ {
+ //取出数据源
+ DataTable exportTable = userService.GetExportListOfFamily();
+ //设置导出格式
+ ExcelConfig excelconfig = new ExcelConfig();
+ excelconfig.Title = "家长用户导出";
+ excelconfig.TitleFont = "微软雅黑";
+ excelconfig.TitlePoint = 25;
+ excelconfig.FileName = "家长用户导出.xls";
+ excelconfig.IsAllSizeColumn = true;
+ //每一列的设置,没有设置的列信息,系统将按datatable中的列名导出
+ excelconfig.ColumnEntity = new List();
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_account", ExcelColumn = "账户" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_realname", ExcelColumn = "姓名" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_gender", ExcelColumn = "性别" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_birthday", ExcelColumn = "生日" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_mobile", ExcelColumn = "手机" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_telephone", ExcelColumn = "电话" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_wechat", ExcelColumn = "微信" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_company", ExcelColumn = "学校" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_department", ExcelColumn = "系部" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_description", ExcelColumn = "说明" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_createdate", ExcelColumn = "创建日期" });
+ excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "f_createusername", ExcelColumn = "创建人" });
+ //调用导出方法
+ ExcelHelper.ExcelDownload(exportTable, excelconfig);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
///
/// 获取实体,通过用户账号
///
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 fe666353f..cf230db1b 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs
@@ -70,6 +70,11 @@ namespace Learun.Application.Organization
///
void GetExportListOfStudent();
///
+ /// 用户列表(导出Excel)【家长】
+ ///
+ ///
+ void GetExportListOfFamily();
+ ///
/// 获取实体,通过用户账号
///
/// 用户账号
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 fd8eeb15c..3ed0a7ba5 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs
@@ -304,6 +304,45 @@ namespace Learun.Application.Organization
}
}
}
+
+ ///
+ /// 用户列表(导出Excel)【家长】
+ ///
+ ///
+ public DataTable GetExportListOfFamily()
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append(@"SELECT u.F_Account
+ ,u.F_RealName
+ ,CASE WHEN u.F_Gender=1 THEN '男' ELSE '女' END AS F_Gender
+ ,u.F_Birthday
+ ,u.F_Mobile
+ ,u.F_Telephone
+ ,u.F_WeChat
+ ,o.F_FullName AS F_Company
+ ,u.F_DepartmentId AS F_Department
+ ,u.F_Description
+ ,u.F_CreateDate
+ ,u.F_CreateUserName
+ FROM LR_Base_User u
+ INNER JOIN LR_Base_Company o ON u.F_CompanyId=o.F_CompanyId
+ WHERE u.F_DeleteMark = 0 and u.F_Description = '家长'");
+ return this.BaseRepository().FindTable(strSql.ToString());
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
///
/// 用户实体
///
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs
index e11189411..e56939f12 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs
@@ -415,6 +415,16 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
userIBLL.GetExportListOfStudent();
return Success("导出成功。");
}
+ ///
+ /// 导出用户列表【家长】
+ ///
+ ///
+ [HttpGet]
+ public ActionResult ExportUserListOfFamily()
+ {
+ userIBLL.GetExportListOfFamily();
+ return Success("导出成功。");
+ }
#endregion
#region 验证数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.cshtml
new file mode 100644
index 000000000..f28b56fa5
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.cshtml
@@ -0,0 +1,75 @@
+@{
+ ViewBag.Title = "家长用户管理";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+
+
+
+
+ 未选择校区 - 用户信息
+
+
+
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js
new file mode 100644
index 000000000..2c0c93828
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js
@@ -0,0 +1,335 @@
+var selectedRow;
+var refreshGirdData;
+var bootstrap = function ($, learun) {
+ "use strict";
+ var companyId = '';
+ var departmentId = '';
+
+ var page = {
+ init: function () {
+ page.inittree();
+ page.initGrid();
+ page.bind();
+ },
+ bind: function () {
+ // 查询
+ $('#btn_Search').on('click', function () {
+ var keyword = $('#txt_Keyword').val();
+ page.search({ keyword: keyword });
+ });
+ // 系选择
+ $('#department_select').lrselect({
+ value: "deptno",
+ text: "deptname",
+ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
+ placeholder: '请选择系',
+ // 是否允许搜索
+ allowSearch: true,
+ select: function (item) {
+ if (!item || item.value == '-1') {
+ departmentId = '';
+ }
+ else {
+ departmentId = item.deptno;
+ }
+ page.search();
+ }
+ });
+
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+ //// 新增
+ //$('#lr_add').on('click', function () {
+ // if (!companyId) {
+ // learun.alert.warning('请选择公司!');
+ // return false;
+ // }
+ // selectedRow = null;
+ // learun.layerForm({
+ // id: 'form',
+ // title: '添加账号',
+ // url: top.$.rootUrl + '/LR_OrganizationModule/User/Form?companyId=' + companyId,
+ // width: 750,
+ // height: 450,
+ // callBack: function (id) {
+ // return top[id].acceptClick(refreshGirdData);
+ // }
+ // });
+ //});
+ //// 编辑
+ //$('#lr_edit').on('click', function () {
+ // var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ // selectedRow = $('#gridtable').jfGridGet('rowdata')[0];
+ // if (learun.checkrow(keyValue)) {
+ // if (keyValue.indexOf(',') != -1) {
+ // learun.alert.warning('只能选择一条数据!');
+ // return;
+ // }
+ // learun.layerForm({
+ // id: 'form',
+ // title: '编辑账号',
+ // url: top.$.rootUrl + '/LR_OrganizationModule/User/Form?companyId=' + companyId,
+ // width: 750,
+ // height: 450,
+ // callBack: function (id) {
+ // return top[id].acceptClick(refreshGirdData);
+ // }
+ // });
+ // }
+ //});
+ // 删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/LR_OrganizationModule/User/DeleteForm', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 用户数据导出
+ $('#lr_export').on('click', function () {
+ location.href = top.$.rootUrl + "/LR_OrganizationModule/User/ExportUserListOfFamily";
+ });
+ // 启用
+ $('#lr_enabled').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning('只能选择一条数据!');
+ return;
+ }
+ learun.layerConfirm('是否确认要【启用】账号!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_OrganizationModule/User/UpdateState', { keyValue: keyValue, state: 1 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 禁用
+ $('#lr_disabled').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning('只能选择一条数据!');
+ return;
+ }
+ learun.layerConfirm('是否确认要【禁用】账号!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_OrganizationModule/User/UpdateState', { keyValue: keyValue, state: 0 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 重置账号
+ $('#lr_resetpassword').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认要【重置密码】!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_OrganizationModule/User/ResetPassword', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 重置密码(八位)
+ $('#lr_resetpasswordeight').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认要【重置密码(八位)】!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_OrganizationModule/User/ResetPasswordEight', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ // 功能授权
+ $('#lr_authorize').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ selectedRow = $('#gridtable').jfGridGet('rowdata')[0];
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning('只能选择一条数据!');
+ return;
+ }
+ learun.layerForm({
+ id: 'authorizeForm',
+ title: '功能授权 - ' + selectedRow.F_RealName,
+ url: top.$.rootUrl + '/LR_AuthorizeModule/Authorize/Form?objectId=' + keyValue + '&objectType=2',
+ width: 550,
+ height: 690,
+ btn: null
+ });
+ }
+ });
+ // 移动功能授权
+ $('#lr_appauthorize').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ selectedRow = $('#gridtable').jfGridGet('rowdata')[0];
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning('只能选择一条数据!');
+ return;
+ }
+ learun.layerForm({
+ id: 'appAuthorizeForm',
+ title: '移动功能授权 - ' + selectedRow.F_RealName,
+ url: top.$.rootUrl + '/LR_AuthorizeModule/Authorize/AppForm?objectId=' + keyValue + '&objectType=2',
+ width: 550,
+ height: 690,
+ callBack: function (id) {
+ return top[id].acceptClick();
+ }
+ });
+ }
+ });
+ // 数据授权
+ $('#lr_dataauthorize').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ selectedRow = $('#gridtable').jfGridGet('rowdata')[0];
+ if (learun.checkrow(keyValue)) {
+ if (keyValue.indexOf(',') != -1) {
+ learun.alert.warning('只能选择一条数据!');
+ return;
+ }
+ learun.layerForm({
+ id: 'dataAuthorizeForm',
+ title: '数据授权 - ' + selectedRow.F_RealName,
+ url: top.$.rootUrl + '/LR_AuthorizeModule/DataAuthorize/Index?objectId=' + keyValue + '&objectType=2',
+ width: 1100,
+ height: 700,
+ maxmin: true,
+ btn: null
+ });
+ }
+ });
+ //学生角色批量添加
+ //$("#lr_addRelation").on('click', function () {
+ // learun.getForm(top.$.rootUrl + '/LR_OrganizationModule/User/ResetStudentRelation', function () {
+ // refreshGirdData();
+ // });
+
+ //});
+
+ // 解绑微信
+ $('#lr_cancelweixinbind').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('F_UserId');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认要【解绑微信】!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/Home/CancelWeiXinBind', { keyValue: keyValue }, function (data) {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+
+ $("#lr_closeuser1").on('click', function () {
+ learun.alert.success('禁用成功');
+ })
+ $("#lr_closeuser2").on('click', function () {
+ learun.alert.success('禁用成功');
+ })
+ $("#lr_closeuser3").on('click', function () {
+ learun.alert.success('禁用成功');
+ })
+ },
+ inittree: function () {
+ $('#companyTree').lrtree({
+ url: top.$.rootUrl + '/LR_OrganizationModule/Company/GetTree',
+ param: { parentId: '0' },
+ nodeClick: page.treeNodeClick
+ });
+ $('#companyTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681');
+ },
+ treeNodeClick: function (item) {
+ companyId = item.id;
+ $('#titleinfo').text(item.text);
+
+ $('#department_select').lrselectRefresh({
+ // 访问数据接口地址
+ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo'
+ });
+ departmentId = '';
+ page.search();
+ },
+ initGrid: function () {
+ $('#gridtable').lrAuthorizeJfGrid({
+ url: top.$.rootUrl + '/LR_OrganizationModule/User/GetPageList',
+ headData: [
+ { label: '账户', name: 'F_Account', width: 100, align: 'left' },
+ { label: '姓名', name: 'F_RealName', width: 160, align: 'left' },
+ { label: '手机', name: 'F_Mobile', width: 100, align: 'center' },
+ {
+ label: '系部', name: 'F_DepartmentId', width: 100, align: 'left',
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
+ key: value,
+ keyId: 'deptno',
+ callback: function (_data) {
+ callback(_data['deptname']);
+ }
+ });
+ }
+ },
+ {
+ label: "状态", name: "F_EnabledMark", index: "F_EnabledMark", width: 50, align: "center",
+ formatter: function (cellvalue) {
+ if (cellvalue == 1) {
+ return '正常';
+ } else if (cellvalue == 0) {
+ return '禁用';
+ }
+ }
+ },
+ {
+ label: "最后登录时间", name: "F_UserId_Log", width: 200, align: "left", formatterAsync: function (callback, value, row) {
+ learun.httpAsyncGet(top.$.rootUrl + '/LR_OrganizationModule/User/GetLastLoginTime?userId=' + value, function (res) {
+ if (res.code == learun.httpCode.success) {
+ callback(res.data);
+ }
+ });
+ }
+ },
+ { label: "备注", name: "F_Description", index: "F_Description", width: 200, align: "left" }
+
+ ],
+ isPage: true,
+ reloadSelected: true,
+ mainId: 'F_UserId',
+ isMultiselect: true
+ });
+ },
+ search: function (param) {
+ param = param || {};
+ param.companyId = companyId;
+ param.departmentId = departmentId;
+ param.tp = "1";
+ $('#gridtable').jfGridSet('reload', param);
+ }
+ };
+
+ refreshGirdData = function () {
+ var keyword = $('#txt_Keyword').val();
+ page.search({ keyword: keyword });
+ };
+
+ page.init();
+}
+
+
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 c7404e952..079f36df8 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
@@ -1174,6 +1174,7 @@
+
@@ -6994,6 +6995,7 @@
+