浏览代码

【增加】数据中心-系统设置,增加”默认密码配置“;系统中读取config默认密码的代码修改为读取”默认密码配置“中已启用的密码;

master
dyy 3 年前
父节点
当前提交
03c2b0c685
共有 20 个文件被更改,包括 952 次插入12 次删除
  1. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs
  2. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs
  3. +131
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_DefaultPwdConfigController.cs
  4. +15
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.cshtml
  5. +51
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js
  6. +39
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.cshtml
  7. +112
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js
  8. +18
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs
  9. +11
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs
  10. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  11. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Sys_DefaultPwdConfigMap.cs
  12. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  13. +8
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs
  14. +8
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs
  15. +8
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs
  16. +171
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigBLL.cs
  17. +60
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigEntity.cs
  18. +61
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigIBLL.cs
  19. +213
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigService.cs
  20. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs 查看文件

@@ -857,7 +857,7 @@ namespace Learun.Application.Organization
/// 重置密码
/// </summary>
/// <param name="keyValue">账号主键</param>
public void ResetPassword(string keyValue)
public void ResetPassword(string keyValue, string defaultpwd)
{
try
{
@@ -871,7 +871,7 @@ namespace Learun.Application.Organization
{
cache.Remove(cacheKeyId + item, CacheId.user);
}
string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["defaultpwd"], 32).ToLower();
string password = Md5Helper.Encrypt(defaultpwd, 32).ToLower();
userService.RevisePasswordBatch(keyValue, password);
}
catch (Exception ex)
@@ -908,7 +908,7 @@ namespace Learun.Application.Organization
/// 重置密码(八位)
/// </summary>
/// <param name="keyValue">账号主键</param>
public void ResetPasswordEight(string keyValue)
public void ResetPasswordEight(string keyValue, string defaultpwd)
{
try
{
@@ -916,7 +916,7 @@ namespace Learun.Application.Organization
{
cache.Remove(cacheKeyId + item, CacheId.user);
}
string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["defaultpwdeight"], 32).ToLower();
string password = Md5Helper.Encrypt(defaultpwd, 32).ToLower();
userService.RevisePasswordBatch(keyValue, password);
}
catch (Exception ex)


+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs 查看文件

@@ -130,12 +130,12 @@ namespace Learun.Application.Organization
/// 重置密码
/// </summary>
/// <param name="keyValue">账号主键</param>
void ResetPassword(string keyValue);
void ResetPassword(string keyValue, string defaultpwd);
/// <summary>
/// 重置密码(八位)
/// </summary>
/// <param name="keyValue">账号主键</param>
void ResetPasswordEight(string keyValue);
void ResetPasswordEight(string keyValue, string defaultpwd);
/// <summary>
/// 修改用户状态
/// </summary>
@@ -179,7 +179,7 @@ namespace Learun.Application.Organization
/// <param name="userId">用户ID</param>
void GetImg(string userId);

void setPassword(string userid,string pwd);
void setPassword(string userid, string pwd);
List<UserEntity> GetStudents();
#endregion



+ 131
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_DefaultPwdConfigController.cs 查看文件

@@ -0,0 +1,131 @@
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Web.Mvc;
using System.Collections.Generic;

namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-01-19 11:14
/// 描 述:默认密码配置
/// </summary>
public class Sys_DefaultPwdConfigController : MvcControllerBase
{
private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL();

#region 视图功能

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
return View();
}
/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Form()
{
return View();
}
#endregion

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = sys_DefaultPwdConfigIBLL.GetPageList(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var Sys_DefaultPwdConfigData = sys_DefaultPwdConfigIBLL.GetSys_DefaultPwdConfigEntity( keyValue );
var jsonData = new {
Sys_DefaultPwdConfig = Sys_DefaultPwdConfigData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
sys_DefaultPwdConfigIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="strEntity">实体</param>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity)
{
Sys_DefaultPwdConfigEntity entity = strEntity.ToObject<Sys_DefaultPwdConfigEntity>();
entity.IsEnabled = false;
sys_DefaultPwdConfigIBLL.SaveEntity(keyValue,entity);
if (string.IsNullOrEmpty(keyValue))
{
}
return Success("保存成功!");
}

/// <summary>
/// 启用
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DoEnabled(string keyValue)
{
sys_DefaultPwdConfigIBLL.DoEnabled(keyValue);
return Success("操作成功!");
}
#endregion

}
}

+ 15
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.cshtml 查看文件

