@@ -6,16 +6,16 @@ | |||||
// webapi: 'http://112.230.201.53:31173/', | // webapi: 'http://112.230.201.53:31173/', | ||||
// web:"http://112.230.201.53/:8081/"//web地址,用于配置logo | // web:"http://112.230.201.53/:8081/"//web地址,用于配置logo | ||||
// }; | // }; | ||||
var config = { | |||||
webapi: 'http://10.30.0.10:9002/', | |||||
web: "http://10.30.0.10:8000/"//web地址,用于配置logo | |||||
}; | |||||
// var config = { | |||||
// webapi: 'http://10.30.0.10:9002/', | |||||
// web: "http://10.30.0.10:8000/"//web地址,用于配置logo | |||||
// }; | |||||
//var config = { | |||||
// webapi: 'http://localhost:8081/', | |||||
// web: "http://localhost:8080/"//web地址,用于配置logo | |||||
//}; | |||||
var config = { | |||||
webapi: 'http://localhost:31173/', | |||||
web: "http://localhost:20472/"//web地址,用于配置logo | |||||
}; | |||||
//var config = { | //var config = { | ||||
// webapi: 'http://123.57.209.16:31174/', | // webapi: 'http://123.57.209.16:31174/', | ||||
// web: "http://123.57.209.16:31175/"//web地址,用于配置logo | // web: "http://123.57.209.16:31175/"//web地址,用于配置logo | ||||
@@ -681,44 +681,39 @@ namespace Learun.Application.Organization | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
Dictionary<string, UserModel> dic = cache.Read<Dictionary<string, UserModel>>(cacheKey + "dic", CacheId.user); | |||||
if (dic == null) | |||||
Dictionary<string, UserModel> dic = new Dictionary<string, UserModel>(); | |||||
var list = userService.GetAllList(); | |||||
foreach (var item in list) | |||||
{ | { | ||||
dic = new Dictionary<string, UserModel>(); | |||||
var list = userService.GetAllList(); | |||||
foreach (var item in list) | |||||
UserModel model = new UserModel() | |||||
{ | |||||
companyId = item.F_CompanyId, | |||||
departmentId = item.F_DepartmentId, | |||||
name = item.F_RealName, | |||||
}; | |||||
string img = ""; | |||||
if (!string.IsNullOrEmpty(item.F_HeadIcon)) | |||||
{ | { | ||||
UserModel model = new UserModel() | |||||
string fileHeadImg = Config.GetValue("fileHeadImg"); | |||||
string fileImg = string.Format("{0}/{1}{2}", fileHeadImg, item.F_UserId, item.F_HeadIcon); | |||||
if (DirFileHelper.IsExistFile(fileImg)) | |||||
{ | { | ||||
companyId = item.F_CompanyId, | |||||
departmentId = item.F_DepartmentId, | |||||
name = item.F_RealName, | |||||
}; | |||||
string img = ""; | |||||
if (!string.IsNullOrEmpty(item.F_HeadIcon)) | |||||
img = item.F_HeadIcon; | |||||
} | |||||
} | |||||
if (string.IsNullOrEmpty(img)) | |||||
{ | |||||
if (item.F_Gender == 0) | |||||
{ | { | ||||
string fileHeadImg = Config.GetValue("fileHeadImg"); | |||||
string fileImg = string.Format("{0}/{1}{2}", fileHeadImg, item.F_UserId, item.F_HeadIcon); | |||||
if (DirFileHelper.IsExistFile(fileImg)) | |||||
{ | |||||
img = item.F_HeadIcon; | |||||
} | |||||
img = "0"; | |||||
} | } | ||||
if (string.IsNullOrEmpty(img)) | |||||
else | |||||
{ | { | ||||
if (item.F_Gender == 0) | |||||
{ | |||||
img = "0"; | |||||
} | |||||
else | |||||
{ | |||||
img = "1"; | |||||
} | |||||
img = "1"; | |||||
} | } | ||||
model.img = img; | |||||
dic.Add(item.F_UserId, model); | |||||
cache.Write(cacheKey + "dic", dic, CacheId.user); | |||||
} | } | ||||
model.img = img; | |||||
dic.Add(item.F_UserId, model); | |||||
} | } | ||||
return dic; | return dic; | ||||
} | } | ||||
@@ -1189,7 +1184,8 @@ namespace Learun.Application.Organization | |||||
LoginOk = false | LoginOk = false | ||||
}; | }; | ||||
return userEntity; | return userEntity; | ||||
}else if (userEntity.F_Description != "学生") | |||||
} | |||||
else if (userEntity.F_Description != "学生") | |||||
{ | { | ||||
userEntity = new UserEntity() | userEntity = new UserEntity() | ||||
{ | { | ||||
@@ -1198,9 +1194,9 @@ namespace Learun.Application.Organization | |||||
}; | }; | ||||
return userEntity; | return userEntity; | ||||
} | } | ||||
else | |||||
else | |||||
{ | { | ||||
} | } | ||||
userEntity.LoginOk = false; | userEntity.LoginOk = false; | ||||
@@ -1237,7 +1233,7 @@ namespace Learun.Application.Organization | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 获取用户头像 | /// 获取用户头像 | ||||
/// </summary> | /// </summary> | ||||
@@ -185,7 +185,7 @@ namespace Learun.Application.Organization | |||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(fieldSql.Replace("t.F_Password,", "").Replace("t.F_Secretkey,", "")); | strSql.Append(fieldSql.Replace("t.F_Password,", "").Replace("t.F_Secretkey,", "")); | ||||
strSql.Append(",F_UserId as F_UserId_Log FROM LR_Base_User t WHERE t.F_DeleteMark = 0 AND t.F_CompanyId = @companyId "); | |||||
strSql.Append(",F_UserId as F_UserId_Log,b.F_Order as DeptOrder FROM LR_Base_User t left join LR_Base_Department b on t.F_DepartmentId=b.F_DepartmentId WHERE t.F_DeleteMark = 0 AND t.F_CompanyId = @companyId "); | |||||
if (!string.IsNullOrEmpty(departmentId)) | if (!string.IsNullOrEmpty(departmentId)) | ||||
{ | { | ||||
@@ -208,7 +208,7 @@ namespace Learun.Application.Organization | |||||
keyword = "%" + keyword + "%"; | keyword = "%" + keyword + "%"; | ||||
strSql.Append(" AND( t.F_Account like @keyword or t.F_RealName like @keyword or t.F_Mobile like @keyword ) "); | strSql.Append(" AND( t.F_Account like @keyword or t.F_RealName like @keyword or t.F_Mobile like @keyword ) "); | ||||
} | } | ||||
return this.BaseRepository().FindList<UserEntity>(strSql.ToString(), new { companyId, departmentId, keyword }, pagination); | return this.BaseRepository().FindList<UserEntity>(strSql.ToString(), new { companyId, departmentId, keyword }, pagination); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -236,7 +236,7 @@ namespace Learun.Application.Organization | |||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(fieldSql.Replace("t.F_Password,", "").Replace("t.F_Secretkey,", "")); | strSql.Append(fieldSql.Replace("t.F_Password,", "").Replace("t.F_Secretkey,", "")); | ||||
strSql.Append(" FROM LR_Base_User t WHERE t.F_DeleteMark = 0 ORDER BY t.F_CompanyId,t.F_DepartmentId,t.F_RealName "); | |||||
strSql.Append(" FROM LR_Base_User t WHERE t.F_DeleteMark = 0 ORDER BY t.F_Order "); | |||||
return this.BaseRepository().FindList<UserEntity>(strSql.ToString()); | return this.BaseRepository().FindList<UserEntity>(strSql.ToString()); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -373,7 +373,7 @@ var bootstrap = function ($, learun) { | |||||
isPage: true, | isPage: true, | ||||
reloadSelected: true, | reloadSelected: true, | ||||
mainId: 'F_UserId', | mainId: 'F_UserId', | ||||
sidx: 'F_Order asc', | |||||
sidx: 'DeptOrder,F_Order,F_Account', | |||||
isMultiselect: true | isMultiselect: true | ||||
}); | }); | ||||
}, | }, | ||||