Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sh-ds
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
李良停
sh-ds
Commits
ef192cbc
Commit
ef192cbc
authored
Jan 28, 2021
by
喻春霖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善结构真实数据
parent
dbaa4156
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
24 deletions
+95
-24
LogStatisticsController.java
.../authcenter/agent/controller/LogStatisticsController.java
+95
-24
No files found.
eden-authcenter-agent/src/main/java/com/chineseall/eden/authcenter/agent/controller/LogStatisticsController.java
View file @
ef192cbc
...
...
@@ -14,10 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
@Controller
@RequestMapping
(
"logstatistics"
)
...
...
@@ -106,6 +103,12 @@ public class LogStatisticsController {
if
(
clientId
!=
null
){
param
.
put
(
"clientId"
,
clientId
);
}
if
(
null
!=
year
){
param
.
put
(
"year"
,
year
);
}
if
(
null
!=
month
){
param
.
put
(
"yearMonth"
,
month
);
}
List
<
StatItem
>
browserResult
=
new
ArrayList
<>();
List
<
String
>
browserList
=
authLogService
.
distinct
(
"browser"
,
param
);
...
...
@@ -154,18 +157,37 @@ public class LogStatisticsController {
public
MapMessage
auths
(
@RequestParam
(
value
=
"clientId"
,
required
=
false
)
String
clientId
,
@RequestParam
(
value
=
"year"
,
required
=
false
)
Integer
year
,
@RequestParam
(
value
=
"month"
,
required
=
false
)
Integer
month
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"all_auth"
,
1500000
);
result
.
put
(
"cas_edu_auth"
,
100000
);
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"getUserInfoSuccessFlag"
,
true
);
if
(
clientId
!=
null
){
param
.
put
(
"clientId"
,
clientId
);
}
if
(
null
!=
year
){
param
.
put
(
"year"
,
year
);
}
if
(
null
!=
month
){
param
.
put
(
"yearMonth"
,
month
);
}
long
all_auth
=
authLogService
.
count
(
param
);
result
.
put
(
"all_auth"
,
all_auth
);
param
.
put
(
"oauthType"
,
"dianjiaoguan"
);
long
cas_edu_auth
=
authLogService
.
count
(
param
);
result
.
put
(
"cas_edu_auth"
,
cas_edu_auth
);
List
<
StatItem
>
browserResult
=
new
ArrayList
<>();
StatItem
item1
=
new
StatItem
();
item1
.
setName
(
"黄浦区"
);
item1
.
setCount
(
1000
);
StatItem
item2
=
new
StatItem
();
item2
.
setName
(
"青浦区"
);
item2
.
setCount
(
1000
);
browserResult
.
add
(
item1
);
browserResult
.
add
(
item2
);
for
(
String
area
:
areas
)
{
StatItem
item
=
new
StatItem
();
item
.
setName
(
area
);
if
(
area
.
equals
(
"青浦"
)){
param
.
put
(
"oauthType"
,
"qpjy"
);
long
qpjy
=
authLogService
.
count
(
param
);
item
.
setCount
(
qpjy
);
}
browserResult
.
add
(
item
);
}
result
.
put
(
"area_auth"
,
browserResult
);
return
MapMessage
.
successMessage
().
add
(
"data"
,
result
);
}
...
...
@@ -181,6 +203,21 @@ public class LogStatisticsController {
@ResponseBody
public
MapMessage
authPickTimes
(
@RequestParam
(
value
=
"clientId"
,
required
=
false
)
String
clientId
,
@RequestParam
(
value
=
"year"
,
required
=
false
)
Integer
year
,
@RequestParam
(
value
=
"month"
,
required
=
false
)
Integer
month
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"getUserInfoSuccessFlag"
,
true
);
if
(
clientId
!=
null
){
param
.
put
(
"clientId"
,
clientId
);
}
if
(
null
!=
year
){
param
.
put
(
"year"
,
year
);
}
if
(
null
!=
month
){
param
.
put
(
"yearMonth"
,
month
);
}
List
<
StatItem
>
result
=
new
ArrayList
<>();
StatItem
item1
=
new
StatItem
();
item1
.
setName
(
"2020-01"
);
...
...
@@ -205,13 +242,30 @@ public class LogStatisticsController {
@ResponseBody
public
MapMessage
authUserTypes
(
@RequestParam
(
value
=
"clientId"
,
required
=
false
)
String
clientId
,
@RequestParam
(
value
=
"year"
,
required
=
false
)
Integer
year
,
@RequestParam
(
value
=
"month"
,
required
=
false
)
Integer
month
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"getUserInfoSuccessFlag"
,
true
);
if
(
clientId
!=
null
){
param
.
put
(
"clientId"
,
clientId
);
}
if
(
null
!=
year
){
param
.
put
(
"year"
,
year
);
}
if
(
null
!=
month
){
param
.
put
(
"yearMonth"
,
month
);
}
param
.
put
(
"logUserInfo.userType"
,
"TEACHER"
);
long
teacherCount
=
authLogService
.
count
(
param
);
param
.
put
(
"logUserInfo.userType"
,
"STUDENT"
);
long
studentCount
=
authLogService
.
count
(
param
);
List
<
StatItem
>
result
=
new
ArrayList
<>();
StatItem
item1
=
new
StatItem
();
item1
.
setName
(
"老师"
);
item1
.
setCount
(
1000
);
item1
.
setCount
(
teacherCount
);
StatItem
item2
=
new
StatItem
();
item2
.
setName
(
"学生"
);
item2
.
setCount
(
1000
);
item2
.
setCount
(
studentCount
);
result
.
add
(
item1
);
result
.
add
(
item2
);
return
MapMessage
.
successMessage
().
add
(
"data"
,
result
);
...
...
@@ -228,16 +282,33 @@ public class LogStatisticsController {
@RequestMapping
(
"auth_hot_org"
)
@ResponseBody
public
MapMessage
authHotOrgs
(
@RequestParam
(
value
=
"clientId"
,
required
=
false
)
String
clientId
,
@RequestParam
(
value
=
"year"
,
required
=
false
)
Integer
year
,
@RequestParam
(
value
=
"month"
,
required
=
false
)
Integer
month
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"getUserInfoSuccessFlag"
,
true
);
if
(
clientId
!=
null
){
param
.
put
(
"clientId"
,
clientId
);
}
if
(
null
!=
year
){
param
.
put
(
"year"
,
year
);
}
if
(
null
!=
month
){
param
.
put
(
"yearMonth"
,
month
);
}
List
<
String
>
schoolNames
=
authLogService
.
distinct
(
"logUserInfo.schoolName"
,
param
);
List
<
StatItem
>
result
=
new
ArrayList
<>();
StatItem
item1
=
new
StatItem
();
item1
.
setName
(
"A学校"
);
item1
.
setCount
(
1000
);
StatItem
item2
=
new
StatItem
();
item2
.
setName
(
"B学校"
);
item2
.
setCount
(
1000
);
result
.
add
(
item1
);
result
.
add
(
item2
);
if
(
CollectionUtils
.
isNotEmpty
(
schoolNames
)){
schoolNames
.
forEach
(
name
->
{
param
.
put
(
"logUserInfo.schoolName"
,
name
);
long
count
=
authLogService
.
count
(
param
);
StatItem
item
=
new
StatItem
();
item
.
setCount
(
count
);
item
.
setName
(
name
);
result
.
add
(
item
);
});
}
result
.
sort
(
Comparator
.
comparing
(
StatItem:
:
getCount
).
reversed
());
return
MapMessage
.
successMessage
().
add
(
"data"
,
result
);
}
...
...
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