Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
02bda292
Commit
02bda292
authored
Sep 22, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增头像
parent
e4105f28
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
128 additions
and
13 deletions
+128
-13
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+22
-0
UserInfo.cs
Edu.Model/CacheModel/UserInfo.cs
+10
-0
RB_Account_ViewModel.cs
Edu.Model/ViewModel/User/RB_Account_ViewModel.cs
+10
-0
RB_Group_ViewModel.cs
Edu.Model/ViewModel/User/RB_Group_ViewModel.cs
+33
-4
RB_Teacher_ViewModel.cs
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
+20
-0
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+7
-7
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+3
-1
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+23
-1
No files found.
Edu.Common/Plugin/ConvertHelper.cs
View file @
02bda292
...
...
@@ -136,5 +136,27 @@ namespace Edu.Common
}
return
timeStr
;
}
/// <summary>
/// 格式化时间【yyyy-MM-dd HH:mm:ss】
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public
static
string
FormatDate
(
object
time
)
{
string
timeStr
=
""
;
if
(
time
!=
null
)
{
try
{
timeStr
=
Convert
.
ToDateTime
(
time
.
ToString
()).
ToString
(
"yyyy-MM-dd"
);
}
catch
{
}
}
return
timeStr
;
}
}
}
\ No newline at end of file
Edu.Model/CacheModel/UserInfo.cs
View file @
02bda292
...
...
@@ -48,5 +48,15 @@ namespace Edu.Model.CacheModel
/// 菜单列表
/// </summary>
public
object
MenuList
{
get
;
set
;
}
/// <summary>
/// 集团Logo
/// </summary>
public
string
GroupLogo
{
get
;
set
;
}
/// <summary>
/// 用户头像
/// </summary>
public
string
UserIcon
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/User/RB_Account_ViewModel.cs
View file @
02bda292
...
...
@@ -24,5 +24,15 @@ namespace Edu.Model.ViewModel.User
/// 学校名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
/// <summary>
/// 集团Logo
/// </summary>
public
string
GroupLogo
{
get
;
set
;
}
/// <summary>
/// 用户头像
/// </summary>
public
string
UserIcon
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/User/RB_Group_ViewModel.cs
View file @
02bda292
...
...
@@ -10,10 +10,39 @@ namespace Edu.Model.ViewModel.User
[
Serializable
]
public
class
RB_Group_ViewModel
:
Model
.
Entity
.
User
.
RB_Group
{
public
string
CreateTimeStr
{
get
{
return
""
;
}
}
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
public
string
UpdateTimeStr
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
string
CreateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
CreateTime
);
}
}
/// <summary>
/// 修改人
/// </summary>
public
string
UpdateByName
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
string
UpdateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
UpdateTime
);
}
}
}
}
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
View file @
02bda292
...
...
@@ -19,5 +19,25 @@ namespace Edu.Model.ViewModel.User
/// 学校名称
/// </summary>
public
string
SName
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
string
CreateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
CreateTime
);
}
}
/// <summary>
/// 修改人
/// </summary>
public
string
UpdateByName
{
get
;
set
;
}
/// <summary>
/// 修改时间
/// </summary>
public
string
UpdateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
UpdateTime
);
}
}
}
}
\ No newline at end of file
Edu.Repository/User/RB_AccountRepository.cs
View file @
02bda292
...
...
@@ -126,22 +126,22 @@ WHERE 1=1
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
SELECT A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(G.Logo,'') AS GroupLogo
FROM
(
SELECT A.*,IFNULL(B.MName,'') AS AccountName
SELECT A.*,IFNULL(B.MName,'') AS AccountName
,B.MHead AS UserIcon
FROM rb_account AS A INNER JOIN rb_manager AS B ON A.AccountId=B.MId AND A.AccountType=1
WHERE 1=1
{0}
WHERE 1=1 {0}
UNION ALL
SELECT A.*,IFNULL(B.TeacherName,'') AS AccountName
SELECT A.*,IFNULL(B.TeacherName,'') AS AccountName
,B.TeacherIcon AS UserIcon
FROM rb_account AS A INNER JOIN rb_teacher AS B ON A.AccountId=B.TId AND A.AccountType=2
WHERE 1=1 {0}
UNION ALL
SELECT A.*,IFNULL(B.AssistName,'') AS AccountName
SELECT A.*,IFNULL(B.AssistName,'') AS AccountName
,B.AssistIcon AS UserIcon
FROM rb_account AS A INNER JOIN rb_assist AS B ON A.AccountId=B.AId AND A.AccountType=3
WHERE 1=1
{0}
WHERE 1=1
{0}
UNION ALL
SELECT A.*,IFNULL(B.StuName,'') AS AccountName
SELECT A.*,IFNULL(B.StuName,'') AS AccountName
,B.StuIcon AS UserIcon
FROM rb_account AS A INNER JOIN rb_student AS B ON A.AccountId=B.StuId AND A.AccountType=4
WHERE 1=1 {0}
) AS A LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
02bda292
...
...
@@ -83,7 +83,9 @@ namespace Edu.WebApi.Controllers.User
GroupName
=
model
.
GroupName
,
SchoolName
=
model
.
SchoolName
,
Token
=
token
,
MenuList
=
treeList
MenuList
=
treeList
,
GroupLogo
=
model
.
GroupLogo
,
UserIcon
=
model
.
UserIcon
,
};
UserReidsCache
.
UserInfoSet
(
Cache
.
CacheKey
.
User_Login_Key
+
model
.
Id
,
obj
,
Common
.
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
data
:
obj
);
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
02bda292
...
...
@@ -77,6 +77,17 @@ namespace Edu.WebApi.Controllers.User
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Group_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
list
=
groupModule
.
GetGroupPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
if
(
item
.
UpdateBy
>
0
)
{
item
.
UpdateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
UpdateBy
)?.
AccountName
??
""
;
}
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
list
);
...
...
@@ -95,7 +106,7 @@ namespace Edu.WebApi.Controllers.User
extModel
.
UpdateBy
=
base
.
UserInfo
.
Id
;
extModel
.
UpdateTime
=
DateTime
.
Now
;
bool
flag
=
groupModule
.
SetGroupModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
...
...
@@ -221,6 +232,17 @@ namespace Edu.WebApi.Controllers.User
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
teacherModule
.
GetTeacherPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
if
(
item
.
UpdateBy
>
0
)
{
item
.
UpdateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
UpdateBy
)?.
AccountName
??
""
;
}
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
list
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment