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
90828f36
Commit
90828f36
authored
Jan 27, 2021
by
喻春霖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
f573188a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
3 deletions
+103
-3
AuthLogController.java
...l/eden/authcenter/agent/controller/AuthLogController.java
+103
-3
No files found.
eden-authcenter-agent/src/main/java/com/chineseall/eden/authcenter/agent/controller/AuthLogController.java
View file @
90828f36
...
...
@@ -40,7 +40,7 @@ public class AuthLogController {
ModelAndView
mv
=
new
ModelAndView
();
if
(
userName
.
equals
(
USER_NAME
)
&&
pwd
.
equals
(
PWD
)){
request
.
getSession
().
setAttribute
(
"loginFlag"
,
"1"
);
response
.
sendRedirect
(
"loginstat"
);
response
.
sendRedirect
(
"loginstat
2
"
);
}
else
{
mv
.
setViewName
(
"error"
);
mv
.
addObject
(
"message"
,
"账号或密码错误"
);
...
...
@@ -49,14 +49,114 @@ public class AuthLogController {
return
null
;
}
@RequestMapping
(
value
=
"loginstat2"
)
public
ModelAndView
loginStat2
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
ModelAndView
mv
=
new
ModelAndView
();
String
flag
=
(
String
)
request
.
getSession
().
getAttribute
(
"loginFlag"
);
if
(
StringUtils
.
isNotEmpty
(
flag
)){
mv
.
setViewName
(
"statistics"
);
}
else
{
response
.
sendRedirect
(
"adminLogin"
);
return
null
;
}
return
mv
;
}
@RequestMapping
(
value
=
"loginstat"
)
public
ModelAndView
loginStat
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
ModelAndView
mv
=
new
ModelAndView
();
String
flag
=
(
String
)
request
.
getSession
().
getAttribute
(
"loginFlag"
);
if
(
StringUtils
.
isNotEmpty
(
flag
)){
mv
.
setViewName
(
"statistics"
);
mv
.
setViewName
(
"loginstat"
);
// 累计登录人次
Map
<
String
,
Object
>
params1
=
new
HashMap
<>();
params1
.
put
(
"authSource"
,
"上海运营中心"
);
params1
.
put
(
"getUserInfoSuccessFlag"
,
true
);
Long
loginCounts
=
authLogService
.
countLoginByParams
(
params1
);
mv
.
addObject
(
"data_total"
,
loginCounts
);
// 电教馆累计登录人次
Map
<
String
,
Object
>
params2
=
new
HashMap
<>();
params2
.
put
(
"authSource"
,
"上海运营中心"
);
params2
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params2
.
put
(
"oauthType"
,
OauthType
.
dianjiaoguan
.
name
());
Long
dianjiaoguanLoginCounts
=
authLogService
.
countLoginByParams
(
params2
);
mv
.
addObject
(
"data_total_djg"
,
dianjiaoguanLoginCounts
);
// 省运营累计登录人次
Map
<
String
,
Object
>
params3
=
new
HashMap
<>();
params3
.
put
(
"authSource"
,
"上海运营中心"
);
params3
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params3
.
put
(
"oauthType"
,
OauthType
.
edenoperation
.
name
());
Long
edenoperationLoginCounts
=
authLogService
.
countLoginByParams
(
params3
);
mv
.
addObject
(
"data_total_syy"
,
edenoperationLoginCounts
);
// 近30日累计登录人次
Map
<
String
,
Object
>
params4
=
new
HashMap
<>();
params4
.
put
(
"authSource"
,
"上海运营中心"
);
params4
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params4
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-
29
)));
Long
loginCounts30Day
=
authLogService
.
countLoginByParams
(
params4
);
mv
.
addObject
(
"data_30"
,
loginCounts30Day
);
// 电教馆近30日累计登录人次
Map
<
String
,
Object
>
params5
=
new
HashMap
<>();
params5
.
put
(
"authSource"
,
"上海运营中心"
);
params5
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params5
.
put
(
"oauthType"
,
OauthType
.
dianjiaoguan
.
name
());
params5
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-
29
)));
Long
dianjiaoguanLoginCounts30Day
=
authLogService
.
countLoginByParams
(
params5
);
mv
.
addObject
(
"data_30_djg"
,
dianjiaoguanLoginCounts30Day
);
// 省运营近30日累计登录人次
Map
<
String
,
Object
>
params6
=
new
HashMap
<>();
params6
.
put
(
"authSource"
,
"上海运营中心"
);
params6
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params6
.
put
(
"oauthType"
,
OauthType
.
edenoperation
.
name
());
params6
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-
29
)));
Long
edenoperationLoginCounts30Day
=
authLogService
.
countLoginByParams
(
params6
);
mv
.
addObject
(
"data_30_syy"
,
edenoperationLoginCounts30Day
);
// 近7日累计登录人次
Map
<
String
,
Object
>
params7
=
new
HashMap
<>();
params7
.
put
(
"authSource"
,
"上海运营中心"
);
params7
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params7
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-
6
)));
Long
loginCounts7Day
=
authLogService
.
countLoginByParams
(
params7
);
mv
.
addObject
(
"data_7"
,
loginCounts7Day
);
// 电教馆近7日累计登录人次
Map
<
String
,
Object
>
params8
=
new
HashMap
<>();
params8
.
put
(
"authSource"
,
"上海运营中心"
);
params8
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params8
.
put
(
"oauthType"
,
OauthType
.
dianjiaoguan
.
name
());
params8
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-
6
)));
Long
dianjiaoguanLoginCounts7Day
=
authLogService
.
countLoginByParams
(
params8
);
mv
.
addObject
(
"data_7_djj"
,
dianjiaoguanLoginCounts7Day
);
// 省运营近7日累计登录人次
Map
<
String
,
Object
>
params9
=
new
HashMap
<>();
params9
.
put
(
"authSource"
,
"上海运营中心"
);
params9
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params9
.
put
(
"oauthType"
,
OauthType
.
edenoperation
.
name
());
params9
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-
6
)));
Long
edenoperationLoginCounts7Day
=
authLogService
.
countLoginByParams
(
params9
);
mv
.
addObject
(
"data_7_syy"
,
edenoperationLoginCounts7Day
);
// 近7日登录人次查询
List
<
String
>
dates
=
new
ArrayList
<>();
List
<
Long
>
dianjiaoguanDay7counts
=
new
ArrayList
<>();
List
<
Long
>
edenoperationDay7counts
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
7
;
i
++){
dates
.
add
(
getDateDtr
(
DateUtils
.
addDays
(
new
Date
(),
-(
6
-
i
))));
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"authSource"
,
"上海运营中心"
);
params
.
put
(
"getUserInfoSuccessFlag"
,
true
);
params
.
put
(
"beginTime"
,
getZeroTime
(
DateUtils
.
addDays
(
new
Date
(),
-(
6
-
i
))));
params
.
put
(
"endTime"
,
getEndTime
(
DateUtils
.
addDays
(
new
Date
(),
-(
6
-
i
))));
params
.
put
(
"oauthType"
,
OauthType
.
dianjiaoguan
.
name
());
Long
dianjiaoguanCounts
=
authLogService
.
countLoginByParams
(
params
);
dianjiaoguanDay7counts
.
add
(
dianjiaoguanCounts
);
params
.
put
(
"oauthType"
,
OauthType
.
edenoperation
.
name
());
Long
edenoperationCounts
=
authLogService
.
countLoginByParams
(
params
);
edenoperationDay7counts
.
add
(
edenoperationCounts
);
}
mv
.
addObject
(
"data_time"
,
dates
);
mv
.
addObject
(
"data_djg"
,
dianjiaoguanDay7counts
);
mv
.
addObject
(
"data_syy"
,
edenoperationDay7counts
);
}
else
{
response
.
sendRedirect
(
"adminLogin"
);
return
null
;
...
...
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