@@ -0,0 +1,15 @@
@{
ViewBag.Title = "默认密码配置";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="Sys_DefaultPwdConfig" >
<div class="lr-form-item-title">密码名称<font face="宋体">*</font></div>
<input id="PwdName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="Sys_DefaultPwdConfig" >
<div class="lr-form-item-title">密码<font face="宋体">*</font></div>
<input id="Pwd" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js")

+ 51
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js 查看文件

@@ -0,0 +1,51 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-01-19 11:14
* 描 述:默认密码配置
*/
var acceptClick;
var keyValue = request('keyValue');
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/GetFormData?keyValue=' + keyValue, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
$('#' + id ).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
}
});
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
};
page.init();
}

+ 39
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.cshtml 查看文件

@@ -0,0 +1,39 @@
@{
ViewBag.Title = "默认密码配置";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout ">
<div class="lr-layout-center">
<div class="lr-layout-wrap lr-layout-wrap-notitle ">
<div class="lr-layout-tool">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item">
<div id="multiple_condition_query">
<div class="lr-query-formcontent">
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">密码名称</div>
<input id="PwdName" type="text" class="form-control" />
</div>
</div>
</div>
</div>
</div>
<div class="lr-layout-tool-right">
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_enabled" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js")

+ 112
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js 查看文件

@@ -0,0 +1,112 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-01-19 11:14
* 描 述:默认密码配置
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 220, 400);
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/Form',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/Form?keyValue=' + keyValue,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
// 删除
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/DeleteForm', { keyValue: keyValue}, function () {
refreshGirdData();
});
}
});
}
});
// 启用
$('#lr_enabled').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var IsEnabled = $('#gridtable').jfGridValue('IsEnabled');
if (IsEnabled == true) {
learun.alert.warning("当前项已启用!");
return false;
}
learun.layerConfirm('是否确认启用该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/DoEnabled', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/GetPageList',
headData: [
{ label: "密码名称", name: "PwdName", width: 150, align: "left"},
{ label: "密码", name: "Pwd", width: 150, align: "left"},
{
label: "是否启用", name: "IsEnabled", width: 100, align: "left",
formatter: function (cellvalue, rowObject) {
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
}
},
],
mainId:'Id',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 18
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs 查看文件

@@ -6,6 +6,8 @@ using Learun.Application.Base.AuthorizeModule;
using System.Linq;
using System;
using Learun.Application.Base.SystemModule;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Configuration;

namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
{
@@ -23,6 +25,8 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
private UserRelationIBLL userRelationIBLL = new UserRelationBLL();
private RoleIBLL roleIBLL = new RoleBLL();

private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL();


#region 获取视图

@@ -334,7 +338,13 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
[AjaxOnly]
public ActionResult ResetPassword(string keyValue)
{
userIBLL.ResetPassword(keyValue);
string defpwd = ConfigurationManager.AppSettings["defaultpwd"];
//读取默认密码配置中已启用的密码
if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null)
{
defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd;
}
userIBLL.ResetPassword(keyValue, defpwd);
return Success("操作成功!");
}
/// <summary>
@@ -346,7 +356,13 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers
[AjaxOnly]
public ActionResult ResetPasswordEight(string keyValue)
{
userIBLL.ResetPasswordEight(keyValue);
string defpwd = ConfigurationManager.AppSettings["defaultpwdeight"];
//读取默认密码配置中已启用的密码
if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null)
{
defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd;
}
userIBLL.ResetPasswordEight(keyValue, defpwd);
return Success("操作成功!");
}



+ 11
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs 查看文件

@@ -57,6 +57,7 @@ namespace Learun.Application.Web.Controllers
private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL();
private Perm_FunctionIBLL perm_FunctionIBLL = new Perm_FunctionBLL();
private ICache redisCache = CacheFactory.CaChe();
private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL();
#region 视图功能

