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
4d46c2e0
Commit
4d46c2e0
authored
Dec 09, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
10b09886
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
8 deletions
+71
-8
UserChangeLogModule.cs
Edu.Module.Log/UserChangeLogModule.cs
+48
-2
RB_User_ChangeLogRepository.cs
Edu.Repository/Log/RB_User_ChangeLogRepository.cs
+1
-0
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+0
-5
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+22
-1
No files found.
Edu.Module.Log/UserChangeLogModule.cs
View file @
4d46c2e0
...
...
@@ -4,6 +4,9 @@ using Edu.Repository.Log;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
using
Edu.Repository.User
;
using
Edu.Model.ViewModel.User
;
namespace
Edu.Module.Log
{
...
...
@@ -14,14 +17,56 @@ namespace Edu.Module.Log
/// </summary>
private
readonly
RB_User_ChangeLogRepository
changeLogRepository
=
new
RB_User_ChangeLogRepository
();
/// <summary>
/// 账号仓储层对象
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 获取用户信息改变日志列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_User_ChangeLog_ViewModel
>
GetUserChangeLogListModule
(
RB_User_ChangeLog_ViewModel
query
)
public
object
GetUserChangeLogListModule
(
RB_User_ChangeLog_ViewModel
query
)
{
return
changeLogRepository
.
GetUserChangeLogListRepository
(
query
);
List
<
object
>
list
=
new
List
<
object
>();
var
logList
=
changeLogRepository
.
GetUserChangeLogListRepository
(
query
);
if
(
logList
!=
null
&&
logList
.
Count
>
0
)
{
var
empList
=
new
List
<
Employee_ViewModel
>();
string
uids
=
string
.
Join
(
","
,
logList
.
Select
(
qitem
=>
qitem
.
CreateBy
));
if
(!
string
.
IsNullOrEmpty
(
uids
))
{
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
QIds
=
uids
});
}
var
dayList
=
logList
.
GroupBy
(
qitem
=>
new
{
NewTime
=
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
CreateTime
)
}).
OrderByDescending
(
qitem
=>
qitem
.
Key
.
NewTime
).
Select
(
qitem
=>
new
{
qitem
.
Key
.
NewTime
});
if
(
dayList
!=
null
&&
dayList
.
Count
()
>
0
)
{
foreach
(
var
item
in
dayList
)
{
var
subList
=
logList
.
Where
(
qitem
=>
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
CreateTime
)
==
item
.
NewTime
).
ToList
();
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
{
list
.
Add
(
new
{
item
.
NewTime
,
WeekStr
=
Common
.
ConvertHelper
.
GetWeekDay
(
Convert
.
ToDateTime
(
item
.
NewTime
)),
LogList
=
subList
.
Select
(
qitem
=>
new
{
TimeStr
=
Common
.
ConvertHelper
.
FormatTimeStr
(
qitem
.
CreateTime
),
UserIcon
=
empList
?.
Where
(
eItem
=>
eItem
.
Id
==
qitem
.
CreateBy
)?.
FirstOrDefault
()?.
UserIcon
??
""
,
CreateName
=
empList
?.
Where
(
eItem
=>
eItem
.
Id
==
qitem
.
CreateBy
)?.
FirstOrDefault
()?.
EmployeeName
??
""
,
qitem
.
LogContent
})
});
}
}
}
}
return
list
;
}
/// <summary>
...
...
@@ -33,6 +78,7 @@ namespace Edu.Module.Log
{
return
changeLogRepository
.
Insert
(
extModel
)
>
0
;
}
/// <summary>
/// 获取日志列表
/// </summary>
...
...
Edu.Repository/Log/RB_User_ChangeLogRepository.cs
View file @
4d46c2e0
...
...
@@ -51,6 +51,7 @@ WHERE 1=1
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_User_ChangeLog_ViewModel
.
SourceId
)}
=
{
query
.
SourceId
}
"
);
}
}
builder
.
Append
(
" ORDER BY CreateTime DESC "
);
return
Get
<
RB_User_ChangeLog_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
...
...
Edu.Repository/User/RB_AccountRepository.cs
View file @
4d46c2e0
...
...
@@ -376,11 +376,6 @@ FROM
return
model
;
}
/// <summary>
/// 获取账号列表(批量修改密码专用)
/// </summary>
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
4d46c2e0
...
...
@@ -6,6 +6,7 @@ using Edu.Cache.User;
using
Edu.Common.API
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Log
;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.Log
;
using
Edu.Module.User
;
...
...
@@ -842,7 +843,7 @@ namespace Edu.WebApi.Controllers.User
EducationStr
=
(
extModel
?.
Education
??
0
).
ToName
(),
EmployeeName
=
extModel
?.
EmployeeName
??
""
,
EmployeeTel
=
extModel
?.
EmployeeTel
??
""
,
EntryTime
=
extModel
?.
EntryTime
,
EntryTime
=
Common
.
ConvertHelper
.
FormatDate
((
extModel
?.
EntryTime
))
,
GroupName
=
extModel
?.
GroupName
??
""
,
Group_Id
=
extModel
?.
Group_Id
??
0
,
IDCard
=
extModel
?.
IDCard
??
""
,
...
...
@@ -1341,5 +1342,25 @@ namespace Edu.WebApi.Controllers.User
return
ApiResult
.
Success
(
data
:
list
);
}
#
endregion
#
region
获取用户修改日志
/// <summary>
/// 获取岗位列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetEmpChangeLog
()
{
var
query
=
new
RB_User_ChangeLog_ViewModel
()
{
AccountType
=
(
AccountTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"AccountType"
),
SourceId
=
base
.
ParmJObj
.
GetInt
(
"AccountId"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
userChangeLogModule
.
GetUserChangeLogListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
#
endregion
}
}
\ No newline at end of file
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