浏览代码

新账号登录

黑艺新账号
dao 6 个月前
父节点
当前提交
2854e24774
共有 11 个文件被更改,包括 75 次插入14 次删除
  1. +22
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs
  2. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs
  3. +27
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs
  5. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Feixing/UserApiController.cs
  6. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TaiGang/TUserApi.cs
  7. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs
  8. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs
  9. +9
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs
  10. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs
  11. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs

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

@@ -9,6 +9,7 @@ using Learun.Application.WeChat;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;

namespace Learun.Application.Organization
{
@@ -1327,6 +1328,27 @@ namespace Learun.Application.Organization
}
}

public UserEntity GetEntityByOldAccount(string account)
{
try
{
UserEntity userEntity;
userEntity = userService.GetEntityByOldAccount(account);
return userEntity;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

///// <summary>
///// 获取用户头像
///// </summary>


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

@@ -210,5 +210,8 @@ namespace Learun.Application.Organization
/// <param name="oldPassword"></param>
/// <returns></returns>
bool RevisePasswordiden(string newPassword, string oldPassword);


UserEntity GetEntityByOldAccount(string account);
}
}

+ 27
- 2
Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs 查看文件

@@ -39,7 +39,32 @@ namespace Learun.Application.Organization
strSql.Append("SELECT ");
strSql.Append(fieldSql);
strSql.Append(" FROM LR_Base_User t ");
strSql.Append(" WHERE (t.F_Account = @account or t.N_Account=@account) AND t.F_DeleteMark = 0 ");
strSql.Append(" WHERE (t.N_Account=@account) AND t.F_DeleteMark = 0 ");
return this.BaseRepository().FindEntity<UserEntity>(strSql.ToString(), new { account = account });
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}


public UserEntity GetEntityByOldAccount(string account)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(fieldSql);
strSql.Append(" FROM LR_Base_User t ");
strSql.Append(" WHERE t.F_Account = @account AND t.F_DeleteMark = 0 ");
return this.BaseRepository().FindEntity<UserEntity>(strSql.ToString(), new { account = account });
}
catch (Exception ex)
@@ -208,7 +233,7 @@ namespace Learun.Application.Organization
keyword = "%" + keyword + "%";
strSql.Append(" AND( t.F_Account like @keyword or t.F_RealName like @keyword or t.N_Account like @keyword or t.F_Mobile like @keyword ) ");
}
return this.BaseRepository().FindList<UserEntity>(strSql.ToString(), new { companyId, departmentId, keyword }, pagination);
}
catch (Exception ex)


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs 查看文件

@@ -519,7 +519,7 @@ namespace Learun.Application.Web.Controllers
//}

#region 内部账户验证
UserEntity userEntity = userBll.CheckLogin(username, password);
UserEntity userEntity = userBll.CheckLogin($"N{username}", password);


#region 写入日志


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/Feixing/UserApiController.cs 查看文件

@@ -621,7 +621,7 @@ namespace Learun.Application.WebApi.Modules.Feixing
string account = Request.Query["account"];
string password = Request.Query["password"];
//验证账户
var userEntity = userIbll.CheckLogin(account, Md5Helper.Encrypt(password, 32));
var userEntity = userIbll.CheckLogin($"N{account}", Md5Helper.Encrypt(password, 32));
var empinfoEntity = empInfoIbll.GetEmpInfoEntityByEmpNo(userEntity.F_Account);
msg = userEntity.LoginMsg;
if (userEntity.LoginOk && empinfoEntity != null)


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TaiGang/TUserApi.cs 查看文件

@@ -100,7 +100,7 @@ namespace Learun.Application.WebApi
var loginModel = this.GetReqData<TLoginModel>();

#region 内部账户验证
UserEntity userEntity = userIBLL.CheckLogin(loginModel.username, Md5Helper.Encrypt(loginModel.password, 32));
UserEntity userEntity = userIBLL.CheckLogin($"N{loginModel.username}", Md5Helper.Encrypt(loginModel.password, 32));

if (!userEntity.LoginOk)//登录失败
{


+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/UserApi.cs 查看文件

@@ -56,15 +56,15 @@ namespace Learun.Application.WebApi
LoginModel loginModel = this.GetReqData<LoginModel>();

#region 内部账户验证
UserEntity userEntity = userIBLL.CheckLogin(loginModel.username, loginModel.password);
UserEntity userEntity = userIBLL.CheckLogin($"N{loginModel.username}", loginModel.password);

#region 写入日志
LogEntity logEntity = new LogEntity();
logEntity.F_CategoryId = 1;
logEntity.F_OperateTypeId = ((int)OperationType.Login).ToString();
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Login);
logEntity.F_OperateAccount = loginModel.username + "(" + userEntity.F_RealName + ")";
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : loginModel.username;
logEntity.F_OperateAccount = $"N{loginModel.username}" + "(" + userEntity.F_RealName + ")";
logEntity.F_OperateUserId = !string.IsNullOrEmpty(userEntity.F_UserId) ? userEntity.F_UserId : $"N{loginModel.username}";
logEntity.F_Module = Config.GetValue("SoftName");
logEntity.F_Description = "移动端";
#endregion


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/WeixinApi.cs 查看文件

@@ -185,7 +185,7 @@ namespace Learun.Application.WebApi.Modules
LoginModel loginModel = this.GetReqData<LoginModel>();

#region 内部账户验证
UserEntity userEntity = userIbll.CheckLogin(loginModel.username, loginModel.password);
UserEntity userEntity = userIbll.CheckLogin($"N{loginModel.username}", loginModel.password);

#region 写入日志
LogEntity logEntity = new LogEntity();


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

@@ -279,6 +279,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
if(keyValue.StartsWith("N"))
{
keyValue=keyValue.Substring(1);
}
return this.BaseRepository("CollegeMIS").FindEntity<EmpInfoEntity>(m => m.EmpNo == keyValue);
}
catch (Exception ex)
@@ -435,7 +439,8 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi
var studentList = new List<UserEntity>();
foreach (var tEntity in teacherList)
{
if (alluserlist.Count(m => m.F_Account == tEntity.EmpNo) > 0)
var empNo = $"N{tEntity.EmpNo}";
if (alluserlist.Count(m => m.N_Account == empNo) > 0)
{
continue;
}
@@ -448,10 +453,10 @@ sum(case when DATEDIFF(YYYY, t.Birthday, GETDATE()) > 20 and DATEDIFF(YYYY, t.Bi

}
UserEntity userbase = new UserEntity();
userbase.F_Account = tEntity.EmpNo;
userbase.N_Account = tEntity.EmpNo;
userbase.F_Account = empNo;
userbase.N_Account = empNo;
userbase.F_RealName = tEntity.EmpName;
userbase.F_EnCode = tEntity.EmpNo;
userbase.F_EnCode = empNo;
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;


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

@@ -328,6 +328,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
if (enCode.StartsWith("N"))
{
enCode = enCode.Substring(1);
}
var data = this.BaseRepository("CollegeMIS").FindEntity<StuInfoBasicEntity>(a => a.StuNo == enCode);
//if (data != null && (data.Photo != null && data.Photo != ""))
//{
@@ -983,6 +987,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration

UserEntity userbase = new UserEntity();
userbase.F_Account = tEntity.StuNo;
userbase.N_Account = $"N{tEntity.StuNo}";
userbase.F_RealName = tEntity.StuName;
userbase.F_EnCode = tEntity.StuNo;
userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower();


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/OperatorHelper.cs 查看文件

@@ -301,7 +301,8 @@ namespace Learun.Util.Operat
userInfo.token = operatorInfo.token;
userInfo.account = operatorInfo.account;

UserEntity userEntity = userIBLL.GetEntityByAccount(operatorInfo.account);
//UserEntity userEntity = userIBLL.GetEntityByAccount(operatorInfo.account);
UserEntity userEntity = userIBLL.GetEntityByOldAccount(operatorInfo.account);
if (userEntity != null)
{
userInfo.userId = userEntity.F_UserId;


正在加载...
取消
保存