public ActionResult ChangePwd()
@@ -229,6 +230,11 @@ namespace Learun.Application.Web.Controllers
string qingJuurl = ConfigurationManager.AppSettings["QingJuurl"];
string qingjuregisterurl = ConfigurationManager.AppSettings["QingJuRegisterurl"];
string defpwd = ConfigurationManager.AppSettings["defaultpwd"];
//读取默认密码配置中已启用的密码
if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null)
{
defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd;
}
var qjinfo = qjAccountIbll.GetQingJu_UserAccountEntityByAccount(userinfo.account);
if (qjinfo == null || string.IsNullOrEmpty(qjinfo.UserAccount))
{
@@ -335,6 +341,11 @@ namespace Learun.Application.Web.Controllers
string qingJuurl = ConfigurationManager.AppSettings["QingJuurl"];
string qingjuregisterurl = ConfigurationManager.AppSettings["QingJuRegisterurl"];
string defpwd = ConfigurationManager.AppSettings["defaultpwd"];
//读取默认密码配置中已启用的密码
if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null)
{
defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd;
}
if (up != null && !string.IsNullOrEmpty(up.QUserName))
{
if (userinfo.Description == "教师")


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj 查看文件

@@ -792,6 +792,7 @@
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_InformationPushController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\StuLeaveManagementController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\EATalentTrainController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_DefaultPwdConfigController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" />
@@ -6124,6 +6125,10 @@
<Content Include="Areas\EducationalAdministration\Views\EATalentTrain\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\EATalentTrain\Form.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\EATalentTrain\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\Sys_DefaultPwdConfig\Index.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\Sys_DefaultPwdConfig\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\Sys_DefaultPwdConfig\Form.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\Sys_DefaultPwdConfig\Form.js" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\LR_Desktop\Models\" />


+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Sys_DefaultPwdConfigMap.cs 查看文件

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-01-19 11:14
/// 描 述:默认密码配置
/// </summary>
public class Sys_DefaultPwdConfigMap : EntityTypeConfiguration<Sys_DefaultPwdConfigEntity>
{
public Sys_DefaultPwdConfigMap()
{
#region 表、主键
//表
this.ToTable("SYS_DEFAULTPWDCONFIG");
//主键
this.HasKey(t => t.Id);
#endregion

#region 配置关系
#endregion
}
}
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj 查看文件

@@ -544,6 +544,7 @@
<Compile Include="EducationalAdministration\Sys_InformationPushMap.cs" />
<Compile Include="EducationalAdministration\StuLeaveManagementMap.cs" />
<Compile Include="EducationalAdministration\EATalentTrainMap.cs" />
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfigMap.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


+ 8
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs 查看文件

@@ -336,6 +336,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
UserIBLL userIBLL = new UserBLL();
var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "教师");
var roleId = Config.GetValue("GenerateTeachersRoleId");
var defaultpwd = Config.GetValue("defaultpwd");
//读取默认密码配置中已启用的密码
var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true);
if (Sys_DefaultPwdConfigEntity != null)
{
defaultpwd = Sys_DefaultPwdConfigEntity.Pwd;
}
var studentList = new List<UserEntity>();
foreach (var tEntity in teacherList)
{
@@ -355,7 +362,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
userbase.F_Account = tEntity.EmpNo;
userbase.F_RealName = tEntity.EmpName;
userbase.F_EnCode = tEntity.EmpNo;
userbase.F_Password = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower();
userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower();
userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url;
userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1;
userbase.F_DeleteMark = 0;


+ 8
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs 查看文件

@@ -715,6 +715,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(m => m.CheckMark != "0");
var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "学生");
var roleId = Config.GetValue("GenerateStudentsRoleId");
var defaultpwd = Config.GetValue("defaultpwd");
//读取默认密码配置中已启用的密码
var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true);
if (Sys_DefaultPwdConfigEntity != null)
{
defaultpwd = Sys_DefaultPwdConfigEntity.Pwd;
}
var studentList = new List<UserEntity>();
foreach (var tEntity in stuInfoBasicEntities)
{
@@ -736,7 +743,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
userbase.F_Account = tEntity.StuNo;
userbase.F_RealName = tEntity.StuName;
userbase.F_EnCode = tEntity.StuNo;
userbase.F_Password = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower();
userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower();
userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url;
userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1;
userbase.F_DeleteMark = 0;


+ 8
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs 查看文件

@@ -1178,6 +1178,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
UserRelationIBLL userRelationIBLL = new UserRelationBLL();
UserIBLL userIBLL = new UserBLL();
var defaultpwd = Config.GetValue("defaultpwd");
//读取默认密码配置中已启用的密码
var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true);
if (Sys_DefaultPwdConfigEntity != null)
{
defaultpwd = Sys_DefaultPwdConfigEntity.Pwd;
}

var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
@@ -1207,7 +1214,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
F_Account = entity.StuNo,
F_RealName = entity.StuName,
F_EnCode = entity.StuNo,
F_Password = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower(),
F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(),
F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url,
F_Gender = entity.GenderNo == "1" ? 1 : 0,
F_DeleteMark = 0,


+ 171
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigBLL.cs 查看文件

@@ -0,0 +1,171 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-01-19 11:14
/// 描 述:默认密码配置
/// </summary>
public class Sys_DefaultPwdConfigBLL : Sys_DefaultPwdConfigIBLL
{
private Sys_DefaultPwdConfigService sys_DefaultPwdConfigService = new Sys_DefaultPwdConfigService();

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<Sys_DefaultPwdConfigEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return sys_DefaultPwdConfigService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取Sys_DefaultPwdConfig表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public Sys_DefaultPwdConfigEntity GetSys_DefaultPwdConfigEntity(string keyValue)
{
try
{
return sys_DefaultPwdConfigService.GetSys_DefaultPwdConfigEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取Sys_DefaultPwdConfig表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public Sys_DefaultPwdConfigEntity GetEnabledEntity()
{
try
{
return sys_DefaultPwdConfigService.GetEnabledEntity();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DeleteEntity(string keyValue)
{
try
{
sys_DefaultPwdConfigService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
/// <returns></returns>
public void SaveEntity(string keyValue, Sys_DefaultPwdConfigEntity entity)
{
try
{
sys_DefaultPwdConfigService.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 启用
/// </summary>
/// <param name="keyValue">主键</param>
public void DoEnabled(string keyValue)
{
try
{
sys_DefaultPwdConfigService.DoEnabled(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

}
}

+ 60
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigEntity.cs 查看文件

@@ -0,0 +1,60 @@
using Learun.Util;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-01-19 11:14
/// 描 述:默认密码配置
/// </summary>
public class Sys_DefaultPwdConfigEntity
{
#region 实体成员
/// <summary>
/// Id
/// </summary>
[Column("ID")]
public string Id { get; set; }
/// <summary>
/// PwdName
/// </summary>
[Column("PWDNAME")]
public string PwdName { get; set; }
/// <summary>
/// Pwd
/// </summary>
[Column("PWD")]
public string Pwd { get; set; }
/// <summary>
/// IsEnabled
/// </summary>
[Column("ISENABLED")]
public bool? IsEnabled { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.Id = Guid.NewGuid().ToString();
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.Id = keyValue;
}
#endregion
#region 扩展字段
#endregion
}
}


+ 61
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigIBLL.cs 查看文件

@@ -0,0 +1,61 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-01-19 11:14
/// 描 述:默认密码配置
/// </summary>
public interface Sys_DefaultPwdConfigIBLL
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<Sys_DefaultPwdConfigEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取Sys_DefaultPwdConfig表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
Sys_DefaultPwdConfigEntity GetSys_DefaultPwdConfigEntity(string keyValue);

/// <summary>
/// 获取Sys_DefaultPwdConfig表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
Sys_DefaultPwdConfigEntity GetEnabledEntity();
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
void DeleteEntity(string keyValue);
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, Sys_DefaultPwdConfigEntity entity);

/// <summary>
/// 启用
/// </summary>
/// <param name="keyValue">主键</param>
void DoEnabled(string keyValue);
#endregion

}
}

+ 213
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigService.cs 查看文件

@@ -0,0 +1,213 @@
using Dapper;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-01-19 11:14
/// 描 述:默认密码配置
/// </summary>
public class Sys_DefaultPwdConfigService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<Sys_DefaultPwdConfigEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.Id,
t.PwdName,
t.Pwd,
t.IsEnabled
");
strSql.Append(" FROM Sys_DefaultPwdConfig t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["PwdName"].IsEmpty())
{
dp.Add("PwdName", "%" + queryParam["PwdName"].ToString() + "%", DbType.String);
strSql.Append(" AND t.PwdName Like @PwdName ");
}
return this.BaseRepository().FindList<Sys_DefaultPwdConfigEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取Sys_DefaultPwdConfig表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public Sys_DefaultPwdConfigEntity GetSys_DefaultPwdConfigEntity(string keyValue)
{
try
{
return this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取Sys_DefaultPwdConfig表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public Sys_DefaultPwdConfigEntity GetEnabledEntity()
{
try
{
return this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DeleteEntity(string keyValue)
{
try
{
this.BaseRepository().Delete<Sys_DefaultPwdConfigEntity>(t => t.Id == keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
public void SaveEntity(string keyValue, Sys_DefaultPwdConfigEntity entity)
{
try
{
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
this.BaseRepository().Update(entity);
}
else
{
entity.Create();
this.BaseRepository().Insert(entity);
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 启用
/// </summary>
/// <param name="keyValue">主键</param>
public void DoEnabled(string keyValue)
{
var db = this.BaseRepository().BeginTrans();
try
{
var model = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true);
if (model != null)
{
model.IsEnabled = false;
db.Update(model);
}
var newmodel = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.Id == keyValue);
if (newmodel != null)
{
newmodel.IsEnabled = true;
db.Update(newmodel);
}

db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

}
}

+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj 查看文件

@@ -1597,6 +1597,10 @@
<Compile Include="EducationalAdministration\EATalentTrain\EATalentTrainService.cs" />
<Compile Include="EducationalAdministration\EATalentTrain\EATalentTrainBLL.cs" />
<Compile Include="EducationalAdministration\EATalentTrain\EATalentTrainIBLL.cs" />
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfig\Sys_DefaultPwdConfigEntity.cs" />
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfig\Sys_DefaultPwdConfigService.cs" />
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfig\Sys_DefaultPwdConfigBLL.cs" />
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfig\Sys_DefaultPwdConfigIBLL.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


正在加载...
取消
